A very different problem (I think) than my previous one.
Using C::B 8.02 with Cygwin with a custom makefile. The project has one target "all". When I do build, the compile steps are correct, but the final linking step that fails is NOT what my makefile has. Running make in Cygwin (even in the Windows command shell) does the right thing. I can manually add library switches in C::B, but that removes the point of the makefile.
This is the Build Log that results in C::B. The makefile is below that. The first two commands ("g++ ...") are from my makefile. The third command (line 5, ""g++.exe -o main.exe ...") is not. I deliberately changed my makefile to say gcc, which is ignored, as are the LDFLAG and LIB variables.
Ideas?
-------------- Build: all in testapp ---------------
g++.exe -Wall -g -fexceptions -O2 -c C:/NU/courses/cs211/projects/testapp/Main.cpp -o C:/NU/courses/cs211/projects/testapp/.objs/Main.o
g++.exe -Wall -g -fexceptions -O2 -c C:/NU/courses/cs211/projects/testapp/ExampleTestCase.cpp -o C:/NU/courses/cs211/projects/testapp/.objs/ExampleTestCase.o
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h: In static member function `static void ExampleTestCase::addTestsToSuite(CppUnit::TestSuiteBuilderContextBase&)':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_uninitialized.h:82: warning: '__cur' might be used uninitialized in this function
g++.exe -o main.exe C:/NU/courses/cs211/projects/testapp/.objs/Main.o C:/NU/courses/cs211/projects/testapp/.objs/ExampleTestCase.o
C:/NU/courses/cs211/projects/testapp/.objs/Main.o: In function `main':
C:/NU/courses/cs211/projects/testapp/Main.cpp:13: undefined reference to `CppUnit::TestResult::TestResult(CppUnit::SynchronizedObject::SynchronizationObject*)'
C:/NU/courses/cs211/projects/testapp/Main.cpp:16: undefined reference to `CppUnit::TestResultCollector::TestResultCollector(CppUnit::SynchronizedObject::SynchronizationObject*)'
...
Makefile:
SRCS = ExampleTestCase.cpp Main.cpp
HDRS = ExampleTestCase.h
HANDIN = handin
CC = g++
OBJS = $(SRCS:.cpp=.o)
APP = main.exe
CFLAGS = -c -g -Wall
LDFLAGS = -L/opt/local/lib
LIBS = -lcppunit -ldl
all: $(OBJS)
gcc $(LDFLAGS) $(OBJS) -o $@ $(LIBS)
# Recompile everything with header files change
%.o: %.cpp $(INCS)
$(CC) $(CFLAGS) $< -o $@
handin:
zip handin.zip Makefile *.cpp *.h *.txt
clean:
-rm $(APP) *.o