'C Program Debugging: Cannot get Makefile to work with GDB

I have a makefile as follows:

CC=gcc
CFLAGS=-g -Wall -Wextra
PTHREADS=-lpthread

all: client.o threadpool.o
                $(CC) $(CFLAGS) -o example client.o threadpoool.o $(PTHREADS)

client.o: client .c
           $(CC) $(CFLAGS) -c client.c $(PTHREADS) 

threadpool.o: threadpool.c threadpool.h
           $(CC) $(CFLAGS) -c client.c $(PTHREADS) 

clean: 
           rm -rf *.o
           rm -rf example

However, when I run the makefile and then try and load example into GDB like so:

$ make
$ gdb ./example

...it says no debugging symbols found. Can anyone help me understand this? It is my first time attempting to use GDB and am very new to C programming in general. Thank you.

I tried to add the -g and -Wextra flags but this did not work.



Solution 1:[1]

Running make clean and then re running make and loading it into gdb worked.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ZackRyan