2016年3月24日 星期四

Multiple “could not be resolved” problems using Eclipse

最近用eclipse的時候遇到一個很奇怪的問題
我在使用C++11的新功能 chrono的時候 會發現我已經更改了
Properties > C/C++ Build > Setting > GCC C++ Complier
> Dialet  > Language standard = ISO C++1y (-std=c++1y)

但在build project的時候, 會出現很多很多error, 雖然最後仍然可以成功的build出程式
可是無法使用eclipse 來執行程式, 只能用terminate 來啟動

後來上網查到解決辦法

***
Go to Project -> Properties -> C/C++ General -> Preprocessor Include Paths, Macros, etc. -> Providers -> CDT GCC built-in compiler settings, deactivate Use global provider shared between projects and add the command line argument -std=c++11.

The eclipse live code analysis does not share the same settings with the build compiler. You can also change the setting globally (not just for the project) in Window -> Preferences -> C/C++ -> Build -> Settings -> CDT GCC Built-in Compiler Settings.

**
更改完這些設定之後Rebuild project 
錯誤訊息就會消失了!

沒有留言:

張貼留言