LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-29-2003, 10:39 PM   #1
The Yeti Lives
LQ Newbie
 
Registered: May 2003
Posts: 13

Rep: Reputation: 0
:undefined reference to 'gtk_main'


Just wondering if someone could help me with a problem I have been stuck with for a while...
Used Glade, wrote source code, then had to write
g++ main.cpp -I/usr/include/gtk-1.2/ -I/usr/include/glib-1.2/ -I/usr/lib/glib/inlude
to get g++ to see all include files I needed.
Problem is, although g++ seems to see these files, it doesn't seem to read what is in them, so I get the following types of errors...
/tmp/ccQkejiA.o(.text+0xbc): in function 'main':
:undefined reference to 'gtk_main'

Any help would be appreciated.

- The Yeti Lives
 
Old 05-30-2003, 03:03 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975
well that's not linking to the gtk library. you need to specify both Include paths and external libraries. add "-lgtk" to it.
 
  


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
Undefined reference, why? george_mercury Programming 4 05-07-2009 12:15 AM
Undefined Reference ChemicalBurn Programming 2 02-14-2005 03:01 AM
undefined reference mp4-10 Programming 3 01-25-2005 12:38 PM
undefined reference to 'gdbm_open' Castro Linux - Newbie 1 06-11-2003 03:13 PM
Yet another 'undefined reference' problem faulpelz2 Linux - Software 3 04-04-2003 11:18 AM


All times are GMT -5. The time now is 02:32 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration