LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 05-01-2013, 03:34 PM   #1
PeterUK
Member
 
Registered: May 2009
Posts: 277

Rep: Reputation: 16
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?
 
Old 05-05-2013, 05:14 AM   #2
speccy
Member
 
Registered: Dec 2008
Location: Portsmouth, UK
Distribution: slackware
Posts: 39

Rep: Reputation: 31
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`
 
1 members found this post helpful.
Old 05-05-2013, 10:48 PM   #3
PeterUK
Member
 
Registered: May 2009
Posts: 277

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by speccy View Post
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
 
Old 05-06-2013, 10:00 AM   #4
fsauer
Member
 
Registered: Jul 2012
Posts: 38

Rep: Reputation: Disabled
Quote:
Originally Posted by PeterUK View Post
Thanks Speccy! This works!

Why gcc would not work? ...
Because gcc compiles/links C-Files. And your .cc files are C++...

Good luck!
Franz
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C - Gtk + timer + sockets + cairo Dr_Lion Programming 1 02-29-2012 06:19 PM
Choosing Gtkmm or Gtk# under ubuntu Puneet Jindal Linux - Newbie 3 01-03-2011 07:36 AM
gnome + gtk + cairo keratos Ubuntu 0 05-18-2007 10:40 AM
gtk+2.8 and cairo John Velman Slackware 3 10-19-2005 04:16 PM
GTKmm or GTK+ ??? fei Programming 2 08-29-2005 12:56 AM


All times are GMT -5. The time now is 01:36 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration