I'm trying to use a custom makefile with Cygwin in Code::Blocks. C::B seems to be running the makefile correctly, but the compile command fails. The same command works fine pasted into a Cygwin window. What am I missing?
Latest Cygwin (1.5.25-15)
g++ with cppunit installed in the default /lib and /usr/include directories
Code::Blocks 8.02.
Cygwin GCC is the default compiler
Nothing has been added to search directories for compiler or project.
My project directory has a two .cpp, one .h file (examples from CppUnit site), a Makefile, and the C::B .cbp file.
My project has custom makefile checked and one target, all. The Make clean command is "$make -f $makefile clean" The build command is "$make -f $makefile $target". I set the build output to Full command line.
Build | Clean works fine.
Build | Build runs the correct compile commands, but g++ doesn't find the CppUnit header files. Pasting the command shown in the Build log works fine in the Cygwin console window.
Here's the Build Log:
g++ -c -g -Wall ExampleTestCase.cpp -o ExampleTestCase.o
ExampleTestCase.cpp:1:41: error: cppunit/config/SourcePrefix.h: No such file or directory
In file included from ExampleTestCase.cpp:2:
ExampleTestCase.h:5:45: error: cppunit/extensions/HelperMacros.h: No such file or directory
In file included from ExampleTestCase.cpp:2:
ExampleTestCase.h:13: error: 'CPPUNIT_NS' has not been declared
ExampleTestCase.h:13: error: expected `{' before 'TestFixture'
...
make: *** [ExampleTestCase.o] Error 1
Process terminated with status 2 (0 minutes, 0 seconds)
16 errors, 0 warnings
If I copy and paste that first line, "g++ -c -g -Wall ExampleTestCase.cpp -o ExampleTestCase.o", into the Cygwin console when I'm in the project directory, the compilation succeeds.
Ideas on what to try next? More info I should post here? I've done lots of searching under the makefile topic -- but perhaps that's not the issue?