Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do i solve this undefined reference? #7

Open
ghost opened this issue Jun 14, 2015 · 2 comments
Open

How do i solve this undefined reference? #7

ghost opened this issue Jun 14, 2015 · 2 comments

Comments

@ghost
Copy link

ghost commented Jun 14, 2015

/usr/local/include/opencv2/core/mat.hpp:367: undefined reference to cv::Mat::deallocate()' CMakeFiles/example6.dir/src/example6.cpp.o: In functioncv::Mat::release()':
/usr/local/include/opencv2/core/mat.hpp:367: undefined reference to cv::Mat::deallocate()' CMakeFiles/example6.dir/src/example6.cpp.o: In function~Mat':
/usr/local/include/opencv2/core/mat.hpp:278: undefined reference to cv::fastFree(void*)' CMakeFiles/example6.dir/src/example6.cpp.o: In functioncv::Mat::release()':
/usr/local/include/opencv2/core/mat.hpp:367: undefined reference to cv::Mat::deallocate()' CMakeFiles/example6.dir/src/example6.cpp.o: In functioncv::Mat::~Mat()':
/usr/local/include/opencv2/core/mat.hpp:278: undefined reference to cv::fastFree(void*)' CMakeFiles/example6.dir/src/example6.cpp.o: In function~Mat':
/usr/local/include/opencv2/core/mat.hpp:278: undefined reference to cv::fastFree(void*)' /usr/local/include/opencv2/core/mat.hpp:367: undefined reference tocv::Mat::deallocate()'
/usr/local/include/opencv2/core/mat.hpp:278: undefined reference to cv::fastFree(void*)' /usr/local/include/opencv2/core/mat.hpp:367: undefined reference tocv::Mat::deallocate()'
CMakeFiles/example6.dir/src/example6.cpp.o: In function main': /home/raoul/dev/rosbook/chapter3_tutorials/src/example6.cpp:19: undefined reference tocv::VideoCapture::VideoCapture(int)'
/home/dev/rosbook/chapter3_tutorials/src/example6.cpp:20: undefined reference to
/home/dev/rosbook/chapter3_tutorials/src/example6.cpp:19: undefined reference to `cv::VideoCapture::~VideoCapture()'

I am using Opencv 2.9?

@ghost ghost changed the title I have been getting this error in Example 6 How do i solve this undefined reference? Jun 14, 2015
@efernandez
Copy link
Collaborator

I think you need to add a find_library for OpenCV and then add target_link_libraries for each executable affected, linking against ${OpenCV_LIBRARIES}.

Something like that should work. However, with rosbuild this usually doesn't happen. Which branch are you using? master?

@Ichini24
Copy link

Hello. I have a similar problem. Did u find an issue and can u share it with me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants