LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-28-2011, 04:56 AM   #1
iteam
LQ Newbie
 
Registered: Jun 2011
Posts: 8

Rep: Reputation: Disabled
Error compiling a program with boost libraries -> strerror_r


Hi all,

I'm compiling a project that uses boost libraries (1.45.0) for a MIPS target, and when trying to compile with bjam I get the following error:

Code:
libboost_system-mt.a(error_code.o): In function `(anonymous namespace)::generic_error_category::message(int) const':
error_code.cpp:(.text+0x55c): undefined reference to `__glibc_strerror_r'
collect2: ld returned 1 exit status
Does it mean that the compiler doesn't find the library? Or what does it mean? I'm trying to solve the problem but actually I don't know what is the problem.

Please, could someone help me?
 
Old 06-28-2011, 05:10 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
"undefined reference" usually means you are missing a library, yep.
afaik: __glibc_strerror_r is in uClibc ... make sure you have it and that it is in your path.

found:
http://www.koders.com/c/fid92DCB10AA...px?s=strtok_r+
 
Old 06-28-2011, 05:39 AM   #3
iteam
LQ Newbie
 
Registered: Jun 2011
Posts: 8

Original Poster
Rep: Reputation: Disabled
I need to compile my program using glibc because it needs one feature that it is not available on uClibc. Can I compile with the two libraries?

I found this in a forum, it seems that my glibc (2.6.1) do have strerror_r:
checking if strerror_r is on glibc version >= 2.0... yes
and I think that the library is present because before the error many objects compile correctly.
 
Old 06-29-2011, 07:20 AM   #4
iteam
LQ Newbie
 
Registered: Jun 2011
Posts: 8

Original Poster
Rep: Reputation: Disabled
I finally solve the problem adding an option that recompiles all the sources, but now I can't run the program compiled with glibc in my OpenWRT firmware, I suppose because it uses uClibc.

I run the file command for my program and the result is:

Code:
ELF 32-bit MSB executable, MIPS, MIPS32 rel 2 version 1, dynamically linked (uses shared libs), for GNU/Linux 2.4.0, with unknown capability 0x41000000=0xf676e75, not stripped
Some questions:
Why it is compiled for GNU/Linux 2.4.0, this is not my version, where I choose that parameter?
I read it is possible to run a program compiled with glibc in OpenWrt with uClibc if you compile statically, adding --static to CFLAGS, why doesn't work that?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Eclipse Helios, C++. How to include boost libraries? Felipe Programming 3 04-06-2011 04:03 PM
[SOLVED] Problem linking with Boost libraries jdwilder Programming 6 04-06-2011 08:04 AM
LXer: Clang Gets Boosted By The Boost Libraries LXer Syndicated Linux News 0 05-23-2010 02:10 PM
Compilation errors with compiling a program with boost libraries 1.39 Metal_Koola Programming 5 12-04-2009 07:13 PM
Boost 1.39 Libraries on RHEL 5 gilly1409 Linux - Newbie 4 07-28-2009 12:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration