簡體   English   中英

AndroidStudio C ++編譯器選項

[英]AndroidStudio C++ Compiler Options

嘗試運行包含C ++文件的代碼時,出現以下錯誤-

Error:(32, 2) error: This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

如何解決? 這是我的第一個涉及C ++文件的項目。

我已經重建了項目,並在“自定義C ++支持”頁面中使用C ++ 11代替了ToolChain Default。 我認為這是解決此問題的骯臟方法。

在android-> defaultConfig下的應用程序構建gradle中,您可以添加/更改以下內容

externalNativeBuild {
        cmake {
            cppFlags "-std=c++11"
        }
    }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM