2
votes

I am trying to run a opencv c++ project from ubuntu. I ve installed properly the opencv, I ve managed to run a simple opencv cpp file. I am trying to run my MSVC++ code. I put in the same file cpp and header files. I ve created the following makefile:

CC=g++
CFLAGS = `pkg-config --cflags opencv`
LIBS = `pkg-config --libs opencv`

executable: program.o Detection.o prediction.o
    $(CC) -o executable $(LIBS) program.o Detection.o prediction

program.o: 
    $(CC) $(CFLAGS) -c program.cpp 
Detection.o:
        $(CC) $(CFLAGS) -c Detection.cpp
prediction.o:
        $(CC) $(CFLAGS) -c prediction.cpp

I am receiving fatal error: core.hpp: No such file or directory compilation terminated. Any idea for what I ve got to do??

1

1 Answers

1
votes

Not a solution, but several marks about your makefile:

  • 'prediction.o' on linkage line (maybe a wrong copy-paste)
  • I am not sure but it is not recommanded to put space when initialize your variables CFLAGS and LIBS
  • It is not necessary to precise source compilation

CC=g++
CFLAGS=pkg-config --cflags opencv
LIBS=pkg-config --libs opencv

executable: program.cpp Detection.cpp prediction.cpp
    $(CC) program.cpp Detection.cpp prediction.cpp -o executable $(LIBS) $(CFLAGS)