Thursday, July 30, 2009

Questions for Linux programmers: What is the best Linux for programming in C++, with OpenGL ?

Hello. I want to learn programming in Linux (in C or C++, not so much in Java).





What Linux should I use, to make it easier ?


I mean, I want to make a simple program in OpenGL, in the C++ programming language, for the beginning.


For this, the OpenGL libraries need to be installed in Linux, and then I need to know how to use them.





I need help with this, because I can't do it alone. Are there any books online, which explain this, step by step ? But for dummies... :)





Thank you.

Questions for Linux programmers: What is the best Linux for programming in C++, with OpenGL ?
Prescript (as opposed to post-script): If you are on ANY Linux INCLUDING Ubuntu, stick with it. If you have a problem, change your desktop to KDE before changing your distro. Check any forum for information as to how.





There are plenty of books out there. So many I can't recommend one because there are too many. Walk into any Barnes and Noble near a tech-savvy area or near a university campus, and try to make the rounds of college bookstores. You'll see them. Splurge. Programming is not simple and you need hard copies. Asimov did an essay on the superiority of books in the seventies which is still true.





As for a Linux for programming, gosh. While Linuxes are not identical they are mostly similar enough so for development they are mostly equally good: even Ubuntu, which I am no fan of, seems to have many fans among the developer community as well as among the general public.





If you are using Ubuntu do a "sudo apt-get build-essential" in the terminal, "sudo apt-get install libglut3-dev" and if you don't see it when you are downloading packages a "sudo apt-get g++" and you should be ready to go. All the other distributions I'm familiar with install these packages by default so if you have them you are ready to go. Honestly, 5 minutes on the Internet doesn't seem like such a big deal.





Ubuntu has a lot of under-the-hood security and other fixes for newbies. If you're learning OpenGL they probably are not important. It is a derivative of another distro called Debian, which is very similar if you know what you're doing (and I'm using it right now). That build-essential and gcc/g++ are installed by default is NOT a major difference. I should mention that the biggest difference for the user is that there is a separate root account and you can sign in as the administrator rather than using sudo to run administrator commands. That is NOT a good thing. Especially in programming it is better to compile programs as the user then install them as the administrator. And the old joke about it is "If you surf the web as root you may as well be using Windoze." I don't like Ubuntu for reasons irrelevant here: this is one thing they do absolutely right.





Very different but equally good is Red Hat/Fedora. This has been around for a very long time and one reason Debian/Ubuntu default to the Gnome desktop is that Red Hat has supported it for so many years. I'll have something to say about that later. Fedora is Red Hat's Testing distribution and a recent comment in the comp.os.linux.hardware group was "if you don't mind having to do a fresh install every year Fedora is very good." Red Hat Enterprise Linux, the current version of their stable distro is for small businesses. You can pay for it or get a free clone of it from CentOS (see sources). If you have the hardware to run it (and I don't) it can be awesome.





Slackware is vanilla Linux. Period. It is the oldest distribution of Linux and almost no changes or adaptations have been made to it. It still has its fans among developers and -- I dumped it when they dumped Gnome. Now I am not using Gnome (see below) I am thinking very seriously of going back to it.





Gentoo is for hard-core coders. This is one distro where you absolutely do not need the default install disk for trying it. It is the one distro you should not even try until you have recompiled the Linux kernel for yourself (I'm running this on yesterday's release of kernel 2.6.24-rc2-git6 while compiling 2.6.24-rc3). It recompiles itself with every OS upgrade, not completely but I'm sitting next to a laptop doing an upgrade which started yesterday afternoon that is nowhere near finished.





Now the thing is, through Mono and other projects, Gnome has started integrating Microsoft Technology into itself. It has always run more slowly and taken up more memory than other desktops such as KDE XFCE or fluxbox, but on my old systems it has gotten absurdly slow and I just can't run it any more. Most of the serious coders (which I'm not) I know run the KDE desktop. I use that on my desktop and XFCE on my laptops. That last is very efficient but the hardest to learn. If you are going to do a project like learning to program OpenGL on Linux I strongly recommend using the KDE desktop if you aren't already. I never found the learning curve steeper the way some people have, but even those who have reported that problem agree the system responds more quickly and -- lately crashes less often unless something else in the OS is affecting it.





Oh. I have linked to a collection of Linux Programming links but I still say get a book. ;-)





Oops: I forgot. If it's OpenGL you're interested in and you haven't checked out nehe.gamedev.net well, I shouldn't be answering this unless I say do.
Reply:Ubuntu or Debian should be your choice. Both have over 18000 packages of softwares. That presents a good chance of your necessary libraries and other things already available in a standard, easy to install/uninstall format.





So, once you master using one of these, you will never be needed to tweak with installation woes of your necessary programs. Linux usually does not come with all the softwares installed. But these two distributions make it easier than any other distro out there in getting and installing the softwares. You have to learn using Synaptic or aptitude or apt-get. After that, the wealth of 18000+ packages is at your service.





If you are brand new to Linux, I suggest you look at www.goodbye-microsoft.com and it will hand hold you for most part. For the missing bits, join #debian on freenode IRC chat network.
Reply:Try G++ to compile and to install opengl lib use synaptic choose opengl dev


No comments:

Post a Comment