Hello, I'm totally new to Make and Automake but I need to build a project which uses Automake. I'm using Ubuntu 12.04 and I've installed with succes the openCV library (version 2.4.3) which I had used in several small projects which I built using:
g++ sourcefile.cpp `pkg-config opencv --cflags --libs` . . Now, I think that the reason why Make gives me this error is because I haven't added the instruction `pkg-config opencv --cflags --libs` in the proper Makefile.am . I've tried to add that instruction to the LDFLAGS but Make keeps on giving me the same error in output. This is the src/libcnbiVisualNavigation/Makefile.am I tried to modify: ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- lib_LTLIBRARIES = libnavigation.la include_HEADERS = \ some_headers.h libnavigation_la_SOURCES = \ some_sources.cpp libnavigation_la_LDFLAGS = -version-info $(CURRENT):$(REVISION):$(AGE) -release $(RELEASE) `pkg-config opencv --cflags --libs` libnavigation_la_LIBADD = -lm $(OPENCV_LIBS) -lboost_thread-mt -lboost_signals-mt -lcnbiVisualNavigation ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- This is the output that make gives to me: ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Making all in src/libnavigation make[1]: Entering directory `/home/robotinob/mlwcp/ccp/wccontrol/build/src/libnavigation' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/home/robotinob/mlwcp/ccp/wccontrol/build/src/libnavigation' Making all in src/bin make[1]: Entering directory `/home/robotinob/mlwcp/ccp/wccontrol/build/src/bin' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/home/robotinob/mlwcp/ccp/wccontrol/build/src/bin' Making all in examples make[1]: Entering directory `/home/robotinob/mlwcp/ccp/wccontrol/build/examples' /bin/bash ../libtool --tag=CXX --mode=link g++ -g -O2 -L/home/robotinob/OpenRobotino//lib: -o wheelchair wheelchair.o ../src/libnavigation/libnavigation.la libtool: link: g++ -g -O2 -o .libs/wheelchair wheelchair.o -L/home/robotinob/OpenRobotino//lib: ../src/libnavigation/.libs/libnavigation.so wheelchair.o: In function `main': /home/robotinob/mlwcp/ccp/wccontrol/build/examples/../../examples/wheelchair.cpp:391: undefined reference to `cv::getTickFrequency()' /home/robotinob/mlwcp/ccp/wccontrol/build/examples/../../examples/wheelchair.cpp:397: undefined reference to `cv::waitKey(int)' /home/robotinob/mlwcp/ccp/wccontrol/build/examples/../../examples/wheelchair.cpp:403: undefined reference to `cv::getTickCount()' /home/robotinob/mlwcp/ccp/wccontrol/build/examples/../../examples/wheelchair.cpp:428: undefined reference to `cv::getTickCount()' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::VideoCapture::get(int)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::rectangle(cv::Mat&, cv::Point_<int>, cv::Point_<int>, cv::Scalar_<double> const&, int, int, int)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::Mat::deallocate()' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::VideoCapture::read(cv::Mat&)' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `typeinfo for cv::VideoCapture' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::clipLine(cv::Size_<int>, cv::Point_<int>&, cv::Point_<int>&)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::warpAffine(cv::_InputArray const&, cv::_OutputArray const&, cv::_InputArray const&, cv::Size_<int>, int, int, cv::Scalar_<double> const&)' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::GaussianBlur(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, double, double, int)' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::VideoCapture::open(int)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::FileStorage::FileStorage(std::string const&, int, std::string const&)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::Mat::operator=(cv::Scalar_<double> const&)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::VideoWriter::VideoWriter()' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::FileStorage::operator[](char const*) const' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::bitwise_not(cv::_InputArray const&, cv::_OutputArray const&, cv::_InputArray const&)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::VideoWriter::~VideoWriter()' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::VideoCapture::retrieve(cv::Mat&, int)' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::blur(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, cv::Point_<int>, int)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::getRotationMatrix2D(cv::Point_<float>, double, double)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::MatConstIterator::seek(long, bool)' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cvReleaseMat' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::add(cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, cv::_InputArray const&, int)' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::VideoCapture::open(std::string const&)' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::remap(cv::_InputArray const&, cv::_OutputArray const&, cv::_InputArray const&, cv::_InputArray const&, int, int, cv::Scalar_<double> const&)' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::distanceTransform(cv::_InputArray const&, cv::_OutputArray const&, int, int)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::MatConstIterator::seek(int const*, bool)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::Mat::create(int, int const*, int)' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::VideoCapture::~VideoCapture()' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::Mat::copyTo(cv::_OutputArray const&) const' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cvLoad' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::flip(cv::_InputArray const&, cv::_OutputArray const&, int)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::imshow(std::string const&, cv::_InputArray const&)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::fillConvexPoly(cv::Mat&, cv::Point_<int> const*, int, cv::Scalar_<double> const&, int, int)' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cvReleaseImage' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::VideoCapture::grab()' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cvNamedWindow' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::VideoCapture::set(int, double)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::circle(cv::Mat&, cv::Point_<int>, int, cv::Scalar_<double> const&, int, int, int)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::_InputArray::_InputArray(double const&)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::Mat::convertTo(cv::_OutputArray const&, int, double, double) const' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cvDestroyAllWindows' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::VideoWriter::operator<<(cv::Mat const&)' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::Mat::Mat(CvMat const*, bool)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cvDestroyWindow' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::Mat::copySize(cv::Mat const&)' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cvCreateImage' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::imwrite(std::string const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::FileStorage::~FileStorage()' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::Mat::setTo(cv::_InputArray const&, cv::_InputArray const&)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::FileNode::operator[](std::string const&) const' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::Canny(cv::_InputArray const&, cv::_OutputArray const&, double, double, int, bool)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::ellipse(cv::Mat&, cv::Point_<int>, cv::Size_<int>, double, double, double, cv::Scalar_<double> const&, int, int, int)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::noArray()' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `vtable for cv::_OutputArray' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::VideoCapture::VideoCapture()' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::VideoWriter::open(std::string const&, int, double, cv::Size_<int>, bool)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::FileStorage::isOpened() const' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::initUndistortRectifyMap(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::Size_<int>, int, cv::_OutputArray const&, cv::_OutputArray const&)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::fastFree(void*)' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cvGetSize' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::Mat::zeros(int, int, int)' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::VideoCapture::isOpened() const' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cvSplit' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::Mat::reshape(int, int, int const*) const' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::FileNode::operator[](char const*) const' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::VideoWriter::isOpened() const' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::line(cv::Mat&, cv::Point_<int>, cv::Point_<int>, cv::Scalar_<double> const&, int, int, int)' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::putText(cv::Mat&, std::string const&, cv::Point_<int>, int, double, cv::Scalar_<double>, int, int, bool)' /usr/local/lib/libcnbiVisualNavigation-0.so.0: undefined reference to `cv::VideoCapture::release()' ../src/libnavigation/.libs/libnavigation.so: undefined reference to `cv::resize(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, double, double, int)' collect2: error: ld returned 1 exit status make[1]: *** [wheelchair] Error 1 make[1]: Leaving directory `/home/robotinob/mlwcp/ccp/wccontrol/build/examples' make: *** [all-recursive] Error 1 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Do you have any other suggestion to solve this problem? If you need some further information, please tell me! Thank you for your attention! -- View this message in context: http://gnu-automake.7480.n7.nabble.com/Make-error-undefined-reference-to-openCV-functions-error-ld-returned-1-exit-status-tp21340.html Sent from the Gnu - Automake - General mailing list archive at Nabble.com.