zhengthomastang/2018AICity_TeamUW

collect2: error: ld returned 1 exit status`

Opened this issue · 4 comments

hi @zhengthomastang
thank you for sharing with us you code source and make it open-source ,
i have a problem when i run any main.cpp file :

ing const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)' /usr/bin/ld: main.cpp:(.text+0x2b2): undefined reference to cv::VideoCapture::~VideoCapture()'
/usr/bin/ld: main.cpp:(.text+0x2de): undefined reference to cv::VideoCapture::~VideoCapture()' /usr/bin/ld: main.cpp:(.text+0x351): undefined reference to cv::VideoCapture::~VideoCapture()'
/usr/bin/ld: /tmp/cc6mUeHV.o: in function cv::String::String(char const*)': main.cpp:(.text._ZN2cv6StringC2EPKc[_ZN2cv6StringC5EPKc]+0x4f): undefined reference to cv::String::allocate(unsigned long)'
/usr/bin/ld: /tmp/cc6mUeHV.o: in function cv::String::~String()': main.cpp:(.text._ZN2cv6StringD2Ev[_ZN2cv6StringD5Ev]+0x14): undefined reference to cv::String::deallocate()'
/usr/bin/ld: /tmp/cc6mUeHV.o: in function cv::Mat::~Mat()': main.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x39): undefined reference to cv::fastFree(void*)'
/usr/bin/ld: /tmp/cc6mUeHV.o: in function cv::Mat::release()': main.cpp:(.text._ZN2cv3Mat7releaseEv[_ZN2cv3Mat7releaseEv]+0x4b): undefined reference to cv::Mat::deallocate()'
collect2: error: ld returned 1 exit status
(base) root@ZakariaUbunto:/home/zakaria/Public/2018AICity_TeamUW-master/Track1/1_VDO2IMG/src# clear

(base) root@ZakariaUbunto:/home/zakaria/Public/2018AICity_TeamUW-master/Track1/1_VDO2IMG/src# g++ main.cpp
/usr/bin/ld: /tmp/ccvDSGHa.o: in function main': main.cpp:(.text+0x33): undefined reference to cv::VideoCapture::VideoCapture()'
/usr/bin/ld: main.cpp:(.text+0x6c): undefined reference to cv::VideoCapture::VideoCapture(cv::String const&)' /usr/bin/ld: main.cpp:(.text+0x94): undefined reference to cv::VideoCapture::~VideoCapture()'
/usr/bin/ld: main.cpp:(.text+0xb2): undefined reference to cv::VideoCapture::isOpened() const' /usr/bin/ld: main.cpp:(.text+0x131): undefined reference to vtable for cv::VideoCapture'
/usr/bin/ld: main.cpp:(.text+0x256): undefined reference to cv::imwrite(cv::String const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)' /usr/bin/ld: main.cpp:(.text+0x2b2): undefined reference to cv::VideoCapture::~VideoCapture()'
/usr/bin/ld: main.cpp:(.text+0x2de): undefined reference to cv::VideoCapture::~VideoCapture()' /usr/bin/ld: main.cpp:(.text+0x351): undefined reference to cv::VideoCapture::~VideoCapture()'
/usr/bin/ld: /tmp/ccvDSGHa.o: in function cv::String::String(char const*)': main.cpp:(.text._ZN2cv6StringC2EPKc[_ZN2cv6StringC5EPKc]+0x4f): undefined reference to cv::String::allocate(unsigned long)'
/usr/bin/ld: /tmp/ccvDSGHa.o: in function cv::String::~String()': main.cpp:(.text._ZN2cv6StringD2Ev[_ZN2cv6StringD5Ev]+0x14): undefined reference to cv::String::deallocate()'
/usr/bin/ld: /tmp/ccvDSGHa.o: in function cv::Mat::~Mat()': main.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x39): undefined reference to cv::fastFree(void*)'
/usr/bin/ld: /tmp/ccvDSGHa.o: in function cv::Mat::release()': main.cpp:(.text._ZN2cv3Mat7releaseEv[_ZN2cv3Mat7releaseEv]+0x4b): undefined reference to cv::Mat::deallocate()'
collect2: error: ld returned 1 exit status`

I am not sure which package of code you are experimenting, but it is clear that OpenCV is not correctly linked to the compilation environment.

ah ok i will uninstall open cv and reinstall it ,

hi sir i have the same problem all the time please help me

i try to run Speed test