I have Eclipse Neon.2 installed for Java, however, I am working on a project that involves JNI so I have had to set up Eclipse for C++. To do this I downloaded the Development Tools for C++
under Help -> Install New Software
. My problem is there are no available toolchains
available for my C++ project.
Several websites and YouTube videos have suggested that there is a Microsoft Visual C++ toolchain available, such as this SO question and this video, but I have had no success.
Is there a setup stage or plugin I could have missed that is causing it not to be listed?
Setup
Windows 10
Eclipse Neon.2
Microsoft Visual Studio Enterprise 2017 RC
The Visual Studio build tools include a C compiler that you can use to create everything from basic console programs to full Windows Desktop applications, mobile apps, and more.
To create a new managed build project select the File->New->C/C++ Project entry from the File Menu. In the New C/C++ project dialog select “C Managed Build”. Click Next. In this next screen, the project name and location should be set as well as the toolchain.
Eclipse CDT uses C/C++ Compiler. Hence before we can start using Eclipse CDT for C/C++ development, we need to have a proper GCC compiler on our system. We can either have 'MinGW' or 'Cygwin' compiler on our machine that will be used by eclipse.
Steps to get Eclipse building "Hello World" with MSVC:
C:\Users\drodgers\eclipse\cpp-2019-12\eclipse\eclipse.exe
), and hit Enter. You're now running Eclipse again, but with all the VS environment variables present.#include <iostream>
and red squiggles under std
, cout
, and endl
because Eclipse doesn't know where to find all the include files. Let's fix that.${VCToolsInstallDir}
in the dialog (or just type it). Then append /include
so that it reads ${VCToolsInstallDir}/include
. (Backslash works too... but see below.) Check the "Add to all configurations" and "Add to all languages" boxes. Your dialog should look like this:21:12:43 **** Rebuild of configuration Debug for project wibble ****
Info: Internal Builder is used for build
cl /c /EHs /MD /Zi "/IC:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.24.28314\\\\include" /nologo "/Fosource\\wibble.obj" "..\\source\\wibble.cpp"
wibble.cpp
link /debug /nologo /OUT:wibble.exe "source\\wibble.obj"
21:12:44 Build Finished. 0 errors, 0 warnings. (took 1s.594ms)
C:\Users\drodgers\batch
), create eclipse.bat
containing the full path to Eclipse, and then edit your environment variables to add the new directory to your user variables' "Path" setting. Now when you run the Dev Command Prompt, you only have to type eclipse
to launch Eclipse.(Disclaimer: I can't take full credit for this answer, because I found the guts of it here. But I couldn't find a SO post that offered this solution, so I'm posting it myself.)
EDIT: Been playing a bit more, and there's some quality of life stuff that needs to be added. For whatever reason, MS doesn't include ctype.h
or a number of other "standard" headers in its main include directory, so items like isxdigit()
will be flagged red as Function isxdigit() could not be resolved
. To fix this:
${VCToolsInstallDir}/include
and ${WindowsSdkDir}/Include/${UCRTVersion}/ucrt
. Note I used forward slashes; they work fine with Eclipse on Windows systems. If I use backslashes in that second path instead, Eclipse starts invoking substitution escapes and you won't get the right path, so don't do that.Now you shouldn't have any unresolved symbols in your editor (at least for standard C/C++ stuff).
Well, I think you should install either windows SDK 7, 8 or Visual C++ 2015 Build Tools.
I tested windows SDK 7 with eclipse neon. You can find a quick installation guide here.
but I don't know what will happen with Visual C++ 2015 Build Tools. This tools is introduced in my blog - even written in korean but with full of images.
Then, you can find my another answer.
Finally, you have two check points comparing with what you have done.
The one is
Anther one is
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With