jetsonhacks / buildOpenCVTX2

Build and install OpenCV for the NVIDIA Jetson TX2
MIT License
276 stars 152 forks source link

Build Error #11

Closed EdXian closed 6 years ago

EdXian commented 6 years ago

Hi all, I install OpenCV package as the following step:

./buildOpenCV.sh
make
sudo make install

However,I got these error

Scanning dependencies of target opencvtest
[ 50%] Building CXX object CMakeFiles/opencvtest.dir/main.cpp.o
[100%] Linking CXX executable opencvtest
CMakeFiles/opencvtest.dir/main.cpp.o: In function `main':
main.cpp:(.text+0x28): undefined reference to `cv::VideoCapture::VideoCapture(int)'
main.cpp:(.text+0x30): undefined reference to `cv::VideoCapture::isOpened() const'
main.cpp:(.text+0x58): undefined reference to `cv::VideoCapture::get(int) const'
main.cpp:(.text+0x68): undefined reference to `cv::VideoCapture::get(int) const'
main.cpp:(.text+0x98): undefined reference to `cv::namedWindow(cv::String const&, int)'
main.cpp:(.text+0xac): undefined reference to `cv::VideoCapture::operator>>(cv::Mat&)'
main.cpp:(.text+0xb0): undefined reference to `cv::VideoCapture::operator>>(cv::Mat&)'
main.cpp:(.text+0xf8): undefined reference to `cv::imshow(cv::String const&, cv::_InputArray const&)'
main.cpp:(.text+0x110): undefined reference to `cv::waitKey(int)'
main.cpp:(.text+0x12c): undefined reference to `cv::VideoCapture::~VideoCapture()'
main.cpp:(.text+0x194): undefined reference to `cv::VideoCapture::~VideoCapture()'
CMakeFiles/opencvtest.dir/main.cpp.o: In function `cv::String::String(char const*)':
main.cpp:(.text._ZN2cv6StringC2EPKc[_ZN2cv6StringC5EPKc]+0x4c): undefined reference to `cv::String::allocate(unsigned long)'
CMakeFiles/opencvtest.dir/main.cpp.o: In function `cv::String::~String()':
main.cpp:(.text._ZN2cv6StringD2Ev[_ZN2cv6StringD5Ev]+0x10): undefined reference to `cv::String::deallocate()'
CMakeFiles/opencvtest.dir/main.cpp.o: In function `cv::String::operator=(cv::String const&)':
main.cpp:(.text._ZN2cv6StringaSERKS0_[_ZN2cv6StringaSERKS0_]+0x2c): undefined reference to `cv::String::deallocate()'
CMakeFiles/opencvtest.dir/main.cpp.o: In function `cv::Mat::~Mat()':
main.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x34): undefined reference to `cv::fastFree(void*)'
CMakeFiles/opencvtest.dir/main.cpp.o: In function `cv::Mat::release()':
main.cpp:(.text._ZN2cv3Mat7releaseEv[_ZN2cv3Mat7releaseEv]+0x58): undefined reference to `cv::Mat::deallocate()'
collect2: error: ld returned 1 exit status
CMakeFiles/opencvtest.dir/build.make:94: recipe for target 'opencvtest' failed
make[2]: *** [opencvtest] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/opencvtest.dir/all' failed
make[1]: *** [CMakeFiles/opencvtest.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

I have checked the packge is installed in the directory /usr/local/lib Can anyone help me? Thanks in advance!!

jetsonhacks commented 6 years ago

You don't say which directory you were in when you attempted to build. The instructions explicitly state that you must be in $HOME/opencv/build

jetsonhacks commented 6 years ago

You need to be in the opencv build directory when you make/make install.