evster
January 12th, 2007, 10:17 AM
Hello,
I am starting a new project and I am starting with two files, pretty much as simple as I can get it. One (main.cpp) contains the mainline, the other (MainWindow.cpp) will contain the main window as it might suggest. Right now the MainWindow is just an empty class with a constructor and a destructor and my main line just constructs a MainWindow and doesn't do anything with it. My Makefile is pretty simple so I don't think there is anything wrong with it.
CC=gcc
CFLAGS=
OBJ=main.o MainWindow.o
main: $(OBJ)
$(CC) -o main $(OBJ)
main.o: MainWindow.h
gcc -c main.cpp
MainWindow.o: MainWindow.h
gcc -c MainWindow.cpp
clean:
rm -f main $(OBJ)
Anyway, when I try to build it it compiles the files fine but then I get this error:
gcc -c main.cpp
gcc -c MainWindow.cpp
gcc -o main main.o MainWindow.o
main.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
make: *** [main] Error 1
Any ideas?
I am starting a new project and I am starting with two files, pretty much as simple as I can get it. One (main.cpp) contains the mainline, the other (MainWindow.cpp) will contain the main window as it might suggest. Right now the MainWindow is just an empty class with a constructor and a destructor and my main line just constructs a MainWindow and doesn't do anything with it. My Makefile is pretty simple so I don't think there is anything wrong with it.
CC=gcc
CFLAGS=
OBJ=main.o MainWindow.o
main: $(OBJ)
$(CC) -o main $(OBJ)
main.o: MainWindow.h
gcc -c main.cpp
MainWindow.o: MainWindow.h
gcc -c MainWindow.cpp
clean:
rm -f main $(OBJ)
Anyway, when I try to build it it compiles the files fine but then I get this error:
gcc -c main.cpp
gcc -c MainWindow.cpp
gcc -o main main.o MainWindow.o
main.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
make: *** [main] Error 1
Any ideas?