Hi,
I want to link my App static with libstdc++.so.5 (inkc. libgcc_s.so.1)
I usee gcc 3.2. If I use the param "-static" ld tries to link my dyn
libs static, and I don't want that.
thanks in advance
Markus
I want to link my App static with libstdc++.so.5 (inkc. libgcc_s.so.1)
I usee gcc 3.2. If I use the param "-static" ld tries to link my dyn
libs static, and I don't want that.
thanks in advance
Markus
> I want to link my App static with libstdc++.so.5 (inkc. libgcc_s.so.1)
> I usee gcc 3.2. If I use the param "-static" ld tries to link my dyn
> libs static, and I don't want that.
Anyway, the -static parameter must come after your dynamic libraries
that you specify.
ie:
gcc -o myprog myproc.c -lmydym1 -lmydym2 -static
-- Steve
>> Hi,
>> I want to link my App static with libstdc++.so.5 (inkc. libgcc_s.so.1)
>> I usee gcc 3.2. If I use the param "-static" ld tries to link my dyn
>> libs static, and I don't want that.
> First, libstdc++.so.5 will not be linked static. You need libstdc++.a.
> Anyway, the -static parameter must come after your dynamic libraries
> that you specify.
> ie:
> gcc -o myprog myproc.c -lmydym1 -lmydym2 -static
>> ie:
>> gcc -o myprog myproc.c -lmydym1 -lmydym2 -static
> It doesn't work, ld says "cannot find -lmydym1"
So if you have libmydym.so in your current directory, you should
do the following:
g++ -o myprog myproc.cc -L. -lmydym -static
The -L. tells the linker to look into your current (".")
directory, you could also specify a path like -L/my/dynamic/dir/path
Note that to run this program, you either need to place your dynamic
library into one of the directories in /etc/ld.so.conf, add a directory
to /etc/ld.so.conf or update your LD_LIBRARY_PATH environment variable
to include the path your dynamic library is placed. The first two
require root priviledges and to run ldconfig, whereas the environment
variable change can be done by anyone.
If you do the environment var change, then you need to make sure it is
exported and the format is just like the PATH variable.
-- Steve
Hi,
I want to link my App static with libstdc++.so.5 (inkc. libgcc_s.so.1)
I usee gcc 3.2. If I use the param "-static" ld tries to link my dyn
libs static, and I don't want that.
thanks in advance
Markus
2. dos formatted iomega disks under solaris ?
3. Static link libstdc++.so on Solaris
4. cp -pr hangs
5. building libstdc++ as a static library
6. RedHat5.1 Install : partition not displayed
7. can't load library --> libstdc++.so.2.9 (HELP!)
8. SVGA mode for ATI Mach64 "CT"?
9. Where can I get libstdc++.so.2.8.1.1 for Solaris 2.6??
10. fatal: libstdc++.so.2.10.0 error ?
11. gcc 2.95.2 Prebuilt with shared libstdc++.so?
12. Help...missing something from libstdc++.so.2.9
13. can't find libstdc++.so.2.9