LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 03-10-2006, 09:19 AM   #1
cumptrnrd
LQ Newbie
 
Registered: Mar 2006
Posts: 5

Rep: Reputation: 0
C++ GUI Programming


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.
 
Old 03-10-2006, 10:13 AM   #2
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
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.
 
Old 03-10-2006, 10:18 AM   #3
celejar
Member
 
Registered: Oct 2003
Location: New York
Distribution: Debian Sid
Posts: 185

Rep: Reputation: 30
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.
 
Old 03-10-2006, 11:54 AM   #4
MicahCarrick
Member
 
Registered: Jul 2004
Distribution: Fedora
Posts: 241

Rep: Reputation: 31
If you are looking to get started with GTK+/Glade gui programming with C, I have a couple tutorials here: http://www.micahcarrick.com/v2/content/section/1/20/

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+.

Good luck,
Micah
 
Old 03-10-2006, 12:25 PM   #5
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You can still use GTK+ with C++, but without gtkmm. That's how I've been using GTK+ .
 
Old 03-10-2006, 10:45 PM   #6
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
ok - i don't want to start a flame war but if you want to use c++ you have to use Qt/KDE. you cannot write true object oriented programms using GTK.
 
Old 03-11-2006, 12:53 AM   #7
MicahCarrick
Member
 
Registered: Jul 2004
Distribution: Fedora
Posts: 241

Rep: Reputation: 31
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.

I am by NO MEANS an expert on the subject.
 
Old 03-11-2006, 05:03 PM   #8
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
Quote:
Originally Posted by MicahCarrick
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.
 
Old 03-11-2006, 05:10 PM   #9
MicahCarrick
Member
 
Registered: Jul 2004
Distribution: Fedora
Posts: 241

Rep: Reputation: 31
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...
 
Old 03-11-2006, 09:20 PM   #10
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
yes it is c++ sorry i got you confused with NYLEX , i should pay more attention
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
GUI programming with C/C++ mala fide Programming 3 01-26-2005 10:16 AM
gui programming help Jurgen Programming 3 11-01-2004 08:38 PM
GUI programming? cucolin@ Slackware 1 02-17-2004 06:13 PM
GUI Programming Katrix Programming 5 07-20-2001 03:39 PM
C++ GUI programming oulevon Programming 8 05-14-2001 01:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:22 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