Undefined reference maybe makefile is wrong?

The errors that you’re getting are linker errors, telling you that while linking your program the linker can’t find a function named ‘CreateSet’ (etc.). It’s not immediately obvious why that should be the case, because it appears that you’re including “set.o” in the build command.

To troubleshoot build problems, it’s often useful to figure out what make is trying to do, and then run the commands individually one at a time so you can see where things go wrong. “make -n” will show you what commands “make” would run, without actually doing them. I would expect to see a command like:

gcc -o proj1 main.o set.o

try running that by hand and see where it gets you

Leave a Comment