Reputation: 297
I installed mingw gcc, g++ compiler. I downloaded the opencv source for 2.4.10. Then I used the following commands to compile the source:
cmake -G "MinGW Makefiles" -D CMAKE_CXX_COMPILER=mingw32-g++.exe -D CMAKE_MAKE_PROGRAM=mingw32-make.exe ..
mingw32-make
mingw32-make install
Then I added the lib to my windows PATH. I use the following Makefile to compile the code but I get an error(using windows cmd):
CC = gcc
CFLAGS = -g -Wall
SRCS = main.cpp input_main.cpp image_manuplation.cpp track_object.cpp
PROG = main.exe
OPENCV = -I"C:\Users\Username\Documents\opencv\sources\release\install\include" -I. -L"C:\Users\Username\Documents\opencv\sources\release\install\x86\mingw\lib" -lopencv_calib3d2410 -lopencv_contrib2410 -lopencv_core2410 -lopencv_features2d2410 --lopencv_flann2410 -lopencv_gpu2410 -lopencv_highgui2410 -lopencv_imgproc2410 -lopencv_legacy2410 -lopencv_ml2410 -lopepncv_nonfree2410 -lopencv_objdetect2410 -lopencv_ocl2410 -lopencv_photo2410 -lopencv_stitching2410 -lopencv_superres2410 -lopencv_ts2410 -lopencv_video2410 -lopencv_videostab2410
all : $(PROG)
$(PROG) : $(SRCS)
$(CC) $(CFLAGS) -o $(PROG) $(SRCS) $(OPENCV)
clean:
@del $(PROG)
I get the following error:
Makefile:12: *** multiple target patterns. Stop.
Would someone know how to fix the error? I did similar thing on Ubuntu and it works. Thank you
Upvotes: 1
Views: 1253
Reputation: 101041
Line 12 is the recipe line. I believe you haven't started that line with a TAB character. Make requires a real TAB, not just spaces. Make sure your editor is capable of inserting a TAB character and doesn't "helpfully" convert it to spaces for you when you save.
Upvotes: 2