LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   warning: libstdc++.so.5 may conflict with libstdc++.so.6 (https://www.linuxquestions.org/questions/linux-newbie-8/warning-libstdc-so-5-may-conflict-with-libstdc-so-6-a-726211/)

sbaratam 05-15-2009 08:57 AM

warning: libstdc++.so.5 may conflict with libstdc++.so.6
 
Hello All:

I am a newbie to Linux programming and need help. We build our application on gcc version 3.3.3 (SuSE Linux). I am trying to build a test application on RHAT ( gcc version 3.4.6 20060404) linking one shared object built on the SuSe machine. However, when I try to build it using g++, I get the following warning message:

/usr/bin/ld: warning: libstdc++.so.5, needed by sdk.so, may conflict with libstdc++.so.6

When I execute the test application, it core dumps. How do I fix this problem?
All help is appreciated.

Thanks
Sam

TimothyEBaldwin 05-15-2009 03:33 PM

Why are you using such an old compiler?

With the 3.x.y versions of g++ the x must be the same.

sbaratam 05-15-2009 04:03 PM

We need to support older versions of SuSe and that was the reason for the oldest compiler. Is there a way, we could force the g++ compiler to go against libstdc++.so.5 ?

Thanks
Sam

Valery Reznic 05-15-2009 11:44 PM

Quote:

Originally Posted by sbaratam (Post 3541808)
Hello All:

I am a newbie to Linux programming and need help. We build our application on gcc version 3.3.3 (SuSE Linux). I am trying to build a test application on RHAT ( gcc version 3.4.6 20060404) linking one shared object built on the SuSe machine. However, when I try to build it using g++, I get the following warning message:

/usr/bin/ld: warning: libstdc++.so.5, needed by sdk.so, may conflict with libstdc++.so.6

When I execute the test application, it core dumps. How do I fix this problem?
All help is appreciated.

Thanks
Sam

Mixing shared libraries in the way you did is a really bad idea.
If you want maximum portability than (usually) the way to build your application on the oldest distro.
But you case complicated by using libstdc++.so.5
Older distros has this library while newer - libstdc++.so.6

So if you build your application against libstdc++.so.5 then to use your application on the newer distro your customers should install compatibility package with libstdc++.so.5

Or you can use statifier (http://statifier.sf.net) or Ermine (http://magicErmine.com) to create from your application self-contained executable.
This executable has no dependencies and able to run on any Linux box with compatible arch and kernel new enough

sbaratam 05-18-2009 02:38 PM

Thanks Valery. Appareciate your help!!


All times are GMT -5. The time now is 07:31 AM.