Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: rv2931 on November 17, 2008, 04:15:58 pm

Title: undefined reference to __imp__pcre_free
Post by: rv2931 on November 17, 2008, 04:15:58 pm
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
Title: Re: undefined reference to __imp__pcre_free
Post by: dje on November 17, 2008, 05:11:14 pm
Hi !

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

Dje
Title: Re: undefined reference to __imp__pcre_free
Post by: rv2931 on November 17, 2008, 05:32:56 pm
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
?.? :(

Title: Re: undefined reference to __imp__pcre_free
Post by: thomas on November 17, 2008, 08:23:50 pm
Did you read the documentation?
Quote
If 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.
Title: Re: undefined reference to __imp__pcre_free
Post by: 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
Title: Re: undefined reference to __imp__pcre_free
Post by: stahta01 on November 19, 2008, 04:20:21 pm
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