Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,491 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,714 people online right now. Registration is fast and FREE... Join Now!




Problem with compiler

 
Reply to this topicStart new topic

Problem with compiler

Semple
5 Mar, 2008 - 10:32 AM
Post #1

New D.I.C Head
*

Joined: 13 Feb, 2008
Posts: 12


My Contributions
Just starting to learn C++, bought a book which has some software with it.
A compiler called Dev-C++ (vesion 4.9.8.0) im sure most of you are familiar with it. Anyway also on the CD there were a few tutorials already wrote out. So i decided to open them up. When i click the "compile and run" button i get a long error list. Firstly starting with ...

CODE
#include <cstdio>


which is highlighted. Another errror...

CODE
#include <bits/c++io.h>


The error list has all the "#include" directive.

After reading what the "#include" is used for, all i can make out is that it tells the preprocessor to include th contents of another file. Which to me means that it cant find the file.

Sorry i am rather clueless at this stage, I only wanted to see what the tutorial program would do.

Any advice on what to do?, or any way of making the program run. Heres the code for the tutorial if it helps...
CODE
// Game Over 3.0
// Demonstrates using declarations

#include <iostream>

using std::cout;    
using std::endl;

int main()
{
    cout << "Game Over!" << endl;
    return 0;
}


Cheers in advance.

This post has been edited by Semple: 5 Mar, 2008 - 10:33 AM
User is offlineProfile CardPM
+Quote Post

schnalf
RE: Problem With Compiler
5 Mar, 2008 - 10:43 AM
Post #2

D.I.C Head
**

Joined: 9 Feb, 2008
Posts: 124



Thanked: 2 times
My Contributions
what is the error message of the compiler?
theoretically the code have to work. check your installation of dev-c++, first i had also problems with it
User is offlineProfile CardPM
+Quote Post

captainhampton
RE: Problem With Compiler
5 Mar, 2008 - 10:44 AM
Post #3

Jawsome++;
Group Icon

Joined: 17 Oct, 2007
Posts: 518



Thanked: 2 times
Dream Kudos: 825
My Contributions
The program should compile and run fine, however you may be seeing flashes of the console when you try to run it. To remedy that situation attempt to add a system pause at the end of your code like so:

cpp

// Game Over 3.0
// Demonstrates using declarations

#include <iostream>

using std::cout;
using std::endl;

int main()
{
cout << "Game Over!" << endl;
system("PAUSE");
return 0;
}

User is offlineProfile CardPM
+Quote Post

Semple
RE: Problem With Compiler
5 Mar, 2008 - 10:54 AM
Post #4

New D.I.C Head
*

Joined: 13 Feb, 2008
Posts: 12


My Contributions
For which error i have several hundred. Ill post a screen shot when i get home.
User is offlineProfile CardPM
+Quote Post

captainhampton
RE: Problem With Compiler
5 Mar, 2008 - 10:59 AM
Post #5

Jawsome++;
Group Icon

Joined: 17 Oct, 2007
Posts: 518



Thanked: 2 times
Dream Kudos: 825
My Contributions
Several hundred sounds a bit much for a program of such simplicity. I'm going to go out on a limb and say you are probably missing some pretty neccessary files for your compiler in general. Usually compilers that come with books are trials of already free compilers so it's garbage anyway. However, DEV C++ is a good compiler, what you should do is uninstall your current compiler and reinstall from the this link:
http://sourceforge.net/project/downloading...ror=superb-east

It's free and should be the same thing you have now, of course hopefully without the errors.

This post has been edited by captainhampton: 5 Mar, 2008 - 11:00 AM
User is offlineProfile CardPM
+Quote Post

Tom9729
RE: Problem With Compiler
5 Mar, 2008 - 01:01 PM
Post #6

Debian guru
Group Icon

Joined: 30 Dec, 2007
Posts: 1,459



Thanked: 10 times
Dream Kudos: 325
My Contributions
DevC++ is just an IDE. The compiler is GCC (MinGW).
User is offlineProfile CardPM
+Quote Post

Semple
RE: Problem With Compiler
5 Mar, 2008 - 03:12 PM
Post #7

New D.I.C Head
*

Joined: 13 Feb, 2008
Posts: 12


My Contributions
I'll download the newer version and hopefully it will work ill let ya know how it goes cheers. icon_up.gif

And in reply to 'Tom9729' the Dev C++ still has the compiler option though, so surely there shouldn't be a problem.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/2/08 07:42PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month