Author Topic: problem with system("pause");  (Read 9568 times)

Offline Elecfro

  • Single posting newcomer
  • *
  • Posts: 5
problem with system("pause");
« on: January 21, 2012, 10:54:56 pm »
Hello CodeBlocks community, im new here and new to codeblocks.
I am getting an error when i try using system("pause");
can someone please tell me what i am doing wrong. Thanks

Offline Elecfro

  • Single posting newcomer
  • *
  • Posts: 5
Re: problem with system("pause");
« Reply #1 on: January 21, 2012, 11:00:09 pm »
also, this is the error message
C:\Documents and Settings\adm\My Documents\C++\Practice\Untitled1.cpp||In function 'int main()':|
C:\Documents and Settings\adm\My Documents\C++\Practice\Untitled1.cpp|7|error: 'system' was not declared in this scope|
||=== Build finished: 1 errors, 0 warnings ===|

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7790
    • My Best Post
Re: problem with system("pause");
« Reply #2 on: January 21, 2012, 11:29:50 pm »
This is NOT a programming help site.

But, turn on full Compiler logging and maybe I will see a problem when you post the build log.
NOTE: Do a re-build to make sure the project builds from the beginning.
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Note: It is likely you just forgot to include the right header in your source code.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Elecfro

  • Single posting newcomer
  • *
  • Posts: 5
Re: problem with system("pause");
« Reply #3 on: January 21, 2012, 11:43:32 pm »
sorry i thought i could get help but here is the build log:
||=== Practice, Debug ===|
C:\Documents and Settings\adm\My Documents\C++\Practice\Untitled1.cpp||In function 'int main()':|
C:\Documents and Settings\adm\My Documents\C++\Practice\Untitled1.cpp|7|error: 'system' was not declared in this scope|
C:\Documents and Settings\adm\My Documents\C++\Practice\Untitled1.cpp|9|error: expected ';' before '}' token|
||=== Build finished: 2 errors, 0 warnings ===|

Offline Elecfro

  • Single posting newcomer
  • *
  • Posts: 5
Re: problem with system("pause");
« Reply #4 on: January 21, 2012, 11:44:57 pm »
sorry that is the build message, here is the log:
-------------- Build: Debug in Practice ---------------

mingw32-g++.exe -Wall  -g     -c "C:\Documents and Settings\adm\My Documents\C++\Practice\Untitled1.cpp" -o obj\Debug\Untitled1.o
C:\Documents and Settings\adm\My Documents\C++\Practice\Untitled1.cpp: In function 'int main()':
C:\Documents and Settings\adm\My Documents\C++\Practice\Untitled1.cpp:7: error: 'system' was not declared in this scope
C:\Documents and Settings\adm\My Documents\C++\Practice\Untitled1.cpp:9: error: expected ';' before '}' token
Process terminated with status 1 (0 minutes, 1 seconds)
2 errors, 0 warnings
 

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]