gpt4 book ai didi

c++ - 将 GCC 以外的其他编译器附加到 Windows 上的 Clion IDE

转载 作者:可可西里 更新时间:2023-11-01 18:36:47 25 4
gpt4 key购买 nike

我正在使用 Clion 和 minigw-w64 进行开发。 IDE 使用 cmake。

我在 GCC 中发现了一个错误,它迫使我切换编译器,我别无选择。该错误与 gcc 如何处理堆栈对齐有关。 Clion 好像只支持 windows 上的 minigw 和 cygwin,我相信这都是使用 gcc 编译器的工具集。

有没有简单的方法让 Clion/cmake 使用不同的编译器?我读到 clang 与 GCC 非常相似,因为它接受相同的编译器标志,所以我想知道这是否是一个好的选择。我还读过你可以通过更改一些标志来更改 cmake 使用的编译器,但我不知道将它放在哪个文件中,或者如果更改它会破坏与 Clion 的兼容性。

最佳答案

来自 CLion's FAQ

At present CLion supports GCC and Clang compilers and is guided by these two to get the libraries and headers paths. In the next releases we are planning to extend the list of compilers available in CLion.
To change the compiler, go to the Cache tab in CMake tool window and set the compiler’s path to the CMAKE_CXX_COMPILER variable. Then press Enter and click the Apply Changes and Reload button:

enter image description here

Search our issue tracker for feature requests about supporting other compilers to follow or vote on them, or add a new one if it’s missing.

关于c++ - 将 GCC 以外的其他编译器附加到 Windows 上的 Clion IDE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30945416/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com