如何在 Linux 上的 IntelliJ IDEA 中设置 C++ SDK?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6479789/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 04:44:41  来源:igfitidea点击:

How setup C++ SDK in IntelliJ IDEA on linux?

c++linuxubuntusdkintellij-idea

提问by deadfish

I need to know how to configure the path to C++ SDK for IntelliJ IDEA 10.04. I installed C/C++ plugin, however I don't know what is the proper path to C++ SDK.

我需要知道如何为 IntelliJ IDEA 10.04 配置 C++ SDK 的路径。我安装了 C/C++ 插件,但是我不知道 C++ SDK 的正确路径是什么。

I am using ubuntu 11.04.

我正在使用 ubuntu 11.04。

采纳答案by bsautner

after installing the c++ plugin you should see the C/C++ project option when you create a new module - i think you're seeing the point where it's asking you for the cpp sdk location.

安装 c++ 插件后,您应该在创建新模块时看到 C/C++ 项目选项 - 我认为您看到了它要求您提供 cpp sdk 位置的点。

run

sudo aptitude install build-essential

Then restart intellij - it should autodetect that it's installed and offer you the option in the drop down instead of asking you to browse to the SDK directory

然后重新启动 intellij - 它应该自动检测它已安装并在下拉列表中为您提供选项,而不是要求您浏览到 SDK 目录

回答by spy-killer

after running

跑完后

sudo aptitude install build-essential

then restart idea and go to terminal and run

然后重新启动idea并转到终端并运行

which gcc

now copy the output into ideas settings -> IDE settings -> c/c++ and paste what you copied into the path to gcc.

现在将输出复制到想法设置 -> IDE 设置 -> c/c++ 并将你复制的内容粘贴到 gcc 的路径中。

do the same process for the gdb

对 gdb 执行相同的过程

after doing that then idea will add the sdk to the drop down menu in the create project menu

这样做之后,idea 会将 sdk 添加到创建项目菜单的下拉菜单中