Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configuring C++ SDK in Intellij IDEA for Windows

I'm trying to configure Intellij to create C/C++ projects. The plugin was installed successfully but when I go to create a new project, I have to setup a Cpp SDK. Is This a path to GCC home or similar (I try it but doesn't works)? How can I perform this configuration?

like image 925
ricardogobbo Avatar asked Oct 02 '22 20:10

ricardogobbo


1 Answers

Here is detailed about the configuration:

Install the plugin. There will appear no special project type for C/C++ projects. Just take/create any Java project, and the plugin will process all *.c/*.cc/*.cpp source files from the project source roots.

Then you need to specify the C/C++ dialect. Open Settings->IDE Settings->C/C++. There are three options, which can be used for tuning:

  • Compiler selector — you may choose between GCC and MS VC dialects

  • Use C dialect — this option makes the compiler to treat the sources like C, not CPP files.

  • GCC executable namegcc is used if this field is left blank. This option is important for GCC configuration autodetection.

To parse the files you also need to specify include paths for your C/C++ environment. Currently, the plugin can automatically detect GCC include paths, in case of other compilers you need to specify the include paths by yourself. Additional include files can be specified for each project separately. Automatic gcc include paths detection works only if your compiler presents in path. If it does not (or if you want to use include-paths of a non-default compiler), then you should specify the name (full name, if necessary) of gcc executable in GCC executable name field.

UPDATE: I would suggest you to try JetBrain's CLion - The intelligent cross-platform C/C++ IDE for cross platform development.
If you are using Visual Studio then use Resharper C++. ReSharper C++ makes Microsoft Visual Studio a much better IDE with refactorings, navigation, code inspections, quick-fixes, code generation and more productivity features for C++ development.

like image 193
haccks Avatar answered Oct 05 '22 13:10

haccks