Computer Science Canada

Nub here - can't make this compiler work properly -

Author:  Chapel [ Tue Jul 06, 2004 9:50 pm ]
Post subject:  Nub here - can't make this compiler work properly -

I'm a nub trying to get this compiler to run a example program but when i try to run an example program it doesn't run when i click on compile&run

#include <iostream>

using namespace std;

int main (int argc, char *argv[])
{
char quit;

quit = '\0';
while (quit != 'q')
{
cout << "Hello ! This is a console app." << endl;
cout << "To create a console, go to Project Options and select" << endl;
cout << "\'Win32 Console\'." << endl;
cout << "Press q to quit " << endl;
cin >> quit;
}

return 0;
}
That's what i paste onto the page but the compile log says this

Compiler: Default compiler
Building Makefile: "C:\Documents and Settings\Owner\My Documents\willie\Dev-Cpp\Examples\Hello\Makefile.win"
Executing make...
make.exe -f "C:\Documents and Settings\Owner\My Documents\willie\Dev-Cpp\Examples\Hello\Makefile.win" all
Execution terminated

And the compiler tab says that it's unable to run program. What am I supposed to do?

Author:  Andy [ Wed Jul 07, 2004 2:16 am ]
Post subject: 

what complier are you using?

Author:  wtd [ Wed Jul 07, 2004 2:39 am ]
Post subject: 

It's quite possible Dev-C++ is screwing up the makefile. For a program this simple you don't need a makefile.

Save the code you showed us in a text file called "hello_world.cpp". Open a CMD window ("Start" -> "run" -> "cmd"). Navigate top the file. Use the ffollowing commands.

code:
g++ hello_world.cpp -o hw.exe
hw

Author:  JR [ Wed Sep 22, 2004 6:21 pm ]
Post subject:  Re: Nub here - can't make this compiler work properly -

umm i think that it should be #include <iostream.h>. u forgot the h in yours.

But u might be using a different compiler so u dont need the h but just in case try it.

Author:  Mazer [ Wed Sep 22, 2004 6:24 pm ]
Post subject: 

JR, iostream and iostream.h aren't (exactly) the same. The way he's using it is fine, on any compiler I believe, assuming he has it in his include folder (which he most likely does).

Author:  wtd [ Wed Sep 22, 2004 6:46 pm ]
Post subject: 

code:
#include <iostream>


Is the proper way of doing things.

code:
#include <iostream.h>


Is obsolete.

Author:  Andy [ Wed Sep 22, 2004 10:38 pm ]
Post subject: 

arggg.. why do ppl bring back old question topics months after they were asked?


: