News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

undefined reference to __imp__pcre_free

Started by rv2931, November 17, 2008, 04:15:58 PM

Previous topic - Next topic

rv2931

Hello

I work on windows plateforme  and mingw, I linked the pcre.lib library V7.0 and durint compilation, I have this message :
"undefined reference to __imp__pcre_free"

I don't manage to solve the problem, has anybody an idea ?

thx

RV

dje

Hi !

This forum is English only.
You probably need to add the library implementing __imp__pcre_free to the linker project settings.

Dje

rv2931

#2
oups sorry,

Yes but I thought that the definition of pcre_free is in pcre.lib cause it is declared in pcre.h.
I linked it but it doesn't work, only for this function, the other function pcre_xxx don't seem to pose problems
?.? :(


thomas

Did you read the documentation?
QuoteIf you want to statically link against the .a file, you must define PCRE_STATIC before including pcre.h, otherwise the pcre_malloc and pcre_free exported functions will be declared __declspec(dllimport), with hilarious results.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

rv2931

ho, so, I'll do it
I didn't read the documentation, pcre is wellknown library, it is amazing that we have to do some stuff like that...

anyway

great thanks, I'll try that

stahta01

Quote from: rv2931 on November 18, 2008, 09:40:41 AM
ho, so, I'll do it
I didn't read the documentation, pcre is wellknown library, it is amazing that we have to do some stuff like that...

anyway

great thanks, I'll try that


If you wish to become a real Windows programmer, you will find out that reading the documentation is needed to use any slightly complex Windows Library shipped as an DLL because of import/export issues.

Tim S
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]