cv.h not found need help with makefile [closed]

asked 2014-09-18 07:14:44 -0500

rogeralms gravatar image

I want to thank everyone for the help they have given me so far.

I am a Windows person and haven't used a makefile in over 20 years so I really don't know what I'm doing.

I have developed my program in Visual Studio 2012 and it works fine but I must move it to a UNIX server for the class I'm taking. I used the sample makefile from class but when I ran it, I got the message cv.h not found.

After looking over my project in Visual Studio, I determined that I needed to include the following libraries: opencv_core249d.lib opencv_imgproc249d.lib opencv_highgui249d.lib opencv_ml249d.lib opencv_video249d.lib opencv_features2d249d.lib opencv_calib3d249d.lib

without the 249d. I found these libraries in the given directory on the UNIX server as .SO files.

I am having trouble with the LIBS statement:

CC = g++ CFLAGS = -g TARGET = objects OBJS = objects.o LIBPATH = /usr/lib64 LIBS = $(LIBPATH)/ $(LIBPATH)/ $(LIBPATH)/ $(LIBPATH)/ $(LIBPATH)/ $(LIBPATH)/ $(LIBPATH)/

$(TARGET): $(OBJS) $(CC) -o [email protected] $(OBJS) $(LIBS)

.SUFFIXES: .cpp .o

.c.o: $(CC) -c $(CFLAGS) $<

.PHONY: clean

clean: /bin/rm -f core *.o $(TARGET)

When I ran make, the message was: * missing separator. Stop.

Could someone point me to a good tutorial on makefiles for OpenCV, or tell me what I'm doing wrong with this makefile, or perhaps both?

Thank you.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-10-18 14:46:26.717684


berak gravatar imageberak ( 2014-09-18 07:42:07 -0500 )edit

The answer is not necessarily in the makefile. I replaced the headers with

include <opencv2/core/core.hpp>

include <opencv2/highgui/highgui.hpp>

I also removed cout and using namespace std; with printf.

I had started using the older version of OpenCV when I began to code and switched to CV2 accidentally leaving the older headers.My original makefile with just LIBS = $(LIBPATH)/ $(LIBPATH)/ works just fine.

rogeralms gravatar imagerogeralms ( 2014-09-18 21:14:07 -0500 )edit