Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 07-20-2004, 06:24 AM   #1
LQ Newbie
Registered: Jul 2004
Posts: 3

Rep: Reputation: 0
g++ statically link stdc++ problem

I've got the application written on C++, which uses my propriatry .so.
I'd like to link the stdc++ statically and all other libs dynamically.

I'm using g++ (GCC) 3.3.3 20040412 (Red Hat Linux 3.3.3-7) .
I've tried couple of compilations:

g++ c_plus_test.cpp -I/usr/share/tools/boost -I/home/berty/Software/CommonSources/C++/MapedXml/Src/ -Wl,-Bdynamic,-lmapedXml,-Bstatic

The output is:
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status

2. g++ c_plus_test.cpp -I/usr/share/tools/boost/ -I/home/berty/Software/CommonSources/C++/MapedXml/Src -static -lstdc++ -shared -lmapedXml -o c_plus_test1

The output is: compilation/linking succeded. But ldd c_plus_test1 shows me dependency of => (0xffffe000) => /usr/lib/ (0x40014000) => /usr/lib/ (0x400cf000) => /lib/tls/ (0x400e1000) => /lib/tls/ (0x40104000) => /lib/ (0x4021f000) => /lib/ (0x40227000) => /lib/tls/ (0x4022c000)
/lib/ => /lib/ (0x80000000)

So, if anyone have any idea how to compile stdc++ statically and all other things dynamically, I'll glad to know it...
Thanks a lot.

Old 05-16-2005, 06:00 PM   #2
LQ Newbie
Registered: May 2005
Posts: 4

Rep: Reputation: 0
Try the -static-libgcc option for the linker.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
problems with opening stdc++ files linuxmandrake Debian 6 10-06-2005 02:15 PM
statically link a network card driver into kernel stonux Linux - Hardware 0 04-07-2005 02:57 PM
stdc++- failed dependencies. tekmorph Linux - Software 1 08-29-2004 05:21 PM
g++ library problem stdc++ kvtournh Mandriva 0 04-28-2004 10:36 AM
What is a statically compiled binary? james_cwy Linux - Newbie 4 11-09-2003 10:51 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:05 AM.

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