Author Topic: error: ‘system’ was not declared in this scope  (Read 13967 times)

Offline s1n

  • Single posting newcomer
  • *
  • Posts: 2
error: ‘system’ was not declared in this scope
« 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

Offline s1n

  • Single posting newcomer
  • *
  • Posts: 2
Re: error: ‘system’ was not declared in this scope
« Reply #1 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

Offline Okaya

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: error: ‘system’ was not declared in this scope
« Reply #2 on: May 09, 2010, 03:28:23 am »
Hi s1n,

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


Regards,

Okaya

zoogenic

  • Guest
Re: error: ‘system’ was not declared in this scope
« Reply #3 on: May 18, 2010, 06:10:21 pm »
Just
#include <stdlib.h>

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7678
    • My Best Post
Re: error: ‘system’ was not declared in this scope
« Reply #4 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Hans Henrik

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: error: ‘system’ was not declared in this scope
« Reply #5 on: May 18, 2010, 11:16:54 pm »
ahh.. why doesn't he get a "where the heck is main" error?