天天看點

MAC編譯OpenJDK8:iostream file not found(獨家解決辦法)

  吾第一次編譯沒這個錯誤,後來又出現了。網上的辦法都沒用。隻好自己解決。仔細一想,這個錯誤其實很簡單啊,就是找不到檔案。隻要找到就行了。順着這個思路,吾找到解決辦法。

  • 安裝頭檔案
https://blog.csdn.net/quantum7/article/details/108466760
  • 查找iostream的位置

起始位置應該是:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++

  • 設定環境變量
NEW_INCLUDE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1
export.  CFLAGS=-I$NEW_INCLUDE
export CXXFLAGS=-I$NEW_INCLUDE      

再次編譯,通過。

繼續閱讀