-
-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail to use system boost
with undefined reference
in libboost_python
#6398
Comments
you can add python library dep in boost package when boost/python is enabled. |
I tried adding the following to if package:config("python") then
package:add("deps", "python")
end However, it didn’t work. This might be because |
Can we add deps in xmake-repo/packages/b/boost/fetch.lua Lines 5 to 21 in ec1c0e0
|
no, we should use |
I thought that xrepo does not execute xmake-repo/packages/b/boost/b2/load.lua Lines 68 to 73 in 14f527a
xmake-repo/packages/b/boost/cmake/load.lua Lines 65 to 67 in bd8a6e0
[ 50%]: cache compiling.release src/main.cpp
/usr/bin/gcc -c -m64 -fPIC -isystem /usr/include/python3.10 -isystem /home/star/.xmake/packages/o/openssl/1.1.1-w/6c51ab6278e2479b883dffafac69fdaf/include -o build/.objs/hello/linux/x86_64/release/src/main.cpp.o src/main.cpp
[ 75%]: linking.release libhello.so
/usr/bin/g++ -o build/linux/x86_64/release/libhello.so build/.objs/hello/linux/x86_64/release/src/main.cpp.o -shared -m64 -fPIC -L/usr/lib/x86_64-linux-gnu -L/home/star/.xmake/packages/o/openssl/1.1.1-w/6c51ab6278e2479b883dffafac69fdaf/lib -lboost_wave -lboost_type_erasure -lboost_timer -lboost_prg_exec_monitor -lboost_unit_test_framework -lboost_test_exec_monitor -lboost_stacktrace_noop -lboost_stacktrace_backtrace -lboost_stacktrace_addr2line -lboost_stacktrace_basic -lboost_program_options -lboost_nowide -lboost_log -lboost_log_setup -lboost_locale -lboost_iostreams -lboost_graph_parallel -lboost_mpi -lboost_python310 -lboost_numpy310 -lboost_graph -lboost_wserialization -lboost_serialization -lboost_regex -lboost_random -lboost_fiber -lboost_filesystem -lboost_coroutine -lboost_thread -lboost_date_time -lboost_exception -lboost_context -lboost_container -lboost_chrono -lboost_system -lboost_atomic -lssl -lcrypto -lpthread -ldl |
Thank you for the insights! Your solution works well in regular projects. The issue arises when trying to install a package that depends on While modifying the package recipe is one workaround, I’m curious if there might be another approach to resolve this without altering the recipes. |
Require xmake to support using |
Xmake Version
xmake v2.9.8+20250204
Operating System Version and Architecture
Arch Linux
Describe Bug
When using the system-installed
boost
, which includes various modules such aslibboost_python
, attempting to linklibboost_python
without explicitly adding-lpython
results in linker errors (undefined references).Expected Behavior
If
libboost_python
is detected in the system, perhaps it could also link againstpython
to avoid the issue.Project Configuration
Additional Information and Error Logs
N/A
The text was updated successfully, but these errors were encountered: