code not working in codeblocks?

This is a discussion on code not working in codeblocks? within the C++ Programming forums, part of the General Programming Boards category; I know this code should compile right it does fine in dev c++, but for some reason it can't find ...

  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    106

    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
    Posts
    2
    are u sure that u started with

    #include <iostream>

    ?

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    6,284
    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%.

  4. #4
    Registered User
    Join Date
    May 2009
    Posts
    106
    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
    Posts
    50
    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, 07: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

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