I am new to both makefiles and projects using multiple files. Now I have one main.c and two user libraries. Here's the makefile:
CC = gcc
OBJECTS = main.o path.o util.o
9_1 : $(OBJECTS)
$(CC) -g $(OBJECTS) -o 9_1
main.o : main.c path.h util.h
$(CC) -g -c main.c path.h util.h
path.o : path.c path.h util.h
$(CC) -g -c path.c path.h util.h
util.o : util.c util.h
$(CC) -g -c util.c util.h
.PHONY : clean
clean :
rm $(OBJECTS)
I would like to be able to debug this project in Emacs (using a multiple window variable), however, when I run gdb -i=mi 9_1
(the default parameter) and try to add breakpoints in main.c, it does not allow me. In particular: I run b main.c:25
and I get
No symbol table is loaded. Use the "file" command.
Breakpoint 1 (main.c:25) pending
What should I do?
Nepec source
share