Code::Blocks Forums

User forums => Help => Topic started by: s1n on May 08, 2010, 08:31:48 am

Title: error: ‘system’ was not declared in this scope
Post by: s1n on May 08, 2010, 08:31:48 am
i am new to code blocks and i am trying to right a simple hello world program but when i go to build it i get this

error: ‘system’ was not declared in this scope   

dose anyone know how i can fix this
Title: Re: error: ‘system’ was not declared in this scope
Post by: s1n on May 08, 2010, 08:36:33 am
sorry i forgot to tell about my system i am running a eee pc i forget the modle number
my os is kubuntu 10.04

thanks for any help you may have
Title: Re: error: ‘system’ was not declared in this scope
Post by: Okaya on May 09, 2010, 03:28:23 am
Hi s1n,

It would help if you can post your program's code here.


Regards,

Okaya
Title: Re: error: ‘system’ was not declared in this scope
Post by: zoogenic on May 18, 2010, 06:10:21 pm
Just
#include <stdlib.h>
Title: Re: error: ‘system’ was not declared in this scope
Post by: stahta01 on May 18, 2010, 06:23:00 pm
Just
#include <stdlib.h>

The first Google result said to install and use GCC G++ command.
First Guess based on that info
1. Install GCC G++
2. Try changing file extension to .cpp

Second guess you are doing an C project with cpp extension
1. Change to use .c extension (lower case c) in C projects.


Tim S.
Title: Re: error: ‘system’ was not declared in this scope
Post by: Hans Henrik on May 18, 2010, 11:16:54 pm
ahh.. why doesn't he get a "where the heck is main" error?