From: JonY <10...@gm...> - 2008-06-06 15:06:34
|
Boyd, Todd M. wrote: > Are there any serious differences between the regex.h/regex.c from GNU > Linux (particularly Debian, as that is my current distro) and the MinGW > version of regex.h/regex.c? > > I have converted my program to Windows-compatible code, with “#include > <regex.h>” in the appropriate place, and using the regex_t type does not > throw any errors, but when I try to compile my source I get the following: > > C:\temp>c:\mingw\bin\gcc.exe qcrawl-1.4.c > > C:\DOCUME~1\tmboyd1\LOCALS~1\Temp/cc2JieWn.o:qcrawl-1.4.c:(.text+0x43): > undefined reference to `regcomp' > > C:\DOCUME~1\tmboyd1\LOCALS~1\Temp/cc2JieWn.o:qcrawl-1.4.c:(.text+0x64): > undefined reference to `regcomp' > > C:\DOCUME~1\tmboyd1\LOCALS~1\Temp/cc2JieWn.o:qcrawl-1.4.c:(.text+0x97): > undefined reference to `regfree' > > C:\DOCUME~1\tmboyd1\LOCALS~1\Temp/cc2JieWn.o:qcrawl-1.4.c:(.text+0xa3): > undefined reference to `regfree' > > C:\DOCUME~1\tmboyd1\LOCALS~1\Temp/cc2JieWn.o:qcrawl-1.4.c:(.text+0x4d0): > undefined reference to `regexec' > > C:\DOCUME~1\tmboyd1\LOCALS~1\Temp/cc2JieWn.o:qcrawl-1.4.c:(.text+0x63a): > undefined reference to `regexec' > > collect2: ld returned 1 exit status > > It’s awful confusing to me, as I see those functions inside the regex.h > that MinGW uses. I’ve even tried copying regex.h/regex.c into the > directory I am compiling from and referencing them locally (#include > “regex.h”), but the same errors happen. MinGW doesn't have regex, are you sure you're not using a third party regex? > > Is there some DLL I need to link to while I’m compiling? I am relatively > unfamiliar with the linking process, as 99% of the code I have written > in my life either doesn’t involve anything beyond #includes, or I’ve > used an IDE that does the linking for me. (For shame, I know… *sniffle*…) > Check the MinGW downloads page, there is a regex implementation for download. http://sourceforge.net/project/showfiles.php?group_id=2435 I don't know about IDEs but you should link with libregex.a or use "-lregex" if you use GCC to link. Don't forget to bundle libgnurx-0.dll if you distribute your app. > Sorry to keep posting to the list about this problematic programming > experience of mine—but at least I’m back on topic, eh? J > > Todd Boyd > > Web Programmer > > |