Thread: I need help with compiler in Code:Blocks !

  1. #1
    Registered User
    Join Date
    May 2016
    Posts
    2

    I need help with compiler in Code:Blocks !

    I`m sending a picture of Code:Blocks environment.
    I used a for loop while writing a program and my compiler is complaining saying that initial declarations in `for` loop are only allowed in C99 or Cll mode. Is there some option so I can configure my compiler ? Help, I have no idea what to do.
    Attached Images Attached Images I need help with compiler in Code:Blocks !-c-program-jpg 

  2. #2
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    Obviously, the problem is with your code. Why don't you paste that? Use code tags, please.
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  3. #3
    Registered User taazz's Avatar
    Join Date
    May 2016
    Posts
    50
    Open the menu "project->build options" select the compiler flags tabs and select either enable on of the standards required for the loop declarations to work eg -std=c99 or preferably -std=c++11

  4. #4
    Registered User
    Join Date
    May 2016
    Posts
    2
    @taazz Thank you! It did the trick but when I closed the Code::Blocks and opened it, tried to write a new program and checked if it stayed selected and it didn`t. Can I do something so it would stay permanently selected ?

  5. #5
    Registered User taazz's Avatar
    Join Date
    May 2016
    Posts
    50
    As the menu name hints that option is project specific. I think you have to enable it from the menu "settings->compiler" for a wider use but I'm not 100% sure my self either.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. problem with code::blocks compiler
    By iceddragon117 in forum C++ Programming
    Replies: 11
    Last Post: 04-23-2012, 12:06 PM
  2. code:blocks can't find a compiler
    By vrkiller in forum C++ Programming
    Replies: 8
    Last Post: 01-06-2011, 11:08 AM
  3. Output from Code::Blocks Compiler
    By zilefac in forum C++ Programming
    Replies: 4
    Last Post: 08-21-2010, 01:19 PM
  4. Replies: 1
    Last Post: 01-11-2008, 09:34 AM

Tags for this Thread