Sorry for what is most likely a very ‘newbie’ question, but I’m having a slight problem with running C++ code in code::blocks. A little bit about what I’m doing then, basically I’m following Bjarne Stroustrup’s ‘Programming: Principles and Practice using C++’. I’m really just starting the book, and to do so I am using code::blocks on Ubuntu 12.04. Anyway for the first hello world example I did the following:
first set up a new project -> selected console application -> selected C++ as my language -> entered in the name of the project -> selected GNU GCC Compiler (from reading and searching around this might be the problem) -> and finally entered the code.
I’ve also made sure to properly download and save the ‘std_lib_facilities.h’ header file. After doing all this I entered in the simple hello world code as shown below. On building the code it produced the following warning (no errors though): ‘#warning This file includes at least one deprecated or antiqued header which may be removed…’ which when clicked on leads me to ‘backward_warning.h’. However I can still run the code which produces the hello world to appear fine, like it should. This might imply I don’t have a problem, but with the warning still present, I was just wondering if there is a fix or if it even means anything is wrong, as I don’t want to find that in later examples this proves to be a problem. This might all seem like a silly question, but I’m new to C++ and still quite new to programming in general, so apologies in advance. And here is my code:
#include "../std_lib_facilities.h"
int main()
{
cout<<"Hello World";
return 0;
}
It is most likely
<hash_map>or<ext/hash_map>.A replacement would be C++11’s
<unordered_map>, or C++03’s<tr1/unordered_map>.If you are using GCC, you can access C++11 functionality by adding the
std=c++0xcompilation flag. This will allow you to use<unordered_map>.