-
code help
i am starting to understand this a little, but i tried to do a small thing that made it just say hello on the screen but these warnings come up
C:\Dev-Cpp\main.cpp
[Warning] In function `int main()':
5 C:\Dev-Cpp\main.cpp
parse error before `)' token
C:\Dev-Cpp\Makefile.win
[Build Error] [main.o] Error 1
and my code is this ( i used windows.h because that seemed to work better than iostream.h when i use iostream.h or iostream i get a warning that says it doesn't exist.)
#include <windows.h>
int main()
{
()cout <<"hello";
return 0;
}
-
no () before cout
just
cout << "Hello";
also, try this and see if u get iostream problems
Code:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello" << endl;
return 0;
}
-
if i dont use and () before the cout i get an error message that looks like this
8 C:\Dev-Cpp\Untitled4.cpp
`cout' undeclared (first use this function)
-
-
try what RoD posted, if that doesn't work, check your compiler paths.
-
its telling you its undeclared because you need iostream, try my code then let me know what happens.
-
i just tried it and it came up with 370 errors and i am not going to cut and paste them all.
-
try
Code:
#include <iostream.h>
int main()
{
cout << "Hello" << endl;
return 0;
}
I think its your compiler (setup).
-
that seemed to work better i only got these warnings
22 C:\Dev-Cpp\main.cpp:1
iostream.h: No such file or directory.
C:\Dev-Cpp\main.cpp
[Warning] In function `int main()':
5 C:\Dev-Cpp\main.cpp
`cout' undeclared (first use this function)
(Each undeclared identifier is reported only once for each function
5 C:\Dev-Cpp\main.cpp
`endl' undeclared (first use this function)
C:\Dev-Cpp\Makefile.win
[Build Error] [main.o] Error 1
but if i put the () before cout like this
i only get these errors
22 C:\Dev-Cpp\main.cpp:1
iostream.h: No such file or directory.
C:\Dev-Cpp\main.cpp
[Warning] In function `int main()':
5 C:\Dev-Cpp\main.cpp
parse error before `)' token
C:\Dev-Cpp\Makefile.win
[Build Error] [main.o] Error 1
-
something isnt right with your compiler if its not finding iostream, did you follow all of its setup instructions? What version is it?
-
do you know of a good compiler i can download?
or how to set up dev-c++ version 4.9.7.0?
-
Borland has a trial version, bloodshed, djgpp(spelling?) i think.
As far as setting it up, check google or the boards. Compilers and such has been covered many many times.
-
i have bloodshed and djpp i think you have to download a bunch of things rather than just one big download and there are so many things there that it gets confusing if anyone has the downloads i need send them to me my e-mail is [email protected]
-
I'm attaching a zip with two iostream files in it, but i only ever used VC++ so i cant be sure it will work, but i doubt it.
-
try setting your compiler settings to these:
settings