undefined reference to `libintl_sprintf'

CodeLite installation/troubleshooting forum
jiapei100
CodeLite Expert
Posts: 115
Joined: Wed Dec 30, 2009 8:29 am
Genuine User: Yes
IDE Question: C++
Location: Surrey, BC, Canada
Contact:

undefined reference to `libintl_sprintf'

Post by jiapei100 »

Hi, Eran:


I always met the following error message when building codes under CodeLite.
undefined reference to `libintl_sprintf'
BTW, this never happens when using Visual Studio.
Any suggestions?


Pei
Welcome to Vision Open
http://www.visionopen.com
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: undefined reference to `libintl_sprintf'

Post by eranif »

In the compiler that comes with codelite (GCC TDM 4.6.1) libintl is missing from the lib directory.

Luckily, MinGW is willing to link against DLL as if it were library

To fix this:

Code: Select all

copy /path/to/MinGW/bin/libintl-8.dll to/path/to/MinGW/lib/libintl.dll
In codelite make sure you are linking against:

Code: Select all

intl
Eran
Make sure you have read the HOW TO POST thread
jiapei100
CodeLite Expert
Posts: 115
Joined: Wed Dec 30, 2009 8:29 am
Genuine User: Yes
IDE Question: C++
Location: Surrey, BC, Canada
Contact:

Re: undefined reference to `libintl_sprintf'

Post by jiapei100 »

I'm using Ubuntu... ^_^
eranif wrote:In the compiler that comes with codelite (GCC TDM 4.6.1) libintl is missing from the lib directory.

Luckily, MinGW is willing to link against DLL as if it were library

To fix this:

Code: Select all

copy /path/to/MinGW/bin/libintl-8.dll to/path/to/MinGW/lib/libintl.dll
In codelite make sure you are linking against:

Code: Select all

intl
Eran
Welcome to Vision Open
http://www.visionopen.com
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: undefined reference to `libintl_sprintf'

Post by eranif »

jiapei100 wrote:I'm using Ubuntu... ^_^
Remember to mention it next time...

However, the solution is still the same, you need link with libintl

Eran
Make sure you have read the HOW TO POST thread
jiapei100
CodeLite Expert
Posts: 115
Joined: Wed Dec 30, 2009 8:29 am
Genuine User: Yes
IDE Question: C++
Location: Surrey, BC, Canada
Contact:

Re: undefined reference to `libintl_sprintf'

Post by jiapei100 »

However, the strange thing is:
In exactly the same workspace, to build other projects also with "printf", I'd never specify libintl, but they work fine !!

Only for this specific project, it fails....


Pei
Welcome to Vision Open
http://www.visionopen.com
Post Reply