ProgrammingThis 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.
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.
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.
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.
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.....
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).
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.....
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.
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).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.