LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware- GTK 3 with GTKMM 3 and cairo - some problems! (https://www.linuxquestions.org/questions/slackware-14/slackware-gtk-3-with-gtkmm-3-and-cairo-some-problems-4175460339/)

PeterUK 05-01-2013 03:34 PM

Slackware- GTK 3 with GTKMM 3 and cairo - some problems!
 
Hi!

I have done some tutorial with not problem with gtkmm 2.4

But today I am trying to do the tutorial here

I have created the 3 files as their give code here:

I have in the systems:
glibmm-2.32.1-i486-1_SBo
gtkmm-2.24.2-i486-1_SBo
gtkmm-utils-0.4.1-i486-1_SBo
gtkmm3-3.4.1-i486-1_SBo

I compile it by typing:

g++ -Wall -o GTK_test main.cc `pkg-config --cflags gtkmm-3.0 --libs gtkmm-3.0`

I get:

Code:

/tmp/ccOapu9M.o: In function `main':
main.cc:(.text+0xa4): undefined reference to `MyArea::MyArea()'
main.cc:(.text+0xe8): undefined reference to `MyArea::~MyArea()'
main.cc:(.text+0x140): undefined reference to `MyArea::~MyArea()'
collect2: error: ld returned 1 exit status
make: *** [test] Error 1


What is it wrong?

speccy 05-05-2013 05:14 AM

You would need to list all the source files on the command line.

e.g.

Code:

g++ -Wall -o GTK_test main.cc myarea.cc `pkg-config --cflags gtkmm-3.0 --libs gtkmm-3.0`

PeterUK 05-05-2013 10:48 PM

Quote:

Originally Posted by speccy (Post 4945231)
You would need to list all the source files on the command line.

e.g.

Code:

g++ -Wall -o GTK_test main.cc myarea.cc `pkg-config --cflags gtkmm-3.0 --libs gtkmm-3.0`

Thanks Speccy! This works!

Why gcc would not work? it gives this error:

Code:

/usr/lib/gcc/i486-slackware-linux/4.7.1/../../../../i486-slackware-linux/bin/ld: /tmp/ccz7YdYR.o: undefined reference to symbol '_ZdlPv@@GLIBCXX_3.4'
/usr/lib/gcc/i486-slackware-linux/4.7.1/../../../../i486-slackware-linux/bin/ld: note: '_ZdlPv@@GLIBCXX_3.4' is defined in DSO /usr/lib/libstdc++.so.6 so try adding it to the linker command line
/usr/lib/libstdc++.so.6: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make: *** [test] Error 1


fsauer 05-06-2013 10:00 AM

Quote:

Originally Posted by PeterUK (Post 4945709)
Thanks Speccy! This works!

Why gcc would not work? ...

Because gcc compiles/links C-Files. And your .cc files are C++...

Good luck!
Franz


All times are GMT -5. The time now is 08:59 AM.