问题
I have a folder that contains a few .h and .cpp files along with a makefile. How can I run them in dev C++. I have just started using dev C++, hence, a bit clueless about this. the make file is
CC=g++
CV=-I/usr/include/opencv
CV2=-lml -lcvaux -lhighgui -lcv -lcxcore
all:
$(CC) main.cpp HOG.cpp HOGFeaturesOfBlock.cpp $(CV) $(CV2) -o featureExtractor
and I'm getting the error main.cpp, hog.cpp: no such file or directory.
回答1:
- Create a new project using File >> New Project. You can ignore the C/C++ options if you use a custom makefile. Also, an empty project will do.
- Add the source and header files to the new project using Project >> Add to Project or the '+' sign in the middle of the top toolbar.
- Go to Project >> Project Options (Alt+P) >> Makefile and tick the 'Use custom makefile' option. Then point Dev-C++ to the custom makefile below.
Also, be sure to update your IDE to the following version, which fixes an immense list of bugs compared to the ancient 4.9.9.2 version, ships with GCC 4.6.1 or 4.7.0, and is fully portable: http://sourceforge.net/projects/orwelldevcpp/
来源:https://stackoverflow.com/questions/13544684/running-a-project-in-dev-c