Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 17th, 2007, 1:42 AM   #1
melbolt
Hobbyist Programmer
 
melbolt's Avatar
 
Join Date: Feb 2005
Location: PA, USA
Posts: 242
Rep Power: 4 melbolt is on a distinguished road
Send a message via AIM to melbolt Send a message via Yahoo to melbolt
gtk header problem

Hi guys, I am new to programming on linux, and I am having problems getting my first attempt at an app to compile. although I already have the lib-gtk2.0 library installed I keep getting this error when trying to compile my main.c file.

Here is the error I'm receiving...
"main.c:10:21: error: gtk/gtk.h: No such file or directory"

And here is what I have in my main...

c Syntax (Toggle Plain Text)
  1. #ifdef HAVE_CONFIG_H
  2. # include <config.h>
  3. #endif
  4.  
  5. #include <gtk/gtk.h>
  6.  
  7. #include "interface.h"
  8. #include "support.h"
  9.  
  10. int
  11. main (int argc, char *argv[])
  12. {
  13. GtkWidget *BuddySelector;
  14.  
  15. #ifdef ENABLE_NLS
  16. bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
  17. bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
  18. textdomain (GETTEXT_PACKAGE);
  19. #endif
  20.  
  21. gtk_set_locale ();
  22. gtk_init (&argc, &argv);
  23.  
  24. add_pixmap_directory (PACKAGE_DATA_DIR "/" PACKAGE "/pixmaps");
  25.  
  26. BuddySelector = create_BuddySelector ();
  27. gtk_widget_show (BuddySelector);
  28.  
  29. gtk_main ();
  30. return 0;
  31. }

This of course is all generated by Glade so I'm assuming I am just missing some package or something?

thanks for taking a look at this for me.

btw: in case someone was curious, I'm working on a pidgin plugin, there was this plug-in called sendtosome in gaim that i really loved but it doesn't exist in pidgin so I decided to make it myself.
__________________
I have never let my schooling interfere with my education. -Mark Twain-

Xbox live gamertag: melbolt
melbolt is offline   Reply With Quote
Old Aug 17th, 2007, 9:23 AM   #2
niteice
Programmer
 
niteice's Avatar
 
Join Date: Aug 2005
Posts: 98
Rep Power: 4 niteice is on a distinguished road
Send a message via AIM to niteice
What's your compilation command line?
niteice is offline   Reply With Quote
Old Aug 17th, 2007, 9:30 AM   #3
melbolt
Hobbyist Programmer
 
melbolt's Avatar
 
Join Date: Feb 2005
Location: PA, USA
Posts: 242
Rep Power: 4 melbolt is on a distinguished road
Send a message via AIM to melbolt Send a message via Yahoo to melbolt
If I recall correctly, I tried using both "gcc main.c" and "make main" and received the same error on both.
__________________
I have never let my schooling interfere with my education. -Mark Twain-

Xbox live gamertag: melbolt
melbolt is offline   Reply With Quote
Old Aug 17th, 2007, 5:57 PM   #4
niteice
Programmer
 
niteice's Avatar
 
Join Date: Aug 2005
Posts: 98
Rep Power: 4 niteice is on a distinguished road
Send a message via AIM to niteice
you need to use pkg-config for gcc to find the headers:
gcc `pkg-config --cflags gtk+-2.0` `pkg-config --libs gtk+-2.0` main.c -o main
First pkg-config invocation gets the required compiler flags to find includes and whatnot, second tells it where to find the libraries to link against and which ones to use. the `` tells the shell to insert the output of the command inside at that location.
niteice is offline   Reply With Quote
Old Aug 18th, 2007, 4:22 AM   #5
melbolt
Hobbyist Programmer
 
melbolt's Avatar
 
Join Date: Feb 2005
Location: PA, USA
Posts: 242
Rep Power: 4 melbolt is on a distinguished road
Send a message via AIM to melbolt Send a message via Yahoo to melbolt
ah ok, I get what you're saying, using what you gave me and a bit more research, I managed to get it past the includes. There were other errors I received later but then I found a tutorial on glade and how you are supposed to run the autogen.sh executable file and then you are able to use a "make" command and it successfully spits out an executable file which will then launch the program created in the glade designer.

This works all well and good, I have my form with controls on it and callbacks handling what I need, the app runs great.

Here is my dilemma that maybe someone here can help me with...

I don't want what I created in glade to be built into an executable, I need it to be built into a .so file. The reason why is because, as I mentioned in a previous post, this is going to be a plug-in for the pidgin messenger client and in order to use it as a plug-in it must be built into a .so not an executable.

I know I could go the long way and not use glade to do all the form coding for me, but I'd rather not if I can avoid it, does anyone know a way to do this?


thanks a lot for the help.
__________________
I have never let my schooling interfere with my education. -Mark Twain-

Xbox live gamertag: melbolt
melbolt is offline   Reply With Quote
Old Aug 18th, 2007, 1:09 PM   #6
melbolt
Hobbyist Programmer
 
melbolt's Avatar
 
Join Date: Feb 2005
Location: PA, USA
Posts: 242
Rep Power: 4 melbolt is on a distinguished road
Send a message via AIM to melbolt Send a message via Yahoo to melbolt
sorry, to be more specific and to the point, I want glade to output a dynamic library or shared library. any idea how to do that?
__________________
I have never let my schooling interfere with my education. -Mark Twain-

Xbox live gamertag: melbolt
melbolt is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem processing file into a char array csrocker101 C++ 1 May 8th, 2007 11:50 PM
cgi/perl script + IE problem joyceshee Perl 2 Jan 24th, 2006 11:10 AM
send() problem w/ http server kch_86 C 2 Nov 25th, 2005 12:53 AM
question about header files and prototyping functions linuxpimp20 C 13 Sep 7th, 2005 8:28 AM
TCP Header for Echo Communication AusTex C++ 0 Feb 27th, 2005 3:57 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:51 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC