[英]CMake - target_link_libraries and a real library name
I have an example library and two symbolic links: 我有一个示例库和两个符号链接:
libname.so -> libname.so.3
libname.so.3 -> libname.so.3.0
When I use this command: 当我使用此命令时:
target_link_libraries(app /home/theuser/libs/mylib/libname.so)
program works, but when I use following command: target_link_libraries(app /home/theuser/libs/mylib/libname.so.3.0)
程序有效,但是当我使用以下命令时:
target_link_libraries(app /home/theuser/libs/mylib/libname.so.3.0)
I get an info: error while loading shared libraries: libname.so.3: cannot open shared object file: No such file or directory
during program execution (after cmake and make steps). 我收到一个信息:
error while loading shared libraries: libname.so.3: cannot open shared object file: No such file or directory
程序执行期间(在cmake和make步骤之后) error while loading shared libraries: libname.so.3: cannot open shared object file: No such file or directory
。 Why cmake can't get a lib directly (without symbolic links) ? 为什么cmake无法直接获取lib(没有符号链接)? Is it posiible ?
可行吗?
We use this syntax daily without symlinks and it definitely works. 我们每天都在不使用符号链接的情况下使用此语法,它肯定有效。 Is it possible that it needs a "normal lib-like" file name into target_link_library?
是否可能需要在target_link_library中添加“类似于lib的正常”文件名? I would try to include .so files only in my link chain to see if it works first.
我会尝试仅在我的链接链中包括.so文件,以查看它是否首先起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.