我通常将警告视为错误来构建。我正在使用 Boost C++ 1.54.0 和 MinGW 4.8.1,特别是我正在使用 ptree。
#include <iostream>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
using namespace std;
int main() {
cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
return 0;
}
这个简单的程序会导致以下错误:
typedef 'cons_element' locally defined but not used [-Wunused-local-typedefs] line 228, external location: \boost\tuple\detail\tuple_basic.hpp
typedef 'Str' locally defined but not used [-Wunused-local-typedefs] line 38, external location: \boost\property_tree\detail\xml_parser_write.hpp
typedef 'Str' locally defined but not used [-Wunused-local-typedefs] line 72, external location: \boost\property_tree\detail\xml_parser_write.hpp
typedef 'T_must_be_placeholder' locally defined but not used [-Wunused-local-typedefs] line 37, external location: \boost\bind\arg.hpp
是一种忽略此警告的方法吗?