LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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


Reply
  Search this Thread
Old 02-07-2007, 03:37 AM   #16
carcassonne
Member
 
Registered: Jul 2005
Distribution: Fedora6 x86_64
Posts: 118

Rep: Reputation: 15

Quote:
Originally Posted by PatrickNew
I think I interpreted his question differently, or perhaps I misunderstood it, but I kinda thought he was asking why we don't have IDE's with integrated GUI designers. I haven't written Visual* in a couple years, but from what I recall, writing a GUI was so easy, you didn't realize it wasn't a part of standard C/C++/BASIC/whatever.

I suppose, if that is what you meant, my answer would be that Linux doesn't have any one graphics toolkit. I suppose you could say XLib, but no one *wants* to code in XLib. However, check Anjuta, which sorta has one - it calls glade externally.
If Linux does not have a graphics toolkit, then what are the free Qt and Qt Designer with which the whole friggin' KDE is built ?

And then I could go on: What is FLTK ? What is wxWidgets ? What is GTK ?

'Xlib' was nice in 1986 or so, but now we're more like, in 2007.

Cheers.
 
Old 02-07-2007, 04:03 AM   #17
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Quote:
Originally Posted by fc6_user
P.S. - I was also told that it's possible to have a look at source code in Linux. I wouldn't mind actually having a look at the OS source code. How do you do this? Where is it? That would be so cool! (the kernel, or any other program source codes in C++)
Sure. You can browse through the kernel sources online or download any released version of the sources as a single (gzipped tar) file.

The Linux kernel is not written in C++ though, but in plain C.
 
Old 02-07-2007, 07:35 AM   #18
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
Oh, I meant that we didn't have one unified toolkit. Like - windows has win32, and that's pretty dominant. On Linux however, qt is not dominant over gtk, and there are many third choices. I didn't mean we didn't have toolkits, but rather that we didn't have just *one*.
 
Old 02-07-2007, 03:27 PM   #19
fc6_user
Member
 
Registered: Jan 2007
Location: Montpellier, France
Distribution: Fedora Core 6, Mandriva, Knoppix, Debian
Posts: 143

Original Poster
Rep: Reputation: 15
Thank you graemef! I was finally able to actually compile and run my Hello World program, something I couldn't figure out for weeks. Your instructions were crystal clear. Many thanks.

However, with Dev C++ (Bloodshed), I was able to write, compile/debug and run several programs quickly one after the other (with tabs...) with hardly any hassle whatsoever: Ctrl+N (write program) Ctrl+S F9, ... Ctrl+N - write program - Ctrl+S - F9 ... and so on and so forth. I could write completely different types of programs and only two or three files would be added to my folder. In KDevelop, I can't figure out how to write a second program, and I don't understand why you have to start with a template. I don't really understand why there so many files and folders are created either and I didn't get that bit at the end of your message about adding files. I tried it, but in the end couldn't figure out what happened. Did you mean File -> New? Or something else?

