Ubuntu 16.04 Error Building VisionWorks-1.6 sample

I am getting the following error when building the VisionWorks-1.6-Samples/samples/opencv_npp_interop sample (all othe samples and code build without errors):

make
g++ -I/usr/local/cuda-8.0/include -I/usr/local/cuda-8.0/include -DUSE_NPP=1 -I/usr/local/include/opencv -I/usr/local/include -DUSE_OPENCV=1 -I/usr/local/cuda-8.0/include -I…/…/nvxio/include -I…/…/nvxio/src/ -I…/…/nvxio/src/NVX/ -I…/…/3rdparty/opengl -I…/…/3rdparty/glfw3/include -I/usr/include/freetype2 -I…/…/3rdparty/eigen -O3 -DNDEBUG -std=c++0x -DCUDA_API_PER_THREAD_DEFAULT_STREAM -DUSE_GUI=1 -DUSE_GLFW=1 -DUSE_GSTREAMER=1 -o obj/release/main_opencv_npp_interop.o -c main_opencv_npp_interop.cpp
g++ -I/usr/local/cuda-8.0/include -I/usr/local/cuda-8.0/include -DUSE_NPP=1 -I/usr/local/include/opencv -I/usr/local/include -DUSE_OPENCV=1 -I/usr/local/cuda-8.0/include -I…/…/nvxio/include -I…/…/nvxio/src/ -I…/…/nvxio/src/NVX/ -I…/…/3rdparty/opengl -I…/…/3rdparty/glfw3/include -I/usr/include/freetype2 -I…/…/3rdparty/eigen -O3 -DNDEBUG -std=c++0x -DCUDA_API_PER_THREAD_DEFAULT_STREAM -DUSE_GUI=1 -DUSE_GLFW=1 -DUSE_GSTREAMER=1 -o obj/release/alpha_comp_node.o -c alpha_comp_node.cpp
g++ -Wl,–allow-shlib-undefined -pthread -Wl,-rpath=/usr/local/cuda-8.0/lib64 -O3 -DNDEBUG -std=c++0x -DCUDA_API_PER_THREAD_DEFAULT_STREAM -DUSE_GUI=1 -DUSE_GLFW=1 -DUSE_GSTREAMER=1 -o …/…/bin/x86_64/linux/release/nvx_sample_opencv_npp_interop obj/release/main_opencv_npp_interop.o obj/release/alpha_comp_node.o …/…/libs/x86_64/linux/release/libovx.a -L"/usr/lib" …/…/libs/x86_64/linux/release/libovx.a -lfreetype …/…/3rdparty/glfw3/libs/libglfw3.a -lGL -lXrandr -lXi -lXxf86vm -lX11 -lgstpbutils-1.0 -lgstapp-1.0 -lgstbase-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -L/usr/local/cuda-8.0/lib64 -lcudart -L/usr/local/cuda-8.0/lib64 -lnppi -lnppc -L/usr/local/lib -lopencv_cudabgsegm -lopencv_cudaobjdetect -lopencv_cudastereo -lopencv_stitching -lopencv_cudafeatures2d -lopencv_superres -lopencv_cudacodec -lopencv_videostab -lopencv_cudaoptflow -lopencv_cudalegacy -lopencv_cudawarping -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn -lopencv_dpm -lopencv_fuzzy -lopencv_hdf -lopencv_line_descriptor -lopencv_optflow -lopencv_plot -lopencv_reg -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_rgbd -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_face -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_flann -lopencv_xobjdetect -lopencv_objdetect -lopencv_ml -lopencv_xphoto -lopencv_highgui -lopencv_videoio -lopencv_photo -lopencv_imgcodecs -lopencv_cudaimgproc -lopencv_cudafilters -lopencv_imgproc -lopencv_cudaarithm -lopencv_core -lopencv_cudev -L/usr/local/cuda-8.0/lib64 -lcudart -lvisionworks
obj/release/main_opencv_npp_interop.o: In function cv::String::String(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': main_opencv_npp_interop.cpp:(.text._ZN2cv6StringC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN2cv6StringC5ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x2f): undefined reference to cv::String::allocate(unsigned long)’
obj/release/main_opencv_npp_interop.o: In function main': main_opencv_npp_interop.cpp:(.text.startup+0x2a7): undefined reference to cv::String::deallocate()’
main_opencv_npp_interop.cpp:(.text.startup+0x2db): undefined reference to cv::String::deallocate()' main_opencv_npp_interop.cpp:(.text.startup+0x43a2): undefined reference to cv::String::deallocate()’
main_opencv_npp_interop.cpp:(.text.startup+0x43b9): undefined reference to `cv::String::deallocate()’
collect2: error: ld returned 1 exit status
Makefile:158: recipe for target ‘…/…/bin/x86_64/linux/release/nvx_sample_opencv_npp_interop’ failed
make: *** […/…/bin/x86_64/linux/release/nvx_sample_opencv_npp_interop] Error 1

Any help would be greatly appreciated.

Hi,

Thanks for your question.
Just confirmed that nvx_sample_opencv_npp_interop sample can compile without error in TX2.

It looks abnormal to see ‘x86_64’ in the error message.
Do you make the sample directly on the device?
Or could you share your setup steps for us better debugging?

Not compiling on the TX2. I am compiling on Intel based server with Ubuntu 16.04 only without cross compile on TX2. The other interop sample code compiles without error.

Have you verified that OpenCV is working correctly?

Hi,

Sample can be compiled successfully on my host although is 14.04 Ubuntu.
Not sure if this is an issue specific for 16.04 host.

Could you help us remove the following package and re-installed it again?

  • Host-Ubuntu > VisionWorks Pack
  • Host-Ubuntu > OpenCV for Tegra

Which version of openCV is required for VisionWorks-1.6. I have openCV 3.1.0 installed.

If VisionWorks-1.6 can’t use openCV-3.1.0 can I install openCV-3.1.0 on the TX2 and build my application without VisionWorks?

We verified Visionworks with opencv4Tegra, which can be installed by JetPack.
Is your implementation based on opencv3.1? Or it’s okay to use opencv4Tegra?

By the way, if you want to compile Visionworks sample on TX2, you still need to install Visionworks on it.
May I know your usage?

You can build an openCV application on the TX-2 without VisionWorks. You’d have to create your Make or CMake file appropriately selecting the libraries you need (here just OpenCV 3.1.0).

If you wish to not use VisionWorks at all, you can install JetPack on the TX-2 again without VisionWorks.

Thanks for all the help. I will be cross-compiling openCV 3.1.0 for the TX2. So at this time I need not pursue finding the solution to the link error for that one sample. Thanks again!!!