Linux - Ayuda Makefile

 
Vista:

Ayuda Makefile

Publicado por Juan (2 intervenciones) el 20/06/2011 11:54:43
Hola, estoy trabajando con OpenCV y tengo el siguiente Makefile:

#compiler
C++ = g++

#flags
CFLAGS = -Wall -DASSERT -g

OPENCV_DIR = $(HOME)/local/lib/opencv2.2/opencv

IFLAGS = -I$(OPENCV_DIR)/modules/core/include -I$(OPENCV_DIR)/modules/features2d/include/ -I$(OPENCV_DIR)/modules/highgui/include/ -I$(OPENCV_DIR)/modules/imgproc/include/ -I$(OPENCV_DIR)/modules/calib3d/include/ -I$(OPENCV_DIR)/modules/flann/include/ -I$(OPENCV_DIR)/include/opencv


LFLAG = -L$(OPENCV_DIR)release/lib -Wl,-rpath,$(OPENCV_DIR)release/lib

OPTIONS = -lcxcore -lcv -lhighgui -lcvaux -lml

#targets of the makefile
TARGETS = main.o prueba.o main


#CFLAGS += `pkg-config opencv --cflags`
#LFLAG += `pkg-config opencv --libs`

####################
#Targets #
####################

all: $(TARGETS)

main.o: main.cpp
$(C++) -c main.cpp $(CFLAGS) $(IFLAGS)

prueba.o: prueba.cpp
$(C++) -c prueba.cpp $(IFLAGS) $(CFLAGS)

main :main.o prueba.o
$(C++) -o main main.o prueba.o $(LFLAG)

clean:
rm main *.o *~ -f

y cuando compilo obtengo una larga salida que empieza así...

g++ -o main main.o prueba.o -L/home/juan/local/lib/opencv2.2/opencvrelease/lib -Wl,-rpath,/home/juan/local/lib/opencv2.2/opencvrelease/lib
prueba.o: In function `cv::operator<<(cv::FileStorage&, char const*)':
/home/juan/local/lib/opencv2.2/opencv/modules/core/include/opencv2/core/operations.hpp:2625: undefined reference to `cv::operator<<(cv::FileStorage&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
prueba.o: In function `prueba':
/home/juan/Desktop/pruebas/prueba.cpp:19: undefined reference to `cv::StarFeatureDetector::StarFeatureDetector(int, int, int, int, int)'

¿Cuál puede ser el problema?

Gracias!
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder