Problem with code::blocks

This is a discussion on Problem with code::blocks within the C Programming forums, part of the General Programming Boards category; I'm always having problem with code::blocks. Anytime time i run a code, even the so simple "Hello World", i get ...

  1. #1
    Registered User
    Join Date
    Jun 2012
    Location
    Nigeria
    Posts
    15

    Problem with code::blocks

    I'm always having problem with code::blocks. Anytime time i run a code, even the so simple "Hello World", i get a Script Compile Error.
    It says:
    Filename: CommandLine
    Error: end of statement expected (; or If)
    Details:

    I followed the instructions on cprogramming.com Any help on that? Please. TIA

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,662
    If "CommandLine" is the name of your project (or source file) then the code may be failing to compile..... probably due to a missing semi-colon.

    If it's not that, then your installation is broken. Ensure you have a valid download (installer or not, depending on your preferences). Then uninstall and reinstall.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Sunshine, and read this, this, and this before posting again.

  3. #3
    Dweeb dojha00's Avatar
    Join Date
    Feb 2012
    Location
    Global
    Posts
    23
    If You are sure about your program then try another compiler.
    which compiler r you using right now??

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,852
    Assuming you're using windows, did you get the whole package?

    codeblocks-10.05-setup.exe 27 May 2010 23.3 MB BerliOS or Sourceforge.net
    This one is just the IDE - it allows you to edit and save files, but not build them

    codeblocks-10.05mingw-setup.exe 27 May 2010 74.0 MB BerliOS or Sourceforge.net
    This contains EVERYTHING you need, including the compiler and associated tools.

    You need the one with mingw included the first time you install it. If you then go for code::blocks updates, you then only need to download the smaller IDE only package.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Registered User
    Join Date
    Jun 2012
    Location
    Nigeria
    Posts
    15
    Quote Originally Posted by grumpy View Post
    If "CommandLine" is the name of your project (or source file) then the code may be failing to compile..... probably due to a missing semi-colon.

    If it's not that, then your installation is broken. Ensure you have a valid download (installer or not, depending on your preferences). Then uninstall and reinstall.
    the code is very correct. I downloaded a new codeblock and the error still occured.

  6. #6
    Registered User
    Join Date
    Jun 2012
    Location
    Nigeria
    Posts
    15
    Quote Originally Posted by dojha00 View Post
    If You are sure about your program then try another compiler.
    which compiler r you using right now??
    am using dev c++

  7. #7
    Registered User
    Join Date
    Jun 2012
    Location
    Nigeria
    Posts
    15
    Quote Originally Posted by Salem View Post
    Assuming you're using windows, did you get the whole package?

    codeblocks-10.05-setup.exe 27 May 2010 23.3 MB BerliOS or Sourceforge.net
    This one is just the IDE - it allows you to edit and save files, but not build them

    codeblocks-10.05mingw-setup.exe 27 May 2010 74.0 MB BerliOS or Sourceforge.net
    This contains EVERYTHING you need, including the compiler and associated tools.

    You need the one with mingw included the first time you install it. If you then go for code::blocks updates, you then only need to download the smaller IDE only package.
    smaller IDE from codeblock?

  8. #8
    Registered User
    Join Date
    May 2012
    Location
    Arizona, USA
    Posts
    383
    Dev-C++ is a different IDE, which AFAIK uses the MinGW GCC compiler. What is the exact error you are receiving when you try to compile your "very correct" program?

    By the way, what is the exact name of your source file? Is it CommandLine, CommandLine.c, CommandLine.cpp, or something else? If you leave off the extension (ie, just CommandLine), the IDE might try to use your source as a build script or something like that. Be sure to give it the proper extension (.c).

  9. #9
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,852
    > smaller IDE from codeblock?
    No!
    The smaller exe is just the IDE
    The larger exe is the IDE and the compiler.

    If you've got a compiler, you can use anything you like to edit a text file and compile it from the command line.
    The IDE is there just to make the process smoother, especially when you have multiple files.

    If you've just got the IDE and no compiler, then you're screwed - you're not going anywhere.

    > the code is very correct. I downloaded a new codeblock and the error still occured.
    We'll be the judge of that.
    You can't even make it compile, so there's no telling where the fault is (you can't tell, that's why you're posting here).
    Just present the facts and save the diagnostics to the rest of us.

    PS
    I think some screen shots of your attempts so far are in order.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  10. #10
    Registered User
    Join Date
    Jun 2012
    Location
    Nigeria
    Posts
    15
    Quote Originally Posted by christop View Post
    Dev-C++ is a different IDE, which AFAIK uses the MinGW GCC compiler. What is the exact error you are receiving when you try to compile your "very correct" program?

    By the way, what is the exact name of your source file? Is it CommandLine, CommandLine.c, CommandLine.cpp, or something else? If you leave off the extension (ie, just CommandLine), the IDE might try to use your source as a build script or something like that. Be sure to give it the proper extension (.c).
    Thanks for the advice, i found the mistake was from the extension as you said.

    Thanks to the rest of you also. Am grateful

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, 01:06 PM
  2. Code::Blocks run problem
    By Coga1900 in forum C++ Programming
    Replies: 34
    Last Post: 09-20-2011, 04:49 AM
  3. compilation problem........code::blocks...
    By Souradeep in forum C++ Programming
    Replies: 3
    Last Post: 12-20-2010, 03:04 AM
  4. Code Blocks compiling problem
    By Lehsyrus in forum Tech Board
    Replies: 2
    Last Post: 07-13-2010, 03:28 PM
  5. Code::Blocks problem
    By eaane74 in forum C++ Programming
    Replies: 6
    Last Post: 05-24-2007, 08:24 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21