2016-07-27 51 views
-2

我试图编译我的项目,它包含了很多的文件,它需要3个库GSL,libxml的,提高 当我给终端g ++命令在Ubuntu 14.04LTS错误Boost库

g++ -Wall -I/usr/include/libxml2 -I/usr/include/gsl main.cpp YUNucNet.cpp src/*.cpp -lxml2 -lgsl -lm -lgslcblas -lboost_system -lboost_filesystem 

它给了我这些错误

In file included from /usr/include/boost/lexical_cast.hpp:34:0, 
/usr/include/c++/4.8/typeinfo:39:37: error: expected ‘}’ before end of line 
#pragma GCC visibility push(default) 
           ^
/usr/include/c++/4.8/typeinfo:39:37: error: expected unqualified-id before end of line 
/usr/include/c++/4.8/typeinfo:39:37: error: expected declaration before end of line 

会是什么问题????我无法得到它。

thanx

回答

0

默认值是一个C++ 11令牌。 您需要使用-std = C++ 0x或类似的东西进行编译。确保你的gcc足够新以支持这些事情。

+0

我该怎么做? –

+0

你真的不很容易使你... G ++ -std =的C++ 0x -Wall -I/usr/include目录/ libxml2的-I/usr/include目录/ GSL的main.cpp YUNucNet.cpp的src/*的.cpp -lxml2 -lgsl -lm -lgslcblas -lboost_system -lboost_filesystem 正如我建议 – Clusty

+0

还是它给了我这些错误/usr/include/features.h:374:0, 包括 在文件从/ usr/include目录/x86_64-linux-gnu/c++/4.8/bits/os_defines.h:39, 从/usr/include/x86_64-linux-gnu/c++/4.8/bits/c++config.h:426, 从/ USR /包括/ C++/4.8 /的iostream:38, 从main.cpp中:1: /usr/include/math.h:28:1:错误:前字符串常量 __BEGIN_DE预期不合格-ID CLS ^ main.cpp:13:2:error:expected'}'in input of end }; –