I am trying to compile the program from this page:
I use this makefile:
all: main
main: helloworld.h helloworld.cc main.cc
g++ main.cc -o main `pkg-config gtkmm-2.4 --cflags --libs`
But when I compile I get:
/tmp/ccPWqvDE.o: In function `main':
main.cc:(.text+ 0x37): undefined reference to `HelloWorld::He lloWorld()'
main.cc:(.text+ 0x54): undefined reference to `HelloWorld::~H elloWorld()'
main.cc:(.text+ 0x67): undefined reference to `HelloWorld::~H elloWorld()'
collect2: ld returned 1 exit status
make: *** [main] Error 1
But I don't understand why since the constructors are specified.
I use this makefile:
all: main
main: helloworld.h helloworld.cc main.cc
g++ main.cc -o main `pkg-config gtkmm-2.4 --cflags --libs`
But when I compile I get:
/tmp/ccPWqvDE.o: In function `main':
main.cc:(.text+ 0x37): undefined reference to `HelloWorld::He lloWorld()'
main.cc:(.text+ 0x54): undefined reference to `HelloWorld::~H elloWorld()'
main.cc:(.text+ 0x67): undefined reference to `HelloWorld::~H elloWorld()'
collect2: ld returned 1 exit status
make: *** [main] Error 1
But I don't understand why since the constructors are specified.
Comment