User forums > Using Code::Blocks

Enjoying C++11 Experience with Code::Blocks

<< < (2/3) > >>

cpp_lover:
Thank you. I put the following:

-std=c++0x -U__STRICT_ANSI__

But I am having a strange problem.

I have it in the beginning of my code: #include <iostream>

Yet, I am having this strange error: "undefined reference to std::cout"

Purplexing. :-(

killerbot:

--- Quote from: thomas on August 29, 2012, 01:06:25 pm ---Better use -std=c++0x -U__STRICT_ANSI__ or you will run into trouble when including headers like cstdio (or when using a third-party library that does this).

Other than that, nothing to be done.

--- End quote ---
Could you explain a bit more Thomas, about those potential issues ?
We are using '-std=c++0x" for 2 years (without -U__STRICT_ANSI__), and that header has been included, haven't seen any problems.

eranif:
With GCC4.6.1-TDM you should use:

--- Code: ----std=gnu++0x
--- End code ---

Eran

zabzonk:

--- Quote ---With GCC4.6.1-TDM you should use: -std=gnu++0x
--- End quote ---

Why? -std=c++0x works perfectly well.

zabzonk:

--- Quote ---Yet, I am having this strange error: "undefined reference to std::cout"

--- End quote ---

That's a linker error, including <iostream> is not sufficient to solve it - for some reason you are not linking with the C++ libraries.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version