Author Topic: undefined reference to __imp__pcre_free  (Read 9461 times)

Offline rv2931

  • Multiple posting newcomer
  • *
  • Posts: 13
undefined reference to __imp__pcre_free
« 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
« Last Edit: November 17, 2008, 05:35:34 pm by rv2931 »

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: undefined reference to __imp__pcre_free
« Reply #1 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

Offline rv2931

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: undefined reference to __imp__pcre_free
« Reply #2 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
?.? :(

« Last Edit: November 17, 2008, 05:36:25 pm by rv2931 »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: undefined reference to __imp__pcre_free
« Reply #3 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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline rv2931

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: undefined reference to __imp__pcre_free
« Reply #4 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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: undefined reference to __imp__pcre_free
« Reply #5 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
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org