View previous topic :: View next topic |
Author |
Message |
hxkid Cheater
Reputation: 0
Joined: 09 Dec 2006 Posts: 44
|
Posted: Wed Nov 26, 2008 10:39 pm Post subject: Which is the best compiler? |
|
|
I want a compiler that's good to use (I'm learning so if its noob friendly even better)
Dev-C++ isn't working that well for me whenever I run my program it just comes up with a cmd and closes half a second later.
|
|
Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Wed Nov 26, 2008 11:41 pm Post subject: Re: Which is the best compiler? |
|
|
Visual Studio 2008.
DevC++ is ancient, and out of date.
hxkid wrote: | I run my program it just comes up with a cmd and closes half a second later. |
Also, this is a coding issue, not the compiler. Run it from the command line, or wait for user input in your program.
|
|
Back to top |
|
 |
hxkid Cheater
Reputation: 0
Joined: 09 Dec 2006 Posts: 44
|
Posted: Wed Nov 26, 2008 11:57 pm Post subject: |
|
|
Running from the command line?
|
|
Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Wed Nov 26, 2008 11:59 pm Post subject: |
|
|
start -> run -> cmd
|
|
Back to top |
|
 |
hxkid Cheater
Reputation: 0
Joined: 09 Dec 2006 Posts: 44
|
Posted: Thu Nov 27, 2008 12:01 am Post subject: |
|
|
Do I just write the source in cmd or something?
|
|
Back to top |
|
 |
FullyAwesome I post too much
Reputation: 0
Joined: 05 Apr 2007 Posts: 4438 Location: Land Down Under
|
Posted: Thu Nov 27, 2008 12:46 am Post subject: |
|
|
hxkid wrote: | Do I just write the source in cmd or something? |
you open the command prompt and go to the directory of your file, example:
Code: | cd "directory"
"ApplicationName.exe"
|
the only reason it closes straight away, as slovach mentioned, is because the program is ending straight after it's done what it's supposed to do. opening at the command line, it will still end when it should, but you'd be able to see the output.
simple fix: i think in c++ it's "cin.get();" at the end of your output, that way the program will wait for user input.
also, get visual studio because it's a lot better and up-to-date.
_________________
|
|
Back to top |
|
 |
hxkid Cheater
Reputation: 0
Joined: 09 Dec 2006 Posts: 44
|
Posted: Thu Nov 27, 2008 10:02 am Post subject: |
|
|
Uh well visual studio won't let me compile for some reason I made a new source file but the compile button is gray and unclickable.
|
|
Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Thu Nov 27, 2008 11:54 am Post subject: |
|
|
You can't just create a source file and compile, you gotta create a new project and add the source files to it.
|
|
Back to top |
|
 |
hxkid Cheater
Reputation: 0
Joined: 09 Dec 2006 Posts: 44
|
Posted: Thu Nov 27, 2008 12:42 pm Post subject: |
|
|
Oh alright thanks but what project should I use?
|
|
Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Thu Nov 27, 2008 1:12 pm Post subject: |
|
|
Win32 Console.
|
|
Back to top |
|
 |
hxkid Cheater
Reputation: 0
Joined: 09 Dec 2006 Posts: 44
|
Posted: Thu Nov 27, 2008 1:40 pm Post subject: |
|
|
When I compile I get
fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
|
|
Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Thu Nov 27, 2008 2:39 pm Post subject: |
|
|
When you create a new project, untick "Use precompiled headers" or simply make an empty project and add the main source file manually.
You can go to Settings -> Linker -> Precompiled Headers -> Not using precompiled headers.
|
|
Back to top |
|
 |
hxkid Cheater
Reputation: 0
Joined: 09 Dec 2006 Posts: 44
|
Posted: Fri Nov 28, 2008 3:17 pm Post subject: |
|
|
Oh alright thanks
|
|
Back to top |
|
 |
crayzbeef Expert Cheater
Reputation: 0
Joined: 21 Jan 2007 Posts: 101
|
Posted: Fri Nov 28, 2008 4:33 pm Post subject: |
|
|
Do NOT use dev c++ its outdated.
|
|
Back to top |
|
 |
|