In any case, I've transferred all of my little C++ experiments onto my Linux platform, and I'm optimistic. I've also downloaded and tried using Anjuta but can't seem to get that working yet (the manual (help) isn't available). Ditto with Eclipse.

I'll keep trying though. Thanks for the info!
 
Old 02-07-2007, 06:08 PM   #20
carcassonne
Member
 
Registered: Jul 2005
Distribution: Fedora6 x86_64
Posts: 118

Rep: Reputation: 15
Quote:
Originally Posted by PatrickNew
Oh, I meant that we didn't have one unified toolkit. Like - windows has win32, and that's pretty dominant. On Linux however, qt is not dominant over gtk, and there are many third choices. I didn't mean we didn't have toolkits, but rather that we didn't have just *one*.
That's quite OK like this, I find. If there were only but one toolkit, then as in any kind of monopoly, we'd be limited by what these guys and only guys would decide to include in their one-and-only toolkit. Unlike Windows, at lot of Linux distros are shipping with several toolkits installed, so it's not a fuss to get an app that uses GTK+ one day and anopther app using Qt the other day. On Windows, the user would have to install Qt to get Qt apps going. This is not the case with many Linux distros.

For the developer it means choice. Unless a less-knwon or obscure toolkit is chosen, the developer can choose which toolkit he's she's more comfortable with or answers most to the apps' need. And if a less-known toolkit is used, many installation and upgrade systems (yum for instance) will take care of installing, say, FLTK automatically so that an app could run.

I only find great things with having many toolkits in such a context. What would be the drawbacks ?
 
Old 02-07-2007, 06:55 PM   #21
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
Quote:
Originally Posted by carcassonne
I only find great things with having many toolkits in such a context. What would be the drawbacks ?
I quite agree, I just meant to explain that such is the reason why most GNU/Linux IDE's don't have built-in graphics, because building them all in would be wasteful, if even possible, and just including one would rob us of our choices.
 
Old 02-07-2007, 10:23 PM   #22
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Quote:
Originally Posted by fc6_user
Did you mean File -> New?
Yes that was what I meant. in this case you will be building a project that consists of more than one file. I gather from your comments that your exercises require just a single source code. In which case just create a new project.

Why does KDevelop create so many files? It really comes down to the fact that it is designed for big projects (although as you see small projects can be created). With a big project there may be hundreds or even thousands of files. These files can be organised by the project manager within KDevelop, but some of these files that you see are used by KDevelop to manage the files. There is a collection of files to help you build and install the program without having KDevelop, this is important when you distribute your program, because there is no guarantee that the people who take your program will have KDevelop.

Where is your source code?

the source code lives in the src folder src/hello.cpp

Where is the compiled program?

KDevelop (and linux) considers two cases of program, the program with just the instructions called release and the program with the instructions and debugging information called debug. By default KDevelop builds the debug version. This means that you can step through the code from within KDevelop using the F9, and adding breakpoints throughout the code similar to your experiences with Dev C++. The debug code is in the debug/src folder and the release version is in the src folder.

debug/src/hello
src/hello

To select the release version go to Project menu, Build Configuration and select default. The next time that you build the project the release version will be built.
 
Old 02-07-2007, 10:53 PM   #23
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Quote:
Originally Posted by PatrickNew
I quite agree, I just meant to explain that such is the reason why most GNU/Linux IDE's don't have built-in graphics, because building them all in would be wasteful, if even possible, and just including one would rob us of our choices.
Whilst this appears a bit off topic I feel compelled to comment because I strongly disagree with the statement.

Maybe this is just personal but I feel that the difference is more of a philosophical one.

Linux is an OS that champions the idea that (to borrow a well used phrase) small is beautiful. Build a small useful tool and someone else will build on it. I use Fedora and over time they have been taking good tools and adding GUI front ends to them. This is an example of adding to a solid tool, rather than reinventing the wheel.

Windows the classic monolithic OS. The desktop is so integrated with the OS that MS say that it is impossible for them to separate the two without breaking the code.

Now as I see it the development environments that come from Linux focus on encouraging you to develop useful tools, there is no distractions. The development environments that come from Windows focus on the eye candy and distract you from the important core.

The mentality is different (and I have observed it) a programmer brought up with a Linux view first thinks about the function, a programmer brought up with the Windows view (or more accurately the Visual development approach) first thinks about how it will look.

Both are important, just listen to any one who uses a Mac gushing lyrical about their OS. The Linux development environments are adopting GUI tools to make it easier for developers to add GUI front ends, but are the visual development environments strengthening their focus on developing a sound core? I don't know since I have long since left that arena, I hope so because I see it as vital to the development of the next generation of programmers.

The above is my personal view and you're more than welcome to disagree with it, but to get back to the statement "IDE's don't have built-in graphics, because building them all in would be wasteful" I disagree with this because Linux is made up of small tools, so as the IDEs develop in this direction they will be able to integrate the different visual development tools because the tools are small independent tools. So, for example, an IDE can take glade and fairly easily integrate into its environment via a plugin, via another plugin it can take QT designer and allow it to be integrated. So the IDE developer doesn't need to create the visual tools just a means of plugging it into their system. This idea was the whole reason that QT removed the integrated editor from their visual designer tool, so that IDE's could integrate it into their environment. So the effort required is not huge, it just depends on whether the IDE developers see a compelling reason to work on the plugins.
 
Old 02-07-2007, 11:23 PM   #24
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
I would still defend the point that building them *all* into one IDE would be wasteful. I'm an amateur programmer, and I do almost all of my GUI's in gtk and a little FLTK. Having Qt and WxWidgets built in would be wasteful. Perhaps it's different with KDevelop, I'm a GNOME and Flux user, but the integration I've seen is Anjuta externally calling Glade and pointing it at the same project files. I wouldn't call that integration the same as the integration found in VisualBASIC.

Linux (well, *nix in general) does embrace the divide and conquer philosophy, and I do think that gives us an advantage. However, I wouldn't call stringing different apps together "integrating them." I don't know - I think I'm just arguing semantics - but I suppose I should at least revise to say that we have nothing so tightly or cleanly integrated as Visual*.
 
Old 02-08-2007, 12:27 AM   #25
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Sure I agree the sentiment that Linxu tools do not reach the level of integration found in the visual tools on the windows platform (Delphi, VB .net etc) with probably the exception of monodevelop. But tight integration can be a curse as well as a boon. I don't know what the situation will be for developers who wish to develop for Vista, but the situation used to be if you want to develop for the latest then you have to buy the latest version of the development environment, loose integration (via plugins) means that you can keep the core and just upgrade the plugin to take advantage of the new features. Borlands attempts to develop a cross platform environment (Klyx ?) was a dead duck, because their starting base was too tightly integrated into the original platform.
 
Old 02-08-2007, 09:51 AM   #26
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
Okay I think we are on the same page now. :-) I really only meant to comment that we don't have the same integration as Visual*, I didn't mean to imply that it's a bad thing.
 
Old 02-08-2007, 10:15 AM   #27
fc6_user
Member
 
