xmake中如何添加配置g++ -Wl,-rpath=. #4840
Unanswered
jiagushuai
asked this question in
Q&A
Replies: 2 comments
-
Title: How to add configuration g++ -Wl,-rpath= in xmake. |
Beta Was this translation helpful? Give feedback.
0 replies
-
https://xmake.io/#/manual/project_target?id=targetadd_rpathdirs |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Xmake 版本
v2.8.8+20240314
操作系统版本和架构
x86_64 GNU/Linux
描述问题
1.创建控制台工程编译生成foo链接库,然后修改xmake.lua文件修改为引用,编译成功运行报错
xmake create -l c++ -t shared
期待的结果
1.添加配置使链接库被调用运行
2.相关编译可以转为makefile文件吗
工程配置
add_rules("mode.debug", "mode.release")
--target("foo")
-- set_kind("shared")
-- add_files("src/foo.cpp")
add_links("foo")
add_linkdirs("lib/")
target("test")
set_kind("binary")
--add_deps("foo")
add_files("src/main.cpp")
附加信息和错误日志
xmake -r
[ 25%]: cache compiling.release src/main.cpp
[ 50%]: linking.release test
[100%]: build ok, spent 0.349s
jialing@jialing-VirtualBox:~/Desktop/test$ xmake run
/home/jialing/Desktop/test/build/linux/x86_64/release/test: error while loading shared libraries: libfoo.so: cannot open shared object file: No such file or directory
error: execv(/home/jialing/Desktop/test/build/linux/x86_64/release/test ) failed(127)
Beta Was this translation helpful? Give feedback.
All reactions