Warning when using hash_map in C ++

Source: Internet
Author: User

When hash_map is used in C ++, the warning is as follows:


[Html]
.............
/Usr/lib/gcc/x86_64-redhat-linux/4.4.7 /.. /.. /.. /.. /include/c ++/4.4.7/backward/backward_warning.h: 28: 2: Warning: # warning This file has des at least one deprecated or antiquated header which may be removed without further notice at a future date. please use a non-deprecated interface with equivalent functionality instead. for a listing of replacement headers and interfaces, consult the file backward_warning.h. to disable this warning use-Wno-deprecated.
..............

.............
/Usr/lib/gcc/x86_64-redhat-linux/4.4.7 /.. /.. /.. /.. /include/c ++/4.4.7/backward/backward_warning.h: 28: 2: Warning: # warning This file has des at least one deprecated or antiquated header which may be removed without further notice at a future date. please use a non-deprecated interface with equivalent functionality instead. for a listing of replacement headers and interfaces, consult the file backward_warning.h. to disable this warning use-Wno-deprecated.
..............


If used, an error is reported.

Solution to errors and Warnings:


[Html]
Set (CMAKE_CXX_FLAGS "-std = c ++ 0x-Wno-deprecated ")

Set (CMAKE_CXX_FLAGS "-std = c ++ 0x-Wno-deprecated ")
Add the-std = c ++ 0x and-Wno-deprecated options in CXX_FLAGS.

 


C ++ 0x indicates the new C ++. -Wno-deprecated indicates that warnings such as no-deprecated are ignored.


 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.