2016-07-27 77 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 }; –