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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
09-10-2004, 08:22 PM
|
#1
|
LQ Newbie
Registered: Nov 2003
Distribution: RedHat
Posts: 11
Rep:
|
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
|
|
|
09-11-2004, 08:38 AM
|
#3
|
LQ Newbie
Registered: Nov 2003
Distribution: RedHat
Posts: 11
Original Poster
Rep:
|
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
|
|
|
09-11-2004, 11:35 PM
|
#4
|
Member
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475
Rep:
|
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????
|
|
|
09-13-2004, 07:29 PM
|
#5
|
LQ Newbie
Registered: Nov 2003
Distribution: RedHat
Posts: 11
Original Poster
Rep:
|
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
|
|
|
09-14-2004, 04:15 AM
|
#6
|
Member
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475
Rep:
|
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.....
|
|
|
09-14-2004, 07:03 AM
|
#7
|
LQ Guru
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194
Rep:
|
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).
|
|
|
09-14-2004, 08:59 AM
|
#8
|
Member
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475
Rep:
|
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.....
|
|
|
09-14-2004, 08:20 PM
|
#9
|
Member
Registered: Jul 2003
Location: CT, USA
Distribution: Debian Sarge (server), Etch (work/home)
Posts: 601
Rep:
|
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. 
|
|
|
09-15-2004, 07:49 AM
|
#10
|
LQ Newbie
Registered: Nov 2003
Distribution: RedHat
Posts: 11
Original Poster
Rep:
|
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
|
|
|
09-22-2004, 08:32 AM
|
#11
|
Member
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 01:42 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|