2015-05-22 45 views
0

試圖編譯中間層的RENDLER在C++與make all後,我收到以下錯誤:編譯錯誤隨着中層RENDLER

$ make all 
g++ -g -O2 -pthread -o rendler rendler.cpp -lmesos -lpthread -lprotobuf 
In file included from /usr/local/include/stout/stringify.hpp:26:0, 
       from /usr/local/include/stout/bytes.hpp:26, 
       from /usr/local/include/mesos/resources.hpp:29, 
       from rendler.cpp:30: 
/usr/local/include/stout/hashmap.hpp:43:32: error: expected ‘)’ before ‘<’ token 
    hashmap(std::initializer_list<std::pair<Key, Value>> list) 
           ^
rendler.cpp:345:1: error: expected ‘}’ at end of input 
} 
^ 
In file included from /usr/local/include/stout/stringify.hpp:26:0, 
       from /usr/local/include/stout/bytes.hpp:26, 
       from /usr/local/include/mesos/resources.hpp:29, 
       from rendler.cpp:30: 
/usr/local/include/stout/hashmap.hpp:40:14: error: expected unqualified-id at end of input 
    hashmap() {} 
      ^
make: *** [rendler] Error 1 

我都安裝以及在相關的第三方庫列出的依賴關係正確包含路徑。嘗試編譯mesos/src/examples目錄中的示例框架時收到相同的錯誤。什麼導致了這個錯誤?

+1

你忘了包括'-std = C++ 11' – NathanOliver

+0

修復了它;謝謝。 – atheatos

回答

0

這段代碼

 std::initializer_list<std::pair<Key, Value>> 
    // ^^^^^^^^^^^^^^^^^^^^^ 

導致錯誤

error: expected ‘)’ before ‘<’ token 

用於預stanadard C++編譯器11中,由於被std::initializer_list最早引入與C++ 11。

大多數最新的編譯器如GCC允許設置-std=c++11選項,該選項可以解決您的錯誤。