Page 1 of 1

Compiling without an IDE

Posted: Tue Jun 14, 2011 1:15 pm
by Dominger
Im new to programming and want to practice(C++), but for the next couple weeks im living away from home using a friends computer. He doesn't have a compiler on his computer though. I was wondering if by chance, if its possible to save and compile c++ files without an IDE. Ive tried saving notepad files with .cpp, but that doesn't seem to work. Sorry if i sound like a noob, or a complete idiot, just want to program. :)

Thank You!

Re: Compiling without an IDE

Posted: Tue Jun 14, 2011 3:32 pm
by JaxDragon
For a compiled language like C++, you need to have a compiler.

Re: Compiling without an IDE

Posted: Tue Jun 14, 2011 3:38 pm
by X Abstract X
IDEs and compilers are not the same thing. IDEs are just fancy text editors that include a compiler and a bunch of other useful features to make things easier. A compiler is a program that actually transforms source code into it's compiled form (usually used as a command line tool). So even if you don't use an IDE, you will have to download a compiler to compile your code.

If your friend is weird about you installing things on his PC, perhaps you can find a lightweight IDE that can be run from a USB drive or a Dropbox.

Re: Compiling without an IDE

Posted: Tue Jun 14, 2011 4:43 pm
by BugInTheSYS
X Abstract X wrote:IDEs and compilers are not the same thing. IDEs are just fancy text editors that include a compiler and a bunch of other useful features to make things easier. A compiler is a program that actually transforms source code into it's compiled form (usually used as a command line tool). So even if you don't use an IDE, you will have to download a compiler to compile your code.

If your friend is weird about you installing things on his PC, perhaps you can find a lightweight IDE that can be run from a USB drive or a Dropbox.
Furthermore, most IDEs nowadays include compilers - Visual c++ 2010 for example contains a compiler for Windows Operating Systems, Qt includes one for Symbian, etc. But you could just as well edit the source code in Visual C++ and afterwards give some other compiler the code, which will create the executable for another target platform, e.g. for linux or Mac.
The only thing IDEs do is let you edit your code and by having you click the Compile and Run button passing the code to its compiler (which you can possibly set up in your IDE options menu) and executing the file that the IDE told the compiler to compile to.

Re: Compiling without an IDE

Posted: Tue Jun 14, 2011 11:46 pm
by Dominger
Thank you all!
That really helped me understand the difference between a compiler and an IDE. I thought a compiler was something like Visual Studio 2008. :oops:
...and I am considering saving notepad c++ on a flash drive. Otherwise i'll just aim to learn visual basic while i'm here.

Re: Compiling without an IDE

Posted: Wed Jun 15, 2011 12:47 am
by bnpph
You can run code::blocks off a flash drive - I've done it and it works great. This is what I recommend.

If you don't use an IDE you'll have to mess with makefiles which can be a pain.

Re: Compiling without an IDE

Posted: Wed Jun 15, 2011 9:43 am
by dr-snipe
You could use a command line compiler like Borland and just use a batch file to build your programs. But yeah you would have to mess with makefiles to make multiple-file programs.