• Jueves 2 de Mayo de 2024, 03:41

Autor Tema:  Ejemplo Makefile Opencv2.2  (Leído 2068 veces)

roleiland

  • Nuevo Miembro
  • *
  • Mensajes: 4
    • Ver Perfil
Ejemplo Makefile Opencv2.2
« en: Lunes 20 de Junio de 2011, 14:59 »
0
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.

roleiland

  • Nuevo Miembro
  • *
  • Mensajes: 4
    • Ver Perfil
Re: Ejemplo Makefile Opencv2.2
« Respuesta #1 en: Martes 21 de Junio de 2011, 10:33 »
0
Ya he conseguido compilar mediante el Makefile utilizando solo las bibliotecas instaladas en mi HOME. Si me permitis publicar links os subo el código.

ProfesorX

  • Moderador
  • ******
  • Mensajes: 796
  • Nacionalidad: mx
    • Ver Perfil
Re: Ejemplo Makefile Opencv2.2
« Respuesta #2 en: Martes 21 de Junio de 2011, 15:18 »
0
Cita de: "roleiland"
Si me permitis publicar links os subo el código.

El foro bloquea la publicacion de links a los nuevos, para evitar a aquellos que solo publican SPAM.

Despues de que tengas publicados 20 mensajes en el foro, se desbloquea automaticamente la publicacion de links, mientras no se puede hacer mas, asi que te toca esperar.

Saludos :)

NOTA:
==================================================================
Este foro es para ayudar, aprender, compartir... usenlo para eso,
NO SE RESUELVEN DUDAS POR MENSAJE PRIVADO Y MENOS POR CORREO
==================================================================

roleiland

  • Nuevo Miembro
  • *
  • Mensajes: 4
    • Ver Perfil
Re: Ejemplo Makefile Opencv2.2
« Respuesta #3 en: Miércoles 22 de Junio de 2011, 11:14 »
0
Era por aportar un poco a la comunidad, ya que a mi hacer esta tarea me ha llevado su tiempo... Bueno en cualquier caso, subo el link aunque quede mal:

(añadir World Wide Web).mediafire.com/?kea5on9wdbc3ynh