Registered: Jan 2007
Location: Montpellier, France
Distribution: Fedora Core 6, Mandriva, Knoppix, Debian
Posts: 143

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Hko
Sure. You can browse through the kernel sources online or download any released version of the sources as a single (gzipped tar) file.

The Linux kernel is not written in C++ though, but in plain C.
Thanks for the links! Cool!

Is it also possible to look at OS source code in my computer? I suppose this is possible and imagine it's quite easy to do, however, as I'm new to all of this stuff, I wouldn't want to mess up my system files, configuration, or whatever. I'm not too comfortable browsing in system folders and files, but I'd just like to have a little peek...
 
Old 02-08-2007, 12:20 PM   #28
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
It will be all the files in /usr/src/linux/<your kernel version>/

Just try to view them as a normal user who shouldn't have write access to the kernel source. Besides, if you have proper kernel headers installed, the source is only there for a sort of reference, you could delete them completely and it probably wouldn't break a thing. (Might hurt if you try to compile a kernel module that digs into the kernel though)
 
Old 02-08-2007, 02:58 PM   #29
fc6_user
Member
 
Registered: Jan 2007
Location: Montpellier, France
Distribution: Fedora Core 6, Mandriva, Knoppix, Debian
Posts: 143

Original Poster
Rep: Reputation: 15
PatrickNew,

The path doesn't seem to be the same in my Linux box:

[linux@localhost /]$ ls
bin dev home lost+found misc net proc sbin srv tftpboot usr
boot etc lib media mnt opt root selinux sys tmp var
[linux@localhost /]$ cd sys
[linux@localhost sys]$ ls
block bus class devices firmware fs kernel module power
[linux@localhost sys]$ cd kernel
[linux@localhost kernel]$ ls
debug kexec_crash_loaded kexec_loaded security uevent_helper uevent_seqnum
[linux@localhost kernel]$ cd ..
[linux@localhost sys]$ cd ..
[linux@localhost /]$ ls
bin dev home lost+found misc net proc sbin srv tftpboot usr
boot etc lib media mnt opt root selinux sys tmp var
[linux@localhost /]$ cd usr
[linux@localhost usr]$ ls
bin games kerberos libexec sbin src X11R6
etc include lib local share tmp
[linux@localhost usr]$ cd src
[linux@localhost src]$ ls
redhat
[linux@localhost src]$ cd redhat
[linux@localhost redhat]$ ls
BUILD RPMS SOURCES SPECS SRPMS
[linux@localhost redhat]$ cd SOURCES
[linux@localhost SOURCES]$ ls
[linux@localhost SOURCES]$ cd ../RPMS
[linux@localhost RPMS]$ ls
athlon i386 i486 i586 i686 noarch
[linux@localhost RPMS]$ cd ../SRPMS
[linux@localhost SRPMS]$ ls
[linux@localhost SRPMS]$ cd ../SPECS
[linux@localhost SPECS]$ ls
[linux@localhost SPECS]$ cd ../BUILD
[linux@localhost BUILD]$ ls
[linux@localhost BUILD]$

Don't know where it would be...

By the way, I noticed you're familiar with several Linux distros. I'd like to install a different distro on a friend of mine's computer. I don't consider Linux a headache (lol), but rather a learning experience, and one that I'm enjoying. So the idea isn't necessarily to install an easy-to-use Linux distro, but rather to install a distro much different from fc6 and which will force me to learn more about Linux and computers in general. What do you think? I'd obviously want a decent distro, and a free one too. Are there any free UNIX distros available? I imagine that you couldn't install them on a regular desktop computer. It would be a dual boot XP/Linux setup. Let me know if you have any ideas...
 
Old 02-08-2007, 04:42 PM   #30
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
Well, there's a whole continuum between easy and hard, the easiest being, maybe mandriva or pclinuxos, the hardest being Slackware. As a good in-between, I'd recommend Debian. The package manager is great, it's very well supported, and it's about the middle of the road in difficulty. If Debian turns out a bit too hard, try Ubuntu, but then you fall on the easier side.

In my general experience, any Linux distro will teach you more about computers than windows, but I think Debian might be what you're looking for. By the way, I used to use fedora, sorry I forgot they put the kernel source in funny places (actually, I thought they did a lot funny). It'll be in /usr/src/redhat/. By it's absence, I'm guessing you don't have the kernel source. Type this to get it:

Code:
yum install kernel-devel
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
LDAP auth with apache doesn't works in FC6 chithu Linux - Server 6 04-17-2007 03:45 AM
FC6 audio works intermittently on HP Pavilion zv6000 ronald.watson Linux - Newbie 1 11-29-2006 05:47 AM
dual screen no longer works after FC6 upgrade DJOtaku Fedora 1 11-08-2006 08:14 PM
Turbo C and C++ works on Linux and if so which compiler and editor is available. benoy4007 Red Hat 2 08-14-2004 08:13 AM
checking whether the C compiler (gcc ) works... no Transition Linux - Newbie 19 07-01-2004 03:04 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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