Build of VisionWorks samples failed because of undefined references to nvxio

Hi,

I just installed JetPack 2.3 on Ubuntu 16.04.
I just didn’t install OpenCV4Tegra as it isn’t available for 16.04 as now.

When trying to build the VisionWorks example, the build fails saying some nvxio and nvxcuio references are not defined.

make[1]: Entering directory '/home/fnlocal/VisionWorks-1.5-Samples/demos/feature_tracker'
make[1]: Entering directory '/home/fnlocal/VisionWorks-1.5-Samples/demos/stereo_matching'
make[1]: Entering directory '/home/fnlocal/VisionWorks-1.5-Samples/demos/feature_tracker_nvxcu'
make[1]: Entering directory '/home/fnlocal/VisionWorks-1.5-Samples/demos/hough_transform'
make[1]: Entering directory '/home/fnlocal/VisionWorks-1.5-Samples/demos/motion_estimation'
make[1]: Entering directory '/home/fnlocal/VisionWorks-1.5-Samples/demos/video_stabilizer'
make[1]: Entering directory '/home/fnlocal/VisionWorks-1.5-Samples/samples/object_tracker_nvxcu'
make[1]: Entering directory '/home/fnlocal/VisionWorks-1.5-Samples/samples/opencv_npp_interop'
g++ -Wl,--allow-shlib-undefined -pthread -Wl,-rpath=/usr/local/cuda-8.0/lib64 -o ../../bin/x86_64/linux/release/nvx_demo_motion_estimation obj/release/main_motion_estimation.o obj/release/iterative_motion_estimator.o -L"/usr/lib"  -lvisionworks -lnvxio 
g++ -Wl,--allow-shlib-undefined -pthread -Wl,-rpath=/usr/local/cuda-8.0/lib64 -o ../../bin/x86_64/linux/release/nvx_demo_feature_tracker obj/release/main_feature_tracker.o obj/release/feature_tracker.o -L"/usr/lib"  -lvisionworks -lnvxio 
g++ -Wl,--allow-shlib-undefined -pthread -Wl,-rpath=/usr/local/cuda-8.0/lib64 -o ../../bin/x86_64/linux/release/nvx_demo_hough_transform obj/release/main_hough_transform.o -L"/usr/lib"  -lvisionworks -lnvxio 
g++ -Wl,--allow-shlib-undefined -pthread -Wl,-rpath=/usr/local/cuda-8.0/lib64 -o ../../bin/x86_64/linux/release/nvx_demo_video_stabilizer obj/release/main_video_stabilizer.o obj/release/smoother_node.o obj/release/stabilizer.o obj/release/homography_filter_node.o obj/release/truncate_transform_node.o -L"/usr/lib"   -lvisionworks -lnvxio 
g++ -Wl,--allow-shlib-undefined -pthread -Wl,-rpath=/usr/local/cuda-8.0/lib64 -o ../../bin/x86_64/linux/release/nvx_demo_stereo_matching obj/release/color_disparity_graph.o obj/release/stereo_matching.o obj/release/main_stereo_matching.o -L"/usr/lib"  -lvisionworks -lnvxio 
g++ -Wl,--allow-shlib-undefined -pthread -Wl,-rpath=/usr/local/cuda-8.0/lib64 -o ../../bin/x86_64/linux/release/nvx_sample_object_tracker_nvxcu obj/release/object_tracker_with_features_info_nvxcu.o obj/release/object_tracker_nvxcu.o obj/release/runtime_performance_logger.o obj/release/main_object_tracker_nvxcu.o obj/release/object_tracker_keypoint_nvxcu.o -L"/usr/lib"  -L/usr/local/cuda-8.0/lib64 -lcudart -lvisionworks -lnvxio 
g++ -Wl,--allow-shlib-undefined -pthread -Wl,-rpath=/usr/local/cuda-8.0/lib64 -o ../../bin/x86_64/linux/release/nvx_demo_feature_tracker_nvxcu obj/release/main_feature_tracker_nvxcu.o obj/release/feature_tracker_nvxcu.o -L"/usr/lib"  -L/usr/local/cuda-8.0/lib64 -lcudart -lvisionworks -lnvxio 
g++ -Wl,--allow-shlib-undefined -pthread -Wl,-rpath=/usr/local/cuda-8.0/lib64 -o ../../bin/x86_64/linux/release/nvx_sample_opencv_npp_interop obj/release/main_opencv_npp_interop.o obj/release/alpha_comp_node.o -L"/usr/lib"  -L/usr/local/cuda-8.0/lib64 -lcudart -L/usr/local/cuda-8.0/lib64 -lnppi -lnppc /usr/lib/x86_64-linux-gnu/libopencv_calib3d.so -lopencv_calib3d /usr/lib/x86_64-linux-gnu/libopencv_contrib.so -lopencv_contrib /usr/lib/x86_64-linux-gnu/libopencv_core.so -lopencv_core /usr/lib/x86_64-linux-gnu/libopencv_features2d.so -lopencv_features2d /usr/lib/x86_64-linux-gnu/libopencv_flann.so -lopencv_flann /usr/lib/x86_64-linux-gnu/libopencv_gpu.so -lopencv_gpu /usr/lib/x86_64-linux-gnu/libopencv_highgui.so -lopencv_highgui /usr/lib/x86_64-linux-gnu/libopencv_imgproc.so -lopencv_imgproc /usr/lib/x86_64-linux-gnu/libopencv_legacy.so -lopencv_legacy /usr/lib/x86_64-linux-gnu/libopencv_ml.so -lopencv_ml /usr/lib/x86_64-linux-gnu/libopencv_objdetect.so -lopencv_objdetect /usr/lib/x86_64-linux-gnu/libopencv_ocl.so -lopencv_ocl /usr/lib/x86_64-linux-gnu/libopencv_photo.so -lopencv_photo /usr/lib/x86_64-linux-gnu/libopencv_stitching.so -lopencv_stitching /usr/lib/x86_64-linux-gnu/libopencv_superres.so -lopencv_superres /usr/lib/x86_64-linux-gnu/libopencv_ts.so -lopencv_ts /usr/lib/x86_64-linux-gnu/libopencv_video.so -lopencv_video /usr/lib/x86_64-linux-gnu/libopencv_videostab.so -lopencv_videostab -lvisionworks -lnvxio 
obj/release/main_hough_transform.o: In function `main':
main_hough_transform.cpp:(.text.startup+0x1af): undefined reference to `nvxio::OptionHandler::string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
main_hough_transform.cpp:(.text.startup+0x25c): undefined reference to `nvxio::OptionHandler::string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
main_hough_transform.cpp:(.text.startup+0xf2b): undefined reference to `nvxio::createDefaultFrameSource(_vx_context*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
main_hough_transform.cpp:(.text.startup+0x1184): undefined reference to `nvxio::createDefaultRender(_vx_context*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int, unsigned int, bool, bool)'
collect2: error: ld returned 1 exit status
Makefile:133: recipe for target '../../bin/x86_64/linux/release/nvx_demo_hough_transform' failed
make[1]: *** [../../bin/x86_64/linux/release/nvx_demo_hough_transform] Error 1
make[1]: Leaving directory '/home/fnlocal/VisionWorks-1.5-Samples/demos/hough_transform'
Makefile:31: recipe for target 'demos/hough_transform/Makefile.pr_build' failed
make: *** [demos/hough_transform/Makefile.pr_build] Error 2
make: *** Waiting for unfinished jobs....
obj/release/main_stereo_matching.o: In function `main':
main_stereo_matching.cpp:(.text.startup+0x13d): undefined reference to `nvxio::OptionHandler::string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
main_stereo_matching.cpp:(.text.startup+0x1e6): undefined reference to `nvxio::OptionHandler::string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
main_stereo_matching.cpp:(.text.startup+0xcf9): undefined reference to `nvxio::createDefaultFrameSource(_vx_context*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
main_stereo_matching.cpp:(.text.startup+0xdf8): undefined reference to `nvxio::createDefaultRender(_vx_context*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int, unsigned int, bool, bool)'
collect2: error: ld returned 1 exit status
Makefile:133: recipe for target '../../bin/x86_64/linux/release/nvx_demo_stereo_matching' failed
make[1]: *** [../../bin/x86_64/linux/release/nvx_demo_stereo_matching] Error 1
make[1]: Leaving directory '/home/fnlocal/VisionWorks-1.5-Samples/demos/stereo_matching'
obj/release/main_feature_tracker.o: In function `main':
main_feature_tracker.cpp:(.text.startup+0x11b): undefined reference to `nvxio::OptionHandler::string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
main_feature_tracker.cpp:(.text.startup+0x1c1): undefined reference to `nvxio::OptionHandler::string(std::__cxx11::basic_string<char, stdMakefile:31: recipe for target 'demos/stereo_matching/Makefile.pr_build' failed
::make: *** [demos/stereo_matching/Makefile.pr_build] Error 2
char_traits<char>, std::allocator<char> >*)'
main_feature_tracker.cpp:(.text.startup+0x28b): undefined reference to `nvxio::OptionHandler::string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
main_feature_tracker.cpp:(.text.startup+0xb96): undefined reference to `nvxio::createDefaultFrameSource(_vx_context*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
main_feature_tracker.cpp:(.text.startup+0xc2d): undefined reference to `nvxio::createDefaultRender(_vx_context*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int, unsigned int, bool, bool)'
main_feature_tracker.cpp:(.text.startup+0xf33): undefined reference to `nvxio::loadImageFromFile(_vx_context*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int)'
collect2: error: ld returned 1 exit status
Makefile:133: recipe for target '../../bin/x86_64/linux/release/nvx_demo_feature_tracker' failed
make[1]: *** [../../bin/x86_64/linux/release/nvx_demo_feature_tracker] Error 1
make[1]: Leaving directory '/home/fnlocal/VisionWorks-1.5-Samples/demos/feature_tracker'
Makefile:31: recipe for target 'demos/feature_tracker/Makefile.pr_build' failed
make: *** [demos/feature_tracker/Makefile.pr_build] Error 2
obj/release/main_video_stabilizer.o: In function `main':
main_video_stabilizer.cpp:(.text.startup+0xe7): undefined reference to `nvxio::OptionHandler::string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
main_video_stabilizer.cpp:(.text.startup+0x373): undefined reference to `nvxio::createDefaultFrameSource(_vx_context*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
main_video_stabilizer.cpp:(.text.startup+0x415): undefined reference to `nvxio::createDefaultRender(_vx_context*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int, unsigned int, bool, bool)'
collect2: error: ld returned 1 exit status
Makefile:135: recipe for target '../../bin/x86_64/linux/release/nvx_demo_video_stabilizer' failed
make[1]: *** [../../bin/x86_64/linux/release/nvx_demo_video_stabilizer] Error 1
make[1]: Leaving directory '/home/fnlocal/VisionWorks-1.5-Samples/demos/video_stabilizer'
Makefile:31: recipe for target 'demos/video_stabilizer/Makefile.pr_build' failed
make: *** [demos/video_stabilizer/Makefile.pr_build] Error 2
obj/release/main_motion_estimation.o: In function `main':
main_motion_estimation.cpp:(.text.startup+0x11b): undefined reference to `nvxio::OptionHandler::string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
main_motion_estimation.cpp:(.text.startup+0x1c1): undefined reference to `nvxio::OptionHandler::string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
main_motion_estimation.cpp:(.text.startup+0x5e3): undefined reference to `nvxio::createDefaultFrameSource(_vx_context*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
main_motion_estimation.cpp:(.text.startup+0x67e): undefined reference to `nvxio::createDefaultRender(_vx_context*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int, unsigned int, bool, bool)'
collect2: error: ld returned 1 exit status
Makefile:133: recipe for target '../../bin/x86_64/linux/release/nvx_demo_motion_estimation' failed
make[1]: *** [../../bin/x86_64/linux/release/nvx_demo_motion_estimation] Error 1
make[1]: Leaving directory '/home/fnlocal/VisionWorks-1.5-Samples/demos/motion_estimation'
Makefile:31: recipe for target 'demos/motion_estimation/Makefile.pr_build' failed
make: *** [demos/motion_estimation/Makefile.pr_build] Error 2
obj/release/main_feature_tracker_nvxcu.o: In function `main':
main_feature_tracker_nvxcu.cpp:(.text.startup+0x11b): undefined reference to `nvxio::OptionHandler::string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
main_feature_tracker_nvxcu.cpp:(.text.startup+0x1c1): undefined reference to `nvxio::OptionHandler::string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
main_feature_tracker_nvxcu.cpp:(.text.startup+0x28b): undefined reference to `nvxio::OptionHandler::string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
main_feature_tracker_nvxcu.cpp:(.text.startup+0xb63): undefined reference to `nvxcuio::createDefaultFrameSource(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
main_feature_tracker_nvxcu.cpp:(.text.startup+0xbfc): undefined reference to `nvxcuio::createDefaultRender(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int, _nvxcu_df_image_e, bool, bool)'
main_feature_tracker_nvxcu.cpp:(.text.startup+0x1628): undefined reference to `nvxcuio::loadImageFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, _nvxcu_df_image_e)'
collect2: error: ld returned 1 exit status
Makefile:135: recipe for target '../../bin/x86_64/linux/release/nvx_demo_feature_tracker_nvxcu' failed
make[1]: *** [../../bin/x86_64/linux/release/nvx_demo_feature_tracker_nvxcu] Error 1
make[1]: Leaving directory '/home/fnlocal/VisionWorks-1.5-Samples/demos/feature_tracker_nvxcu'
Makefile:31: recipe for target 'demos/feature_tracker_nvxcu/Makefile.pr_build' failed
make: *** [demos/feature_tracker_nvxcu/Makefile.pr_build] Error 2
obj/release/main_object_tracker_nvxcu.o: In function `main':
main_object_tracker_nvxcu.cpp:(.text.startup+0x1ad): undefined reference to `nvxio::OptionHandler::string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
main_object_tracker_nvxcu.cpp:(.text.startup+0x408): undefined reference to `nvxcuio::createDefaultFrameSource(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
main_object_tracker_nvxcu.cpp:(.text.startup+0x4da): undefined reference to `nvxcuio::createDefaultRender(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int, _nvxcu_df_image_e, bool, bool)'
collect2: error: ld returned 1 exit status
Makefile:135: recipe for target '../../bin/x86_64/linux/release/nvx_sample_object_tracker_nvxcu' failed
make[1]: *** [../../bin/x86_64/linux/release/nvx_sample_object_tracker_nvxcu] Error 1
make[1]: Leaving directory '/home/fnlocal/VisionWorks-1.5-Samples/samples/object_tracker_nvxcu'
Makefile:31: recipe for target 'samples/object_tracker_nvxcu/Makefile.pr_build' failed
make: *** [samples/object_tracker_nvxcu/Makefile.pr_build] Error 2
obj/release/main_opencv_npp_interop.o: In function `main':
main_opencv_npp_interop.cpp:(.text.startup+0x11b): undefined reference to `nvxio::OptionHandler::string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
main_opencv_npp_interop.cpp:(.text.startup+0x1be): undefined reference to `nvxio::OptionHandler::string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
main_opencv_npp_interop.cpp:(.text.startup+0x891): undefined reference to `nvxio::createDefaultRender(_vx_context*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int, unsigned int, bool, bool)'
collect2: error: ld returned 1 exit status
Makefile:145: recipe for target '../../bin/x86_64/linux/release/nvx_sample_opencv_npp_interop' failed
make[1]: *** [../../bin/x86_64/linux/release/nvx_sample_opencv_npp_interop] Error 1
make[1]: Leaving directory '/home/fnlocal/VisionWorks-1.5-Samples/samples/opencv_npp_interop'
Makefile:31: recipe for target 'samples/opencv_npp_interop/Makefile.pr_build' failed
make: *** [samples/opencv_npp_interop/Makefile.pr_build] Error 2

What should I do?

Thanks for your help

Looks like a JetPack bug, see this thread.

I have this problem too. on my ubuntu x86 16.04 only. my TX1 works well. on my ubuntu PC I could find libnvxio.so at /usr/lib. can someone help?

I guess there are some differences between the definitions of std::string in libnvxio.so and sample *.o files generated by current g++ (ubuntu 16.04 g++5.4). can someone give some suggestions?

I fixed this.

Remove nvxio lib
$ sudo apt-get remove --purge libvisionworks-nvxio libvisionworks-nvxio-dev

After installing VisionWorks
Install build dependencies:
$ sudo apt-get build-dep libvisionworks-nvxio libvisionworks-nvxio-dev

Download the source archive:
$ apt-get source libvisionworks-nvxio

Repackage nvxio
$ cd libvisionworks-nvxio_<visworks_ver>/

replace “CXXFLAGS += -std=c++0x” with “CXXFLAGS += -std=c++11” in nvxio/Makefile

$ dpkg-buildpackage -j4 -b

Install newly built packages:
$ sudo dpkg -i …/libvisionworks-nvxio_<visworks_ver>.deb
…/libvisionworks-nvxio-dev
<visworks_ver>_all.deb

Well done changqian9!

Apart from the slightly misleading:

gpg: skipped “cudatools cudatools@nvidia.com”: No secret key
gpg: dpkg-sign.WDb9PwGA/libvisionworks-nvxio_1.5.3.55n_amd64.changes: clearsign failed: No secret key

at the end of the build the fix produced the require executables.

Thanks for your work.

Martin