Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
So I learned how to do command prompt level programming at school and stuff, but how can I start learning how to make programs you can actually use by clicking buttons and things like that?
Also, I'm running the latest version of Ubuntu on my laptop. What do I need to install and set up to be able to compile and run programs and all that good stuff? I've just been using the Sun machines at my school up to this point and they have everything set up on there already. I just type 'make' and it does everything for me.
Well, the good news is that "make" (GNU make) is probably already installed on your system.
However, I don't know what libraries your code uses. So you need to be sure to have the Linux versions of
the libs your Sun programs are using.
Compiling c++ code is done via gcc (or g++). See it's man page for details. It's often called the GNU C/C++ compiler (it compiles C and C++ code). You can use other compilers too, but I'd suggest you start off with the GNU compiler first. What compiler does the sun machine use?
To know this, open a makefile and check out the command it runs to compile your code, probably "cc" or something. Then open the man page for that command or do
Code:
whereis command
to find out where the compiler program is located.
Or you could just go ahead, copy the code and the makefile and try to compile it on your Linux box. If you get any errors, post them and we'll tell you what's going wrong.
To do GUI coding, you probably want a GUI library, such as GTK (www.gtk.org). Take a look at Glade (glade.gnome.org) also. I'm also interested in learning about writing GUIs.
If you want to user C++, check out gtkmm which is a C++ wrapper for the GTK+ libraries. You may also want to check out QT for C++ GUI programming. GTK+ is implemented by Gnome, and QT by KDE, but they both can run on either and they both can be "ported" to Windows. Obviously, I'm a bigger fan of GTK+.
Perhaps so... but if you want to write what feels like, looks like, and works like "enter programming language here" you can do it in GTK if you so desire. I however prefer C... so GTK is happiest with me.
I think the real decision to make is what do you want to program... QT applications or GTK+ applications, and then choose a language that suits your needs. But that's just the way I role. I like to use the language "most native" to what I'm doing which I why I'm using C with GTK+ in the first place. If I were to write a QT application I'd certainly do it in C++.
C and C++ are not so distant that one cannot be learned from the other--especially considering GTK where many of the abstract concepts are OOP concepts.
Perhaps so... but if you want to write what feels like, looks like, and works like "enter programming language here" you can do it in GTK if you so desire.
If I were to write a QT application I'd certainly do it in C++.
you can't use c++ with gtk+ unless you use the gtk-- bindings
you can't use any other language with gtk+ other than c unless you use bindings.
it will never ever feel like, look like, or work like c++ or any other language unless you use bindings for that other language.
you can only use c++ with Qt unless you use bindings.
c is a subset of c+ but certainly not the other way around.
so when you are writing in c using gtk+ you cannot in any way use anything asociated with c++
OO concepts in GTK+ are done thrugh messy emulation and not implemented at the language level.
Last edited by foo_bar_foo; 03-11-2006 at 05:17 PM.
Right, and agian, I'm not the expert, but while using those language bindings, doesn't it "feel" like C++ to the programmer? That's the impression I got using gtkmm...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.