LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-10-2004, 08:22 PM   #1
gtkmike
LQ Newbie
 
Registered: Nov 2003
Distribution: RedHat
Posts: 11

Rep: Reputation: 0
GTKmm Help


Hello,

I have gtkmm up and running...somewhat...I guess. I can create an interface in Glade, save the C++ source, edit the source and compile it with the created make files.

What I am trying to do is create the .xml file with Glade, then use it in a c++ application. When I compile on the command line, none of the headers are found/recognized/etc. I get errors saying libgladdmm - no such file, gtk, glib, etc all not found.

They are loaded on the machine and they compile fine with the make file generated by glade, but I dont want to use that....I want my own.

Any ideas on how to remedy this is greatly appreciated.

OH, I am using Mandrake 10.0

Thanks,
Mike
 
Old 09-11-2004, 03:17 AM   #2
melinda_sayang
Member
 
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Rep: Reputation: 31
I understand. You need to install libglademm package.
http://ftp.gnome.org/pub/GNOME/sources/libglademm/2.4/
 
Old 09-11-2004, 08:38 AM   #3
gtkmike
LQ Newbie
 
Registered: Nov 2003
Distribution: RedHat
Posts: 11

Original Poster
Rep: Reputation: 0
OK, I went and downloaded libglademm. When I attempted to install it, I get the following message from 'configure':

configure: error: Library requirements (gtkmm-2.4 >= 2.4.0 libglade-2.0 >= 2.3.6) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.

gtkmm and libglade are installed.....how else would glade be able to generate the C++ code and how would the makefile generated by glade work properly?

I just want to get things running so I can generate the UI with glade, then create my own sources with emacs, and use the .glade xml file to instantiate the UI.

Seems like I need to edit some pathways.....but I am not quite sure which ones or how.

Again, any and all assistance is extremely appreciated.

Mike
 
Old 09-11-2004, 11:35 PM   #4
melinda_sayang
Member
 
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Rep: Reputation: 31
You said that U used Mandrake 10. Mandrake 10 use GTK+-2.2. So download libglademm-2.2 not libglademm-2.4. Ok, got it????
 
Old 09-13-2004, 07:29 PM   #5
gtkmike
LQ Newbie
 
Registered: Nov 2003
Distribution: RedHat
Posts: 11

Original Poster
Rep: Reputation: 0
Got it!......but it did not change a thing!

Oh well, thanks for the effort....
Maybe I will check out QT....or just stay with C

Mike
 
Old 09-14-2004, 04:15 AM   #6
melinda_sayang
Member
 
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Rep: Reputation: 31
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig":"${PKG_CONFIG_PATH}"
Put that line in your .bashrc file.... Look that you install gtkmm files in /usr/local prefix.... Next time use /usr prefix.....
 
Old 09-14-2004, 07:03 AM   #7
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 47
The xml file is just for saving. Glade will use it to generate the source code. There are certain files you can edit, like callbacks.c and main.c (for c code). You can tell which ones you can edit and which ones you can't because you will see soething like this:

This file is automatically generated by Glade. Do not edit.

The files that don't have this can be edited.
To do things, you would edit the properties of a button in Glade and tell it to execute a certain function when the button is clicked. Using C, an empty function would appear in callbacks.c, and the code in that function will be executed whenever the button is clicked (not sure exactly what happens with glademm, but I'm sure it's quite similar).

To compile the stuff yourself manually, you have to use the right options with g++. For example:
g++ -c file.cpp -I /usr/include/gtk -o file.o
The directory is different on many systems, and there is a program called pkg-config to automatically find out which include directories and options to use:
gcc -Wall -g helloworld.c -o helloworld `pkg-config --cflags gtk+-2.0` \
`pkg-config --libs gtk+-2.0`
The above would automatically give all the options needed for using gtk+ 2. You will need to make sure you get all the options fro each library you use (like gktmm for example).
 
Old 09-14-2004, 08:59 AM   #8
melinda_sayang
Member
 
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Rep: Reputation: 31
aaa, I think he don't want to do that way. He want to use libglademm library that can load up the GUI automatically not using generated code by Glade.....
 
Old 09-14-2004, 08:20 PM   #9
johnMG
Member
 
Registered: Jul 2003
Location: CT, USA
Distribution: Debian Sarge (server), Etch (work/home)
Posts: 601

Rep: Reputation: 32
gtkmike, if you're not married to the idea of having to use glade, you might have a look at toad ( http://www.mark13.org/toad/index.html ) -- all the C++ goodness, half the calories.
 
Old 09-15-2004, 07:49 AM   #10
gtkmike
LQ Newbie
 
Registered: Nov 2003
Distribution: RedHat
Posts: 11

Original Poster
Rep: Reputation: 0
OK, the saga continues,

melinda_sayang...the export line in bashrc seems to have done some good...
everything is loaded now. And yes, I do want to use the XML file produced by glade to load the GUI. The only problem now seems to be that libglademm (as an include) is not found.

For example, the example I am following (from libglademm package) says to include the following:

#include <libglademm/xml.h>

however, the compiler reports that that file or folder does not exist. I have placed a path to it in the ld.so.config file. But seems to not have done any good.

So if I can get it to find the header file, things will be good.


johnMG....I will check out toad. I just want a C++ environment with a widget set that can be used on different platforms (like gtk) without have to spend a great deal (like with QT on Windows).

Thanks to all,
Mike
 
Old 09-22-2004, 08:32 AM   #11
melinda_sayang
Member
 
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Rep: Reputation: 31
how do you compile the program? Can you give me the output from this command:
$ pkg-config libglademm-2.4 --cflags --libs



Last edited by melinda_sayang; 09-22-2004 at 08:34 AM.
 
  


Reply



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
GTKmm or GTK+ ??? fei Programming 2 08-29-2005 12:56 AM
gtkmm help paulr1984 Linux - Software 1 03-28-2005 02:40 AM
which powerful QT or GTKMM? Barq Linux - General 1 03-13-2005 11:39 AM
gtkmm HOW? Barq Programming 1 08-29-2004 07:43 AM
gtkmm-config .. where is it? v2-ncl Linux - Software 1 11-10-2003 09:04 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:53 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
Open Source Consulting | Domain Registration