OpenCV link error

I just follow the “NVIDIA Jetson OpenCV Tutorials - Episode 0” video. When I compile my code, I received the following error:
– Configuring done
– Generating done
– Build files have been written to: /home/ubuntu/CODE/build
Scanning dependencies of target cv_hello
make[2]: Warning: File ‘…/hello.cpp’ has modification time 486 s in the future
[ 50%] Building CXX object CMakeFiles/cv_hello.dir/hello.cpp.o
[100%] Linking CXX executable cv_hello
/usr/bin/ld: cannot find -lopencv_dep_cudart
collect2: error: ld returned 1 exit status
CMakeFiles/cv_hello.dir/build.make:121: recipe for target ‘cv_hello’ failed
make[2]: *** [cv_hello] Error 1
CMakeFiles/Makefile2:67: recipe for target ‘CMakeFiles/cv_hello.dir/all’ failed
make[1]: *** [CMakeFiles/cv_hello.dir/all] Error 2
Makefile:83: recipe for target ‘all’ failed
make: *** [all] Error 2

It told me the opencv_dep_cudart lib could not be found.
I would very appreciate if anyone could help me!

Part of the answer of what is going on is that the time is not set correctly on the system doing the build. Most make commands depend on a time stamp on files to know if the file has been modified and needs building. I would bet that if you run the command “date” the date will be completely wrong. Compare to file dates with “ls -l”.

If you are connected to the internet you might try this to update:

sudo -s
service ntp stop
service ntp start

…then check “date” again.

If you are not networked, then you might use “timedatectl” (see “man timedatectl”) to adjust system time.

The inconsistent date should be fixed, but this is just a warning.

Main error seems to be:

/usr/bin/ld: cannot find -lopencv_dep_cudart

And searching for this in Jetson forum leads to

Thanks for raising this issue, we’re doing the investigation to fix it by either re-record or see what’s changed to have this issue, the do the correction.

And thanks for linuxdev and Honey_Patouceul suggestion on resolving the link error.



Please try new Jetpack3.1.