how to build opencv in makefile.am using automake

asked 2014-06-20 08:55:23 -0600

llearn gravatar image

updated 2014-06-20 09:12:58 -0600

hi, i am trying to create a makefile.am with automake and in the makefile i want to add opencv library. i tried it in the following way but it does not work. Can you point out what is wrong in my code?

AM_CFLAGS = -Wall -I/usr/local/include/opencv

AM_LDFLAGS = -lm -L/usr/local/lib

if DEBUG

AM_CFLAGS += -O0 -ggdb

else

AM_CFLAGS += -O3

AM_LDFLAGS += -s endif

AM_CXXFLAGS = $(AM_CFLAGS)

bin_PROGRAMS = a

a_SOURCES = xx.c xxx.c a.c aa.c aaa.c aaaa.c aaaaa.c

edit retag flag offensive close merge delete

Comments

-I/usr/local/include (without the opencv at the end)

also, why not use cmake ?

berak gravatar imageberak ( 2014-06-20 09:03:01 -0600 )edit

Thanks for your answer. I got this program from supervisor and it contains autogen.sh automake.am in the package so that icant use cmake. This program aims to detect chessboard corner but all the algorithms and functions are written by the author, now i want to use some functions in opencv to improve the performance such like load image. gaussian blur etc. I tried to eliminate the opencv, but i doesnot work either. always i got this errors " undefined reference to cvLoadImage'" " undefined reference tocvNamedWindow'".

llearn gravatar imagellearn ( 2014-06-20 09:29:08 -0600 )edit