[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Make error: undefined reference to openCV functions (error: ld retur
From: |
Baurzhan Ismagulov |
Subject: |
Re: Make error: undefined reference to openCV functions (error: ld returned 1 exit status) |
Date: |
Tue, 24 Jun 2014 19:59:08 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hello Alessandro,
On Tue, Jun 24, 2014 at 01:19:02PM +0200, Alessandro Salatiello wrote:
> 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
...
> 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()'
...
> ../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
Seems you have to add the libs to wheelchair_LDADD.
I usually use autoconf for that. In configure.ac:
PKG_CHECK_MODULES(OPENCV, opencv)
In Makefile.am:
wheelchair_CPPFLAGS = $(OPENCV_CFLAGS)
wheelchair_LDADD = $(OPENCV_LIBS)
With kind regards,
Baurzhan.