Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » pregexp isn't compiling complaining about undefined symbols
pregexp isn't compiling complaining about undefined symbols [message #21071] Fri, 01 May 2009 01:25 Go to next message
mingodad is currently offline  mingodad
Messages: 53
Registered: February 2008
Location: Spain
Member
I've got the latest ultimate++ and tried to use the plugin/pcre but it doesn't work it compiles but when linking complain about undefined _imp_pcre_free, _imp_pcre_exec, ...

I managed to get it working although in a not usual way.

#ifndef _plugin_pcre_pcre_h_
#define _plugin_pcre_pcre_h_

#include <Core/Core.h>

#define PCRE_EXP_DECL extern <======== adding this line
//before include pcre headers
#include "lib/pcre.h"

NAMESPACE_UPP

#include "RegExp.h"

END_UPP_NAMESPACE

#endif

Also added one more function to it:

void RegExp::GetMatchPos(int i, int& iPosStart, int& iPosAfterEnd)
{
i = 2 * (i + 1);
iPosStart = pos[i];
iPosAfterEnd = pos[i + 1];
}


Re: pregexp isn't compiling complaining about undefined symbols [message #21230 is a reply to message #21071] Sun, 10 May 2009 13:03 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I believe the problem is in including

#include "lib/pcre.h"

(Of course, as long as you did not add that to make it work...).

In any case, I have just checked reference example:

http://www.ultimatepp.org/reference$RegExp.html

and it compiles and works just OK.

Mirek

Re: pregexp isn't compiling complaining about undefined symbols [message #22733 is a reply to message #21230] Mon, 10 August 2009 07:39 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

Thanks to domingoad!

Adding the line
#define PCRE_EXP_DECL extern 

helped me too when I tried to compile http://www.ultimatepp.org/reference$RegExp.html example under mingw+wine.

Please apply this correction.


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: pregexp isn't compiling complaining about undefined symbols [message #22735 is a reply to message #22733] Mon, 10 August 2009 08:57 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Applied.

I guess it needs checking in linux too...

Mirek
Re: pregexp isn't compiling complaining about undefined symbols [message #22754 is a reply to message #22735] Tue, 11 August 2009 14:08 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

Thanks.

BTW, in Linux everything is so well compiled. I do not know why this might be related.

I discovered this only after compiling under Windows.


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: pregexp isn't compiling complaining about undefined symbols [message #30483 is a reply to message #21071] Tue, 04 January 2011 15:03 Go to previous message
linuxeasy is currently offline  linuxeasy
Messages: 1
Registered: January 2011
Location: Mumbai, India
Junior Member
Thanks for the info domingoad,

Actually i came across this thread while searching for the solution of the same _imp_pcre_free, _imp_pcre_malloc kind errors, and your solution worked for me.

Though my work wasn't related to ultimate++ but i was trying to compile a cppcms and was getting stuck at this error.

just for anyone who reaches here for the same error, the changes to be made in the file of cppcms is here:

cppcms-0.99.5\booster\lib\regex\src\pcre_regex.cpp

#define BOOSTER_SOURCE
#include <booster/regex.h>
#include <string.h>
#define PCRE_EXP_DECL extern // <--- this is the addition.
#include <pcre.h>

This is probably a general error that can be encountered while compiling anything that requires pcre library on windows.
once again thanks a lot for your help.
Previous Topic: CtrlCore.h const correctnes fixes
Next Topic: GCC warnings patch - mega mix 3 - signed/unsigned compares and stuff (SVN r2960)
Goto Forum:
  


Current Time: Thu Mar 28 13:17:33 CET 2024

Total time taken to generate the page: 0.01851 seconds