LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   gtk with c++ (https://www.linuxquestions.org/questions/programming-9/gtk-with-c-193540/)

tutwabee 06-14-2004 06:56 PM

gtk with c++
 
I am currently learning C++ and use g++ to compile my scripts. I have heard of gtkmm and gtk-- which to my understanding allow you to use GTK to make GUIs with C++. I couldn't get gtkmm's many packages to configure correctly and I couldn't figure out where to copy the gtk-- files/directories to so that they work when called.

What I want is a simple way for me to import H files that will allow me to create a GUI in my C++ programs.

johnMG 06-15-2004 03:19 PM

gtk-- is the old name for gtkmm. It's just gtkmm now.

What you've hit on is, IMO, the main problem with gtkmm -- getting all the dependencies installed and configured correctly.

If you're using debian or a debian-based distro, I guess you can just apt-get it. Otherwise, good luck.

By the way, you could always use Java instead of C++ and try Java-GNOME
http://java-gnome.sourceforge.net/

needforspeed 06-15-2004 05:06 PM

I'm having a similar problem...I don't mean to hijack this thread but it's closely related I think. I downloaded gtk+-2.4.3 and did ./configure trying to follow along with the tutorial at http://www.gtk.org/tutorial/ch-gettingstarted.html but when compiling that simple program it said the gtk.h file didn't exist. I found where it installed the files and simply changed the original #include statement to #include<gtk-2.0/gtk/gtk.h>

Now when I compile, pages and pages of errors fly by, from what I can tell, every gtk*.h file has an error like "field 'scale' has incomplete type" and several syntax errors.

So I searched this site and the ./configure --help and tried doing ./configure -prefix=/usr/include/

I then changed the #include to the original statement, and still get all those errors.

I've been searching for several hours for the answer and haven't found one, so can anybody tell me how to get this working?

Using Gentoo with 2.6 kernel and fluxbox, tried reemerging gtk but that didn't help either.

zeppelin 06-15-2004 05:21 PM

GTKmm is so great..
but there are others you can try [not JAVA!!]
thereis PyGTK and Gnome-python in general,
there is GTK# which I would propose to you instead of JAVA.
both have patent issues and are not so free, there is of course DotGNU that is working in the right direction, but still you'll find a lot of M$ in it

johnMG 06-15-2004 06:53 PM

there is GTK# which I would propose to you instead of JAVA.
both have patent issues


I don't think there are patent issues with using Java, but I'm not absolutely certain. Note that both GCJ (GCC) [the Java compiler] and Classpath [the Java standard API implementation] are both official GNU projects. If it's good enough for the FSF, it's good enough for me. :)

I used to mess with C++, but Java is so much nicer... it spoils you rotten. It's like C++ done mostly right. :)

tutwabee 06-16-2004 01:27 AM

Thank you so much for the answers. I'm thinking about trying Debian soon actually because I have heard good things about apt-get. I will look into the other alternatives also. I hope at least one of them has support for a Windows compiler that accomplishes the same thing because I would like to make cross-platform programs (for all my sad little Windows buddies). I believe that even though Windows may be made by M$ and many think it is evil that it should still be supported. This probably came along my web designing all-browser belief.

Thanks for the replies!


All times are GMT -5. The time now is 03:25 PM.