yes, system("pause") will work under DOS only, indeed it is a legacy DOS function that was frequently used in batch files.
However, please note that you cannot create DOS executable with DevCPP/MingW32.
Mike
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
include<stdlib.h> //only needed if you are using Dev 4 family
using namespace std; //where the names are - like cout!
int main(void)
{
cout << "This is what that putz Wayne said to do!\n";
system("pause"); //keep the window open if running from Dev
return 0;
}
(The same as the first one i wanted to test it.)
I cant see my compile log because it comes up then leaves quickly automatically (like less than half a second...anyone know a reason why??) Then at the bottom it says unable to run program file. Soo.. if i go to Execute Run it says Source file not compiled. Help would be appreciated thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That version has got the be a year or more old, I would recommend doing a clean uninstall (see directions in the thread PLEASE READ BEFORE ASKING A QUESTION) on how to do that.
And please start a new thread if you are still having issues...
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
make.exe -f "C:\Documents and Settings\Jimmie\Skrivbord\Scripts\Prov1\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
main.cpp: In function int main()':
main.cpp:8: error:cout' undeclared (first use this function)
main.cpp:8: error: (Each undeclared identifier is reported only once for each function it appears in.)
main.cpp:10: error: expected `;' before "return"
make.exe: *** [main.o] Error 1
My problem is that when i'm trying to start the program.. nothing happens, Not an singel window popps up.. I have try 3 diffrent codes and still nothing..!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I fixed it.. but it's still one error with: "Return 0;"
make.exe -f "C:\Documents and Settings\Jimmie\Skrivbord\Scripts\Prov1\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
main.cpp: In function int main()':
main.cpp:8: error:cout' undeclared (first use this function)
main.cpp:8: error: (Each undeclared identifier is reported only once for each function it appears in.)
main.cpp:10: error: expected `;' before "return"
make.exe: *** [main.o] Error 1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That log you posted isn't from the code you posted. But your next typo is the missing semicolon right before return 0;
Any time it gives you a line number of an error, you should start by also checking the line before it. A lot of times a missing semicolon, bracket, close parentheses, etc, on one line can cause the error to appear to be on the following line.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Btw, sorry for dubbel posting, but heres another one: 10 C:\Documents and Settings\Jimmie\Skrivbord\Scripts\Prov1\main.cpp expected ;' before "return"
C:\Documents and Settings\Jimmie\Skrivbord\Scripts\Prov1\main.cpp In functionint main()':
(srry im swedish)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
int main(int argc, char *argv[])
{
cout << "Hello, this is your computer speaking." << end1;
system("PAUSE");
return EXIT_SUCCESS;
}
In function int main(int, char**)':end1' undeclared (first use this function)
(Each undeclared identifier is reported only once for each function it appears in.)
Seems as though I'm have a bit of trouble with the "end1" clause.
Any help would be much appreciated!
Thanks
Nathaniel.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Please ignore my last question, (wow I feel so dumb --...) Anyways I thought this whole time it was end1 and not endl --.... sorry for being ignorant and wasting time and thread =).
Nathaniel.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If a thread starts with RT, it is an informational thread, please do
not use it to post questions.
Thanks,
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2011-03-12
do you want to upgrade quickly in maple story?why not Buy Maplestory
Mesos to enlarge your enquipment?our website
sellCheap Maplestory Mesos and provide all
kinds of service.get going!you will get more discount when you Buy Maplestory
Mesos from us.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
yes, system("pause") will work under DOS only, indeed it is a legacy DOS function that was frequently used in batch files.
However, please note that you cannot create DOS executable with DevCPP/MingW32.
Mike
Mike,
The pause also works under Windows XP for example, in which there is NO DOS. At all.
Wayne
I am using Dev-C++ 4.9.8.9
my code
include<iostream>
include<stdlib.h> //only needed if you are using Dev 4 family
using namespace std; //where the names are - like cout!
int main(void)
{
cout << "This is what that putz Wayne said to do!\n";
system("pause"); //keep the window open if running from Dev
return 0;
}
(The same as the first one i wanted to test it.)
I cant see my compile log because it comes up then leaves quickly automatically (like less than half a second...anyone know a reason why??) Then at the bottom it says unable to run program file. Soo.. if i go to Execute Run it says Source file not compiled. Help would be appreciated thanks.
The log is on the tab labeled "Compile Log", it does not come up and leave.
Please start a new thread with your question, remembering to post your "Basic 3"
Wayne
p.s. Are you sure it is 4.9.8.9?
yeah it says 4.9.8.9 in the top left corner.
That version has got the be a year or more old, I would recommend doing a clean uninstall (see directions in the thread PLEASE READ BEFORE ASKING A QUESTION) on how to do that.
And please start a new thread if you are still having issues...
Wayne
Ok guys i just installed 4.9.7.0 from the C++ dummies guide. So of course it does not compile properly becuase i quess its not a full install.
which version do i download now to get this bady up and running.
Stev
My Dev-c++ version is 4.9.9.2
include<istream>
include<stdlib.h>
using namespace std;
int main(void)
{
cout << "Hello World!\n";
system("paus")
return 0;
}
g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
main.cpp: In function
int main()': main.cpp:8: error:
cout' undeclared (first use this function)main.cpp:8: error: (Each undeclared identifier is reported only once for each function it appears in.)
main.cpp:10: error: expected `;' before "return"
make.exe: *** [main.o] Error 1
You have a lot of typos. The one causing cout not to be found is that it's called iostream not istream.
I fixed it.. but it's still one error with: "Return 0;"
make.exe -f "C:\Documents and Settings\Jimmie\Skrivbord\Scripts\Prov1\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
main.cpp: In function
int main()': main.cpp:8: error:
cout' undeclared (first use this function)main.cpp:8: error: (Each undeclared identifier is reported only once for each function it appears in.)
main.cpp:10: error: expected `;' before "return"
make.exe: *** [main.o] Error 1
Actually it still says you have the same error. Are you sure you fixed the iostream typo?
This is the code now:
include<iostream>
include<stdlib.h>
using namespace std;
int main(void)
{
cout << "Hello World!\n";
system("paus")
return 0;
}
That log you posted isn't from the code you posted. But your next typo is the missing semicolon right before return 0;
Any time it gives you a line number of an error, you should start by also checking the line before it. A lot of times a missing semicolon, bracket, close parentheses, etc, on one line can cause the error to appear to be on the following line.
Btw, sorry for dubbel posting, but heres another one: 10 C:\Documents and Settings\Jimmie\Skrivbord\Scripts\Prov1\main.cpp expected
;' before "return" C:\Documents and Settings\Jimmie\Skrivbord\Scripts\Prov1\main.cpp In function
int main()':(srry im swedish)
Ok anoying, still an ERROR..
include<iostream>
include<stdlib.h>
using namespace std;
int main(void)
{
cout << "Hello World!\n";
system("paus")
;return 0;
}
make.exe -f "C:\Documents and Settings\Jimmie\Skrivbord\Scripts\Prov1\Makefile.win" all
g++.exe -c Namnlös1.cpp -o Namnlös1.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
g++.exe: Namnl÷s1.cpp: No such file or directory
g++.exe: no input files
make.exe: *** [Namnlös1.o] Error 1
Is it me who alwayse get it wrong? becus i got the first code from: "Accelerated C++ 2000"
and there the code is:
include <iostream>
int main()
{
std::cout << "Hello, world!" << std::endl;
return 0;
}
That last error looks like it didn't recognize the character in the filename:
g++.exe: Namnl÷s1.cpp: No such file or directory
Was it originally called main.cpp? Because you didn't have that error when you started.
Yea! worked! but now it's the window xD just show one sec and then it's quits :/ By the way, thanks so mutch all for your help!
The window closes because you have paus instead of pause in your system command.
Haha =P it worked but it did not say "Hello World" It's says "press any key to continu"
Odds are you compiled your code as windows project, and not a console project.
Please start a new thread, and post your Basic 3 there.
Future posters;
If a thread starts with RT, it is an informational thread, please do
not use it to post questions.
Thanks,
Wayne
You're saying this code doesn't print Hello World?
include<iostream>
include<stdlib.h>
using namespace std;
int main(void)
{
cout << "Hello World!\n";
system("pause")
;return 0;
}
Os is Windows Vista, I'm running Dev-C++ 4.9.9.2
include <cstdlib>
include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
cout << "Hello, this is your computer speaking." << end1;
system("PAUSE");
return EXIT_SUCCESS;
}
In function
int main(int, char**)':
end1' undeclared (first use this function)(Each undeclared identifier is reported only once for each function it appears in.)
Seems as though I'm have a bit of trouble with the "end1" clause.
Any help would be much appreciated!
Thanks
Nathaniel.
Please ignore my last question, (wow I feel so dumb --...) Anyways I thought this whole time it was end1 and not endl --.... sorry for being ignorant and wasting time and thread =).
Nathaniel.
If a thread starts with RT, it is an informational thread, please do
not use it to post questions.
Thanks,
Wayne
do you want to upgrade quickly in maple story?why not Buy Maplestory
Mesos to enlarge your enquipment?our website
sellCheap Maplestory Mesos and provide all
kinds of service.get going!you will get more discount when you Buy Maplestory
Mesos from us.