4
« en: Lunes 20 de Junio de 2011, 14:59 »
Hola estoy intentando crear un Makefile para compilar un programilla de ejemplo de Opencv de la siguiente manera:
#compiler
C++ = g++
#flags
CFLAGS = -Wall -DASSERT -g
OPENCV_DIR = $(HOME)/local/lib/opencv2.2/opencv
IFLAGS = -I$(OPENCV_DIR)/include/opencv
LFLAGS = -L$(OPENCV_DIR)/release/lib
OPTIONS = -lcxcore -lcv -lhighgui -lcvaux -lml
#targets of the makefile
TARGETS = prueba
#no quiero usar esto
#CFLAGS += `pkg-config opencv --cflags`
#LFLAG += `pkg-config opencv --libs`
####################
#Targets #
####################
all: $(TARGETS)
prueba.o:
$(C++) -c prueba.cpp $(CFLAGS) $(IFLAGS) $(LFLAGS) $(OPTIONS)
prueba: prueba.o
$(C++) -o prueba prueba.o $(OPTIONS)
clean:
rm prueba *.o *~ -f
Cuando ejecuto "make" obtengo la siguiente salida:
make
g++ -c prueba.cpp -Wall -DASSERT -g -I/home/dani/local/lib/opencv2.2/opencv/include/opencv -L/home/dani/local/lib/opencv2.2/opencv/release/lib -lcxcore -lcv -lhighgui -lcvaux -lml
In file included from prueba.cpp:2:
/home/dani/local/lib/opencv2.2/opencv/include/opencv/highgui.h:45:33: error: opencv2/core/core_c.h: No such file or directory
/home/dani/local/lib/opencv2.2/opencv/include/opencv/highgui.h:46:33: error: opencv2/core/core.hpp: No such file or directory
/home/dani/local/lib/opencv2.2/opencv/include/opencv/highgui.h:47:39: error: opencv2/highgui/highgui_c.h: No such file or directory
/home/dani/local/lib/opencv2.2/opencv/include/opencv/highgui.h:48:39: error: opencv2/highgui/highgui.hpp: No such file or directory
prueba.cpp: In function ‘int main(int, char**)’:
prueba.cpp:7: error: ‘IplImage’ was not declared in this scope
prueba.cpp:7: error: ‘img’ was not declared in this scope
prueba.cpp:7: error: ‘CV_LOAD_IMAGE_UNCHANGED’ was not declared in this scope
prueba.cpp:7: error: ‘cvLoadImage’ was not declared in this scope
prueba.cpp:9: error: ‘CV_WINDOW_AUTOSIZE’ was not declared in this scope
prueba.cpp:9: error: ‘cvNamedWindow’ was not declared in this scope
prueba.cpp:11: error: ‘cvShowImage’ was not declared in this scope
prueba.cpp:13: error: ‘cvWaitKey’ was not declared in this scope
prueba.cpp:15: error: ‘cvReleaseImage’ was not declared in this scope
prueba.cpp:16: error: ‘cvDestroyWindow’ was not declared in this scope
make: *** [prueba.o] Error 1
Os paso el código: "mediafire.com/?cbwrfc0xk2q7xii"
Gracias.