Undefined reference to cpp

I'm having some trouble with my makefile (I do believe).

When I define a constructor in my header file I can link to it just fine. When the constructor is in the .cpp the compiler has issues.

The makefile is probably helpful. Beware that I know very little about them, and the shape of it is due to constant guess/check until something works (or in this case, not).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
CC= g++
SECDIR = sections/

effecteditor.exe: main.o effectDir.o fileH.o
	$(CC) main.o  effectDir.o fileH.o -o effecteditor.exe

main.o: main.cpp effectDir.h FileH.h
	$(CC) -c main.cpp
	
effectDir.o: effectDir.cpp FileH.h $(SECDIR)section01.o
	$(CC) -c effectDir.cpp 
	
fileH.o: FileH.cpp FileH.h
	$(CC) -c FileH.cpp

$(SECDIR)section01.o: $(SECDIR)section01.cpp $(SECDIR)section01.h
	$(CC) -c $(SECDIR)section01.cpp -o $(SECDIR)section01.o


efffectDir.cpp is trying to call a section01.cpp's constructor. Any Ideas?

Edit: So I think I got it:
1
2
effecteditor.exe: main.o effectDir.o $(SECDIR)section01.o fileH.o
	$(CC) main.o  effectDir.o fileH.o -o effecteditor.exe


We're in business now, but I have 15 sections to make. I don't want huge lines, is there a way to make one, say AllSections.o?
Last edited on
Topic archived. No new replies allowed.