LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 07-20-2004, 06:24 AM   #1
berty
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:

1.
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 libstdc++.so
linux-gate.so.1 => (0xffffe000)
libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x40014000)
libmapedXml.so.0 => /usr/lib/libmapedXml.so.0 (0x400cf000)
libm.so.6 => /lib/tls/libm.so.6 (0x400e1000)
libc.so.6 => /lib/tls/libc.so.6 (0x40104000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x4021f000)
libdl.so.2 => /lib/libdl.so.2 (0x40227000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0x4022c000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (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.

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

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


Reply


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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

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