News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

CodeBlocks 10.05 - 'system' was not declared in this scope

Started by rantic, June 03, 2010, 01:05:10 AM

Previous topic - Next topic

rantic

Hi everyone,

I have been teaching myself to program in C++ for a few months now using Code::Blocks 8.02 and decided to upgrade to 10.05 today when I saw it on the website.

I uninstalled 8.02 in add/remove programs before installing 10.05. Unfortunately after launching 10.05 for the first time (without a hitch) I opened up a few of my old C++ projects to fiddle with and noticed they no longer compile.

Here are my compile errors for basically every program.

C:\Users\meta\Documents\My Dropbox\school\semester 2\comp1200 - c++\Assignments\assignment_1\assignment_1.cpp||In function 'int main()':|
C:\Users\meta\Documents\My Dropbox\school\semester 2\comp1200 - c++\Assignments\assignment_1\assignment_1.cpp|63|error: 'system' was not declared in this scope|
C:\Users\meta\Documents\My Dropbox\school\semester 2\comp1200 - c++\Assignments\assignment_1\assignment_1.cpp||In function 'void printResults(std::string, int, int, double, double)':|
C:\Users\meta\Documents\My Dropbox\school\semester 2\comp1200 - c++\Assignments\assignment_1\assignment_1.cpp|135|error: 'system' was not declared in this scope|
C:\Users\meta\Documents\My Dropbox\school\semester 2\comp1200 - c++\Assignments\assignment_1\assignment_1.cpp|136|error: 'exit' was not declared in this scope|
||=== Build finished: 3 errors, 0 warnings ===|


I tried to google this and some said it might be using the Microsoft Visual C++ Compiler, but from what I can tell looking in the options it isn't. I also searched this forum and found a post (link below) but it didn't really provide any helpful information on how to get this fixed. Any information would be gladly appreciated!

http://forums.next.codeblocks.org/index.php/topic,12513.0.html

Code::Blocks Version: 10.05
Operating System: Windows 7 - 64bit

kencamargo

Quote from: rantic on June 03, 2010, 01:05:10 AM
Here are my compile errors for basically every program.

This means that some #include file where those symbols were defined/declared is not being included. Make sure that you have all the directories specified in the "search directories" tab, in the section related to the compiler.

Ken

stahta01

Turning on Full Compiler Logging might help find out what is wrong.

http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Remember to do it for the compiler you are using.

Tim S.

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

infinigon

Have you included <cstdlib>? Both exit and system are defined there, and seeing as you're getting no other errors (e.g. related to cout) that omission could well be the problem.