msnh2012 / Msnhnet

🔥 (yolov3 yolov4 yolov5 unet ...)A mini pytorch inference framework which inspired from darknet.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

libyaml-cpp.a symbol error while building libMsnhnet.so

hxqiu opened this issue · comments

commented

When I build Msnhnet following the steps wrote in readme, an symbol error occurred
here is the error output

[  1%] Linking CXX shared library libMsnhnet.so
/usr/bin/ld: /usr/local/lib/libyaml-cpp.a(exceptions.cpp.o): relocation R_X86_64_32 against `_ZTVN4YAML9ExceptionE' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libyaml-cpp.a: 无法添加符号: 错误的值
collect2: error: ld returned 1 exit status
CMakeFiles/Msnhnet.dir/build.make:647: recipe for target 'libMsnhnet.so' failed
make[2]: *** [libMsnhnet.so] Error 1
CMakeFiles/Makefile2:279: recipe for target 'CMakeFiles/Msnhnet.dir/all' failed
make[1]: *** [CMakeFiles/Msnhnet.dir/all] Error 2
Makefile:148: recipe for target 'all' failed
make: *** [all] Error 2
commented

follow up:
recompile yaml lib with cmake -DBUILD_SHARED_LIBS=ON .. then make , make install, problem solved