English 中文(简体)
软墙忽视图书馆
原标题:ld ignores libraries

乌班图11.10的链接员似乎忽视了我在链接线上指定的图书馆,如果这些图书馆没有包含相关应用所使用的任何标志:

Linking CXX executable ../../bin/gpu_sd_list
cd /home/eile/Software/gpu-sd/debug/apps/gpu_sd_list && /usr/bin/cmake -E cmake_link_script CMakeFiles/gpu_sd_list.dir/link.txt --verbose=1
/usr/bin/c++    -Wall -Wextra -Winvalid-pch -Wnon-virtual-dtor -Wsign-promo -Wshadow -Winit-self -Wno-unknown-pragmas -Wno-unused-parameter -Wno-write-strings -Werror -g    CMakeFiles/gpu_sd_list.dir/gpu_sd_list.cpp.o  -o ../../bin/gpu_sd_list -rdynamic ../../lib/libgpusd_remote_dns_sd.so.1.0.0 -ldns_sd ../../lib/libgpusd_remote.so.1.0.0 -Wl,-rpath,/home/eile/Software/gpu-sd/debug/lib: 

ldd ./debug/bin/gpu_sd_list
linux-vdso.so.1 =>  (0x00007fff0a5c6000)
libgpusd_remote.so.1 => /home/eile/Software/gpu-sd/debug/lib/libgpusd_remote.so.1 (0x00007ff9a21fc000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ff9a1ece000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff9a1cb7000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff9a1918000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff9a1694000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff9a2406000)

libgpusd_remote_dns_sd.so.1.0.0失踪。 这一工作在乌班图11.04进行。 图书馆设有一个静态的初创器,在高档图书馆登记一个单元。 如果在方案发射功能上没有装上,则没有装上。 全文见

最佳回答

You could do something like:

.... -Wl,-no-as-needed -lfoo -lbar -Wl,-as-needed

这将与<代码>libfoo和libbar挂钩,而不论它们是否实际需要。

as-needed is a default setting on some distributions, since it makes sense in most cases.

(我不肯定你的设计是一个好主意。)

问题回答

暂无回答




相关问题
Signed executables under Linux

For security reasons, it is desirable to check the integrity of code before execution, avoiding tampered software by an attacker. So, my question is How to sign executable code and run only trusted ...

encoding of file shell script

How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How can I use exit codes to run shell scripts sequentially?

Since cruise control is full of bugs that have wasted my entire week, I have decided the existing shell scripts I have are simpler and thus better. Here is what I have so far svn update /var/www/...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

热门标签