Thread: code not working in codeblocks?

  1. #1
    Registered User
    Join Date
    May 2009

    code not working in codeblocks?

    I know this code should compile right it does fine in dev c++, but for some reason it can't find the header file iostream? Is there something different that you have to do in codeblocks or something?

  2. #2
    Registered User
    Join Date
    Nov 2009
    are u sure that u started with

    #include <iostream>


  3. #3
    Registered User
    Join Date
    Jun 2005
    The CodeBlocks installation installs a compiler by default (a GCC variant, I'm not sure offhand which one). Since different compilers and compiler versions often rely on a set of environment variables being set, it is quite possible there is a conflict between the compiler associated with Dev C++ and the one with codeblocks. These sorts of problems can also happen if you configure CodeBlocks to use another compiler. Look at the compilation options (within project settings).

    If you've selected a different (non-default) compiler for CodeBlocks to use, check the age of that compiler. Some older compilers (dating from mid 90s and earlier) do not support <iostream>.
    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, Buttercup, and read this, this, and this before posting again.

  4. #4
    Registered User
    Join Date
    May 2009
    I found out what the problem was... tough i specified it to work for c++ programs for come reason it was trying to compile it as c code therefore it didnt work... I changed that and now it works

  5. #5
    Grey Wizard C_Sparky's Avatar
    Join Date
    Sep 2009
    Compiler mix ups are super annoying, I had this same problem with installing OpenGL and Glut, I ended up doing system restore and just doing OpenGL on a different computer.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. problem with previously working internet code
    By abachler in forum Windows Programming
    Replies: 11
    Last Post: 04-10-2009, 04:11 AM
  2. Code not working?
    By Elysia in forum C++ Programming
    Replies: 12
    Last Post: 04-06-2009, 01:57 AM
  3. Replies: 3
    Last Post: 02-24-2009, 08:49 PM
  4. C code not working
    By D3ciph3r in forum C Programming
    Replies: 2
    Last Post: 05-27-2005, 04:13 PM
  5. Trying to eject D drive using code, but not working... :(
    By snowfrog in forum C++ Programming
    Replies: 3
    Last Post: 05-07-2005, 07:47 PM