You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ 37%]: compiling.release src/interface.cpp
/usr/bin/gcc -c -m64 -fPIC -O3 -I/home/duohappy/comSoftware/python-3.7.9-static/include/python3.7m -I/home/duohappy/comSoftware/opencv-3.4.10-static/include -I/home/duohappy/comSoftware/boost-1.7.4-static/include/boost-1_74 -o build/.objs/buildBoostPython/linux/x86_64/release/src/interface.cpp.o src/interface.cpp
[ 50%]: compiling.release src/main.cpp
/usr/bin/gcc -c -m64 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -I/home/duohappy/comSoftware/python-3.7.9-static/include/python3.7m -I/home/duohappy/comSoftware/boost-1.7.4-static/include/boost-1_74 -o build/.objs/buildBoostPython_demo/linux/x86_64/release/src/main.cpp.o src/main.cpp
In file included from /home/duohappy/comSoftware/boost-1.7.4-static/include/boost-1_74/boost/python/detail/is_xxx.hpp:8:0,
from /home/duohappy/comSoftware/boost-1.7.4-static/include/boost-1_74/boost/python/detail/is_auto_ptr.hpp:9,
from /home/duohappy/comSoftware/boost-1.7.4-static/include/boost-1_74/boost/python/detail/copy_ctor_mutates_rhs.hpp:8,
from /home/duohappy/comSoftware/boost-1.7.4-static/include/boost-1_74/boost/python/detail/value_arg.hpp:7,
from /home/duohappy/comSoftware/boost-1.7.4-static/include/boost-1_74/boost/python/object/forward.hpp:10,
from /home/duohappy/comSoftware/boost-1.7.4-static/include/boost-1_74/boost/python/object/pointer_holder.hpp:16,
from /home/duohappy/comSoftware/boost-1.7.4-static/include/boost-1_74/boost/python/to_python_indirect.hpp:10,
from /home/duohappy/comSoftware/boost-1.7.4-static/include/boost-1_74/boost/python/converter/arg_to_python.hpp:10,
In file included from /home/duohappy/comSoftware/boost-1.7.4-static/include/boost-1_74/boost/python/detail/is_xxx.hpp:8:0,
from /home/duohappy/comSoftware/boost-1.7.4-static/include/boost-1_74/boost/python/detail/is_auto_ptr.hpp:9,
from /home/duohappy/comSoftware/boost-1.7.4-static/include/boost-1_74/boost/python/detail/copy_ctor_mutates_rhs.hpp:8,
from /home/duohappy/comSoftware/boost-1.7.4-static/include/boost-1_74/boost/python/detail/value_arg.hpp:7,
from /home/duohappy/comSoftware/boost-1.7.4-static/include/boost-1_74/boost/python/object/forward.hpp:10,
from /home/duohappy/comSoftware/boost-1.7.4-static/include/boost-1_74/boost/python/object/pointer_holder.hpp:16,
from /home/duohappy/comSoftware/boost-1.7.4-static/include/boost-1_74/boost/python/to_python_indirect.hpp:10,
from /home/duohappy/comSoftware/boost-1.7.4-static/include/boost-1_74/boost/python/converter/arg_to_python.hpp:10,
[ 62%]: linking.release libbuildBoostPython.so
/usr/bin/g++ -o build/linux/x86_64/release/libbuildBoostPython.so build/.objs/buildBoostPython/linux/x86_64/release/src/interface.cpp.o -shared -fPIC -m64 -L/home/duohappy/comSoftware/python-3.7.9-static/lib -L/home/duohappy/comSoftware/opencv-3.4.10-static/lib -L/home/duohappy/comSoftware/boost-1.7.4-static/lib -s -lopencv_dnn -lopencv_highgui -lopencv_ml -lopencv_objdetect -lopencv_shape -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_calib3d -lopencv_videoio -lopencv_imgcodecs -lopencv_features2d -lopencv_video -lopencv_photo -lopencv_imgproc -lopencv_flann -lopencv_core -lboost_python37-gcc7-mt-x64-1_74 -lboost_numpy37-gcc7-mt-x64-1_74 -lz -ldl -lm -lpthread -lrt -lpython3.7m
[ 87%]: linking.release buildBoostPython_demo
/usr/bin/g++ -o build/linux/x86_64/release/buildBoostPython_demo build/.objs/buildBoostPython_demo/linux/x86_64/release/src/main.cpp.o -m64 -L/home/duohappy/comSoftware/python-3.7.9-static/lib -L/home/duohappy/comSoftware/opencv-3.4.10-static/lib -L/home/duohappy/comSoftware/boost-1.7.4-static/lib -Lbuild/linux/x86_64/release -Wl,-rpath=$ORIGIN -s -lbuildBoostPython -lopencv_dnn -lopencv_highgui -lopencv_ml -lopencv_objdetect -lopencv_shape -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_calib3d -lopencv_videoio -lopencv_imgcodecs -lopencv_features2d -lopencv_video -lopencv_photo -lopencv_imgproc -lopencv_flann -lopencv_core -lboost_python37-gcc7-mt-x64-1_74 -lboost_numpy37-gcc7-mt-x64-1_74 -lz -ldl -lm -lpthread -lrt -lpython3.7m
error: @programdir/modules/private/async/runjobs.lua:210: @programdir/actions/build/kinds/binary.lua:73: @programdir/core/sandbox/modules/os.lua:258: build/linux/x86_64/release/libbuildBoostPython.so: undefined reference to `forkpty'build/linux/x86_64/release/libbuildBoostPython.so: undefined reference to `openpty'
collect2: error: ld returned 1 exit status
stack traceback:
[C]: in function 'error'
[@programdir/core/base/os.lua:789]: in function 'raise'
[@programdir/core/sandbox/modules/os.lua:258]: in function 'runv'
[@programdir/modules/core/tools/gcc.lua:356]:
[C]: in function 'link'
[@programdir/actions/build/kinds/binary.lua:73]: in function 'callback'
[@programdir/modules/core/project/depend.lua:186]: in function 'on_changed'
[@programdir/actions/build/kinds/binary.lua:54]: in function '_do_link_target'
[@programdir/actions/build/kinds/binary.lua:94]:
[@programdir/actions/build/kinds/binary.lua:115]: in function '_link_target'
[@programdir/actions/build/kinds/binary.lua:137]: in function 'jobfunc'
[@programdir/modules/private/async/runjobs.lua:188]:
[C]: in function 'trycall'
[@programdir/core/sandbox/modules/try.lua:121]: in function 'try'
[@programdir/modules/private/async/runjobs.lua:182]: in function 'cotask'
[@programdir/core/base/scheduler.lua:317]:
stack traceback:
[C]: in function 'error'
@programdir/core/base/os.lua:789: in function 'raise'
@programdir/modules/private/async/runjobs.lua:210: in function 'catch'
@programdir/core/sandbox/modules/try.lua:127: in function 'try'
@programdir/modules/private/async/runjobs.lua:182: in function 'cotask'
@programdir/core/base/scheduler.lua:317: in function <@programdir/core/base/scheduler.lua:315>
描述问题
链接静态boost库,静态python库(安装完毕numpy库),静态opencv库,编译成一个动态库。
src
++ interface.cpp
++ main.cpp
期待的结果
达到手动编译的效果
错误信息
xmake -rvD,运行结果
相关环境
其他信息
混合链接静态库和动态库,会出现这样的问题,如果单纯全部用动态库不会出现。
-Wl,-Bstatic
会导致后面的默认全部链接静态库在手动编译时,最后需要加上
-Wl,-Bdynamic
来链接如pthread之类的库,这类的库也有静态库,但是如果全部默认采用静态库时,没有用-Wl,-Bdynamic
,会产生cannot find -lgcc_s
错误The text was updated successfully, but these errors were encountered: