Libvirt compilation failure under mingw32
Erik van Pienbroek
erik at vanpienbroek.nl
Mon Aug 24 16:22:36 UTC 2009
Op maandag 24-08-2009 om 17:11 uur [tijdzone +0100], schreef Adam
Huffman:
> Today I've been trying to compile libvirt 0.7.0 under mingw32 on a
> Fedora 10 box.
>
> After installing portablexdr from the review request, I got much
> further. However, compilation fails during the tests:
>
> make[3]: Entering directory `/newhome/adam/Build/libvirt-0.7.0/tests'
> CC virshtest.o
> CC testutils.o
> CCLD virshtest.exe
> testutils.o: In function `virtTestClearLineRegex':
> /newhome/adam/Build/libvirt-0.7.0/tests/testutils.c:467: undefined
> reference to `_regcomp'
> /newhome/adam/Build/libvirt-0.7.0/tests/testutils.c:476: undefined
> reference to `_regexec'
> /newhome/adam/Build/libvirt-0.7.0/tests/testutils.c:499: undefined
> reference to `_regfree'
> collect2: ld returned 1 exit status
> make[3]: *** [virshtest.exe] Error 1
> make[3]: Leaving directory `/newhome/adam/Build/libvirt-0.7.0/tests'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory `/newhome/adam/Build/libvirt-0.7.0/tests'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/newhome/adam/Build/libvirt-0.7.0'
> make: *** [all] Error 2
>
> Is this expected? Am I missing another package not yet in Fedora?
Hi Adam,
The functions 'regcomp', 'regexec' and 'regfree' are part of glibc on
Linux environments. As Win32 doesn't have glibc you need to use a
separate library like mingw32-libgnurx for these functions. This package
should be available in the Fedora 10 repositories. You may need to patch
some files (configure.ac/Makefile.am) in libvirt to get it to use
mingw32-libgnurx (you need to add '-lregex' to the LDFLAGS).
Regards,
Erik van Pienbroek
More information about the mingw
mailing list