Question:
How do I get C++ to work on my computer?
The Cult of Chesire Cat
2009-04-15 14:41:38 UTC
Currently, I have to tunnel to my school's system and do any C++ coding that way, but I want to be able to have everything, physically, on my computer.

I know I need a compiler, but what else will I need to download and install?

My school uses Linux(Fedora) I use Windows Vista, would everything work the same on a different OS?
Six answers:
jplatt39
2009-04-15 14:50:53 UTC
No it doesn't work the same on every OS, but gcc, which lies underneath Fedora and most other linux distros, is a cross-platform compiler.



You can get several versions of gcc for Windows. Since you are doing it with Fedora at school, you might as well go for one of these:



http://www.mingw.org

http://www.cygwin.com



Both are windows ports of the whole GNU tools, which gcc is a part of (and also underlies Linux with programs like tar and cp). Since you are working from the command line in Linux those should be sufficient. To debug just compile with the flag -g and type "gdb " when you are finished.



For an IDE, Dev-C++ is no longer maintained but it is still available. Get it from http://www.bloodshed.net/devcpp.html



Good luck.



EDIT: Use any text editor, like Notepad, for editing/coding.
yufongwe
2009-04-15 14:56:04 UTC
Well, the normal C++ compiler you use for Windows is going to be Visual Studio, whereas Fedora uses gcc. (For C++, the compiler is g++).



Often there are differences. I got burned big time in high school when I couldn't figure out how to get the code that worked perfectly fine on my home copy of Visual Studio to work on my school's CodeWarrior. (I imagine that it's just that the build system was configured differently, but of course, I didn't know WTF to do and my final project wouldn't compile...yeah, not fun.)



So it's better to use whatever your school is using. Fortunately, if they're using Linux on their computers, there's probably a free Windows version of the stuff they have.



As for setting up a proper development environment in Windows, I don't really know how your school is doing everything, so I can't give you specific answers. Cygwin will help you set up a Unix-like environment on Windows. And then you'd go about setting everything up...I don't know whether there's a package management system in Cygwin or whether you have to compile all the stuff you need from source. (Which would be a pain.)



The easiest way to do it, as far as I'm concerned, would be to set up a Linux partition on your home computer. You can get Fedora for free, obviously, and Ubuntu is pretty popular for home users. Then use Synaptic (in Ubuntu, or apt-get on the command line if you already know what you want) to get all the software that your school is using.
Tim
2009-04-15 14:49:16 UTC
The Linux Compiler, GCC, is not available for Windows natively. Visual C++ is the most popular for windows. Here's the free Express edition:

http://www.microsoft.com/express/vc/



The language is the same... and simple things will be compatible... like basic I/O, OOP, math, etc. But complete Linux Applications and Windows Applications use different libraries and code, and trasnfering a complete Program one to the other will be a lot of work.



If you want to use Linux on your home computer easily, there are complete versions of Linux that can run of a USB stick, like SLAX:

http://www.slax.org/

Make sure you have the GCC module.
anonymous
2009-04-15 14:45:55 UTC
Linux and Windows are different Operating Systems, therefore most things will work differently on them.



You need a lot more than a compiler in order to write and run C++ programs, but most IDE's/compilers come with all-in-one package that does all the work for you. Download and try Dev-C++ - it should be all that's needed for you.
Kendall Sylvan
2009-04-15 14:48:59 UTC
you need a compiler, a good text editor(like jEdit, www.jedit.org), and the libraries for the language





check www.gnu.org || www.distrowatch.org



for software that you can install



since you are working on Windows, there should be complete installers available so you don't have to set everything up on its own.
?
2016-05-26 02:54:31 UTC
Before u learn C++, u should know the C lang. If u know C lang, then learning any comp lang will becomes very easy. B`cos C is the mother language of computers. Based on C many other lang r developed. So u start learning from C lang & then go 4 other lang.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...