tags:

views:

131

answers:

4

I am a newbie in linux and programming. I want to learn linux command and use create some C and C++ programme to interact with the linux API from my windows XP. However, I am not sure how to set up the environment from my windows based computer.

What programme should I install? Also, it seems like linux has Ubuntu, Fedora. I heard of Red Hat as well. What is the difference and which one should I install?

Also, is there any difference between using linux with user interface like Ubuntu, using an IDE to create programme AND the command line terminal using VIM to create programme?

Besides, I have heard of using Valgrind to debug programme. Does Valgrind works together with an IDE in Ubuntu or works in command line terminal only? If my IDE already has debugger, do I still need Valgrind?

Sorry for such newbie questions.

Thanks.

+1  A: 

Try it with a VM or as a live-cd.

Valgrind is a command-line tool but maybe some IDEs use integrated it.

Under Linux you'll see, than most of the time an IDE is quite useless (not a troll). You'll do your Makefile manually,...

Hope you'll enjoy' it.

Regards,

ykatchou
Thanks for your reply. For using IDE, wouldn't that something like the intellisense in Visual Studio helps instead of a pure text editor?
jake
Intellisense is a feature of the text editor integrated into Windows. A text editor can do much more than simply enter characters.
reemrevnivek
A: 

If you try it in virtual machines (virtualbox or WMWare for example) you can test as many options you want before deciding what Linux distro you will want to use. There are a lot, but from what you listed, my personnal opinion is that Ubuntu is a lot easier than Fedora to start. I've never used RedHat so I can't tell but it hasn't the reputation of beeing a hard one (for experts).
Anyways, at least to start I recommend installing it with GUI (and after starting too unless it's a server...).

Regarding IDEs, you could try Eclipse and Netbeans. They run both on Windows and Linux but I'm not C/C++ programmer so I don't know if they are good at that job. I you don't use IDE, Vim is far from beeing the unique option (Vim "addicts" :) will say it is the unique productive one but that's a personnal choice and the learning time is not very short). Personnaly I prefer a good IDE or at least graphical editors for programming, not that I don't like the power and speed of the terminal with command line as I prefer to use it for system administration or configuration but not for programming where you stay a long time on it.

I don't know about Valgrind but Eclipse or Netbeans IDEs have debuggers of course.

laurent-rpnet
Fedora came out from RedHat 9... so they are practically the same thing. I haven't tested Fedora nor RedHat recently, but they still *fell* the same to me, with the difference that RedHat is more "enterprise" oriented.
Yanick Rochon
+1  A: 

Learn 1 thing at a time.

  • If you want to learn to program first, try python first. It works in Windows and Linux and you get result faster
  • If you want to learn C++, get Visual C++ express or Cygwin/GCC
  • If you want to experience with Linux, get a distribution of your choice (Linux-Mint is a good introction, coming from Windows) and try it in a VM (VMWare Player or VirtualBox)
  • Try easy projects and only after that, worry about debuggers
stefaanv
+5  A: 

Your question is very vague and prone to start argumentations and fights. Also, you miss-used many terminologies there and before you even start programming with Linux, you should first get acquainted with the OS, especially the terminal... But first things first, programming in C/C++ for Windows is not entirely the same as programming in C/C++ for Linux. If you want the latter, then use the latter.

My suggestion is this :

  1. Grab VirtualBox and install it.
  2. Download Ubuntu ; IMHO, Ubuntu is best for starters (or anyone as a matter of fact) because it has a lot of support, a good user base and is compatible with pretty much any Linux software installer (RPM, deb, etc.) You can choose any other distribution, it doesn't really matter, but I recommend this one. [1]
  3. Start VirtualBox and create a new Ubuntu virtual machine. The steps are pretty straight forward, consult the documentation for any assistance). Your virtual machine may look something like :
    • 1GB of RAM will be enough;
    • 10GB of hard disk (you won't need much more, but you may increase the size if you think you'll need more space for /home, see next point)
    • a network adapter set a bridged
    • etc.
  4. Install Ubuntu from the ISO that you have just downloaded (that you have mounted into VirtualBox as a CD-ROM device) You'll only need about 8GB of hard disk total for a typical, minimum Ubuntu installation (ext4+swap), however I recommend this setup.
  5. Enjoy your installation. (Tip: now you can install the VirtualBox's Guest Additions.)
  6. Open a terminal in your Ubuntu VirtualBox window and type sudo apt-get install build-essential to install the GCC compiler
  7. Gedit is already installed by default with Ubuntu and it's a fairly good text editor compared to Windows' notepad. However, vim is not, but you can install it with sudo apt-get install vim in the terminal.

And voilà! You're all set to go to do some C/C++ programming in a Linux environment, where you can still have Windows in case you're stuck.

I also recommend you do most of your learning using the terminal (aka the command line) so you know how things work under the hood. Then, when you are familiar with the GCC compilier, MAKEFILEs, etc. you can install some IDE to avoid repeating tasks; The two best I have yet found are Ajunta and MonoDevelop. Both are available from the repositories.

Now, if you want to "create some C and C++ programs to interact with the linux API from [your] windows XP", You need, for example, to learn sockets and SSH; so you can connect to your Linux machine from your Windows machine and execute some commands remotely from your Windows applications. But before you do that, learn C/C++ and play around with Linux. For a newbie, you already have your hands full right there.

Good luck!


[1] Ubuntu (a Linux distribution) comes with Gnome as GUI, while Kubuntu with KDE and Xubuntu has XFCE. All of them (GUIs) are separate projects and you could have all of them installed on any Linux desktop installation. Even, you don't need any GUI with any Linux distribution; for example, VMWare's Virtual Appliance Marketplate have a whole bunch of ready-to-go Linux installations like that.

Yanick Rochon