C++ compiler
Post Reply
Quote
Re: C++ compiler
Posted by OtZman on Thu Jan 15th at 4:35pm 2004


Where can I find a good, free C++ code compiler? [addsig]



Quote
Re: C++ compiler
Posted by matt on Thu Jan 15th at 5:12pm 2004


http://download.com.com/3120-2001-0-1-0.html?qt=C%2B%2B+compiler&author=&titlename=&desc=&dlcount=&daysback=&swlink=&os=&li=49&dlsize=&ca=

take your pic

[addsig]




Quote
Re: C++ compiler
Posted by Forceflow on Thu Jan 15th at 5:41pm 2004


Can't help it matt, but its pick.

Sorry.





Quote
Re: C++ compiler
Posted by matt on Thu Jan 15th at 6:03pm 2004


? posted by Forceflow

Can't help it matt, but its pick.

Sorry.

Grrrrrr

[addsig]




Quote
Re: C++ compiler
Posted by Gwil on Thu Jan 15th at 6:31pm 2004


If you can get hold of Visual Studio from "a friend" for instance, try and get it

Microsoft tool, and bizarrely enough I rate it highly good piece of software!

[addsig]




Quote
Re: C++ compiler
Posted by matt on Thu Jan 15th at 6:55pm 2004


Funnily enough, I have a copy of that. And yes, I cannot tell you how much free software I've got of friends and family. I could make a list. Really. [addsig]



Quote
Re: C++ compiler
Posted by Edge Damodred on Thu Jan 15th at 10:30pm 2004


I'd get the Borland one and get Context, a word pad program designed for writing code/scripts, and set it up to use the compiler. Unfortunately, it doesn't come with a Debugger...at least I think it doesn't. Get one with a Debugger if you can, because they will help you tremendously in fixing s**t that looks right but is wrong. [addsig]



Quote
Re: C++ compiler
Posted by Crono on Thu Jan 15th at 10:43pm 2004


GNU has the top compilers for free, handsdown.

Most universities use GNU (gcc for C and g++ for C++)

Unfortunatly, you're probably using windows. So this exact version wont work, however, there is a package made by several groups called Mingw, a win32 version is included in this.

Go here to read how exact to get it and how to make it work:
mingw

Go here to download it:
Download

I hope all that helps. by the way, Gwil, he said free . . . . lol.

*note: check out gnu.org it has the gnu public license on it, which basically states its always free . . . and gnu isn't unix. [addsig]




Quote
Re: C++ compiler
Posted by DesPlesda on Fri Jan 16th at 2:01pm 2004


The best C/C++ compiler and IDE (integrated development environment) that I've seen so far is Bloodshed Software's Dev-C++. It includes the GNU compiler kit (that is, the compiler GCC and the debugger GDB) along with a very easy to use graphical interface for programming. It also includes syntax highlighting, and (I found this particularly nice) a setting that causes the syntax highlighter to mimic Microsoft's Visual Studio. It's free under the GNU GPL.



Quote
Re: C++ compiler
Posted by OtZman on Fri Jan 16th at 5:45pm 2004


Now I've downloaded Dev-C++ and it seems to work fine and I've compiled my first program ever!!! The only problem is that when I try to run the program it is closed after 1/2 seconds or less...

This is the code I'm using:

#include <iostream>
using namespace std;

int main()
{
cout << "My first program ";
return 0;
}

Anyone with any ideas? What can be wrong?

[addsig]




Quote
Re: C++ compiler
Posted by matt on Fri Jan 16th at 5:49pm 2004


Don't use C++ but I bet someone at this site does. [addsig]



Quote
Re: C++ compiler
Posted by OtZman on Fri Jan 16th at 5:51pm 2004


Yes I hope so... [addsig]



Quote
Re: C++ compiler
Posted by Monqui on Fri Jan 16th at 6:15pm 2004


Probably because this is what is happening:

A window pops up that your prog is run in,
It prints out the "My first program " bit
Then the window closes because the program successfully finished

It probably is running just like it should, it's just going too fast for you to realize. Add in a cin >> or a getkey or something (its been a while since I've touched C++, so the commands might be different). [addsig]




Quote
Re: C++ compiler
Posted by Edge Damodred on Fri Jan 16th at 6:16pm 2004


? posted by OtZman

Now I've downloaded Dev-C++ and it seems to work fine and I've compiled my first program ever!!! The only problem is that when I try to run the program it is closed after 1/2 seconds or less...

This is the code I'm using:

#include <iostream>
using namespace std;

int main()
{
cout << "My first program ";
return 0;
}

Anyone with any ideas? What can be wrong?

There's nothing wrong with the code in itself, it's just that console apps shut down as soon as you're finished.

You can write a batch file with the following lines

*****.exe (name of the executable)

pause

rename the text file to .bat and run it from there. Some compilers will do this for you when you run in debug mode, but not all.

That should work for you though. You could also put some kind of input statement at the end.

cout<<"Input q to quit."

char q;

cin>>q;

but that just looks bad, so go with the .bat method.

[addsig]




Quote
Re: C++ compiler
Posted by Crono on Fri Jan 16th at 8:14pm 2004


You could follow up your statement with '\nPress Enter to Continue' with in the quotes of your cout statement

Then, sort of how Edge stated, create a cin>>; statement. I believe you don't have to have a variable saving the statement, because you just want the program haulted, in otherwords why would you save something you wouldn't use?

One more thing, is there any particular reason why you think you need a namespace for this program? lol [addsig]




Quote
Re: C++ compiler
Posted by asterix_vader on Fri Jan 16th at 8:24pm 2004


Hey, someone who know how to use the compiler? [addsig]



Quote
Re: C++ compiler
Posted by Crono on Fri Jan 16th at 8:31pm 2004


Do you mean, is there someone who knows how to use a compiler? If so, yes, I do. . . Amongst many many people. [addsig]



Quote
Re: C++ compiler
Posted by Edge Damodred on Fri Jan 16th at 8:55pm 2004


? posted by Crono

One more thing, is there in particular reason why you think you need a namespace for this program? lol

Because that's what everyone who does "Hello World" does...besides it can get annoying having to go back and grab specific components out of an object when you realized you just needed. Now when you release to the public...yeah, you'd better be getting only the things you need

[addsig]




Quote
Re: C++ compiler
Posted by Crono on Fri Jan 16th at 8:59pm 2004


But the whole point is, you wouldn't need the namespace unless you were using tight, closed classes.

Why even bother putting it in there unless you're doing something like a hierarchy where it can actually make a difference? [addsig]




Quote
Re: C++ compiler
Posted by Monqui on Fri Jan 16th at 9:07pm 2004


Because this is his first program, and it was probably mentioned in whatever manual he got the idea from?

What does it matter in this case? [addsig]





Post Reply