User forums > General (but related to Code::Blocks)

Code::block how to support C++0x

<< < (2/4) > >>

oBFusCATed:
Read this: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29

zabzonk:
@hqt

Firstly, check that you can build your code from the command line (i.e outside of Code::Blocks).

Then check that your CB toolchain settings are pointing at the up-to-date compiler - go to Settings|Compiler & Debugger, then go to the Toolchain Executables tab and make sure the path in the first field is pointing to the up-to-date TDM installation.

If you still can't compile, compile this simple program:


--- Code: ---int main() {
     auto x = 1;
}

--- End code ---

and post the resulting build log here.

hqt:
@: My code has tested successfully on Microsoft Visual Studio 2010, which supported C++0x.
I have installed newest TDM installation. For example, in D:\C++0x\
 a) I go to toolchain Executables tab and typing above path. (and I have tried D:\C++0x\bin\, too) But, when I compiled, nothing compiled yet, mean that Code::block doesn't recognize my installation, yet.
 b) If I use old version of MinGW, I still have option: [-std=c++0x] in Compiler Setting tab, but when I compiled, of course Compiler has error :(

@: for your program, when compile, It will have this error:  ISO C++ forbids declaration of 'x' with no type.  (of course !!!)

So, who give me some advice, please.
thanks :)

oBFusCATed:
Do you use the correct compiler for you project?
You can check in "Project->Build options->Selected compiler"

zabzonk:
@hgt

Did you do this;

> Firstly, check that you can build your code from the command line (i.e outside of Code::Blocks).

If you can't get that to work, there is no point in messing with CB settings.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version