Linux C ++链接器/usr/bin/ld [英] Linux C++ linker /usr/bin/ld
问题描述
我使用g ++ 4.4.6在Redhat Linux 6上编写了一个小应用程序.编译后,我收到一个错误
I wrote a small application on Redhat Linux 6 using g++ 4.4.6. After compilation, I received an error
/usr/bin/ld: cannot find -lcrypto
我搜索了加密货币库,然后在这里找到了
I did a search for the crypto library and find them here,
[root@STL-DUNKEL01 bin]# find / -name libcrypto*
/usr/lib64/libcrypto.so.0.9.8e
/usr/lib64/libcrypto.so.10
/usr/lib64/libcrypto.so.6
/usr/lib64/libcrypto.so.1.0.0
我的问题是,编译错误是否由/usr/bin/ld 引起,而不是在搜索路径中没有/usr/lib64/?如果是,该如何添加?
My question is whether the compilation error is caused by /usr/bin/ld not having /usr/lib64/ in the search path? If yes, how can I add it?
谢谢.
推荐答案
像-L<directory_to_search_in>
一样,您可以提供目录以作为gcc
的参数来搜索库.请注意,-L
可以有多个参数.另外,您是要构建32位应用程序还是构建64位应用程序?
You can provide the directories to search for the libraries in as a parameter to gcc
like so -L<directory_to_search_in>
. And note that there can be multiple parameters to -L
. Also, are you trying to build a 32-bit application or a 64-bit one?
这篇关于Linux C ++链接器/usr/bin/ld的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!