Within all the code in CET, parts of it includes C/C++ code like dll files which requires a C/C++ development environment.
This page details how to setup a working C/C++ development environment for CM/CET using VC14.
These instructions were tested on a Windows 10 PC, verified to work, and last updated on 2020/08/26.
Requirements
- Compiler: Visual Studio 2015 (VC14.0, cl 19.00) / Visual Studio 2017 (VC15, cl 19.10) & later should work as well.
- SDK: Windows SDK 10.0.14393.0 or later – Included with Visual Studio 2015 Update 3 or as separate download.
Setup Procedure for Windows 10
- Install Microsoft C++ Build Tools 2015 with Update 3 (VC14) + Windows SDK 10.0.14393
- Download Microsoft C++ Build Tools 2015 with Update3 from https://my.visualstudio.com/Downloads?q=visual%20studio%202015&wt.mc_id=o~msft~vscom~older-downloads
- Download Windows SDK 10.0.14393 from
https://go.microsoft.com/fwlink/p/?LinkId=838916
- During Installation, please make sure you have the following checked:
- Visual C++: Common Tools, Microsoft Foundation Classes (MFC), XP Support.
- Universal Windows App Development Tools: Tools and Windows 10 SDK (10.0.14393) – If you don’t see this, ensure Update 3
- After installation is done, click on Setup > Settings in CET Operator, then set the VCVersion value to 14. The upcoming operator versions should already have this set by default.
- To verify your setup:
- Setup a workspace with "Core C++ Lib Sources" checked.
- Start a command prompt from operator (CMD button)
- Go to home/dll/os by typing ”cd dll/os”
- Type ”make new”, which should build both 32bit and 64bit version of that dll.
- If you don’t get any errors, you now have a working setup.
Other Info
Alternative Method with Visual Studio
If you want to install Visual Studio instead, you will need Microsoft Visual Studio Community 2015 Update 3, which includes both the correct compiler and SDK.
- Download from https://visualstudio.microsoft.com/vs/older-downloads/
- Run setup and ensure at minimum the following is checked :
- Visual C++: Common Tools, Microsoft Foundation Classes (MFC), XP Support
- Universal Windows App Development Tools: Tools and Windows 10 SDK (10.0.14393) – If you don’t see this, ensure Update 3
- Perform the same step 2 and step 3 according to the section above.
Troubleshooting
- ”cl: command not found” – You’re missing the compiler. Reinstall visual studio/build tools and ensure compiler is installed. Try verifying environment variables too.
- ”windows.h not found” or similar – You’re missing the SDK. Reinstall the SDK and verify version. Try verifying environment variables too. Make sure you are using the correct version of Windows SDK, or make sure you do not have wrong references to different SDK such as /D_WIN32_WINNT=0x501
- Missing afxres.h - Please make sure your Visual Studio C++ installation include Microsoft Foundation Classes (MFC).
- ”include mps.h not found” or similar – Try ensuring that C++ Lib Sources is checked in Workspace.
- "MPS package.h not found" - Check your makefile, and if your source code is located in a different location other than base, try adding the path to MPPFLAGS. Syntax for adding path is /I<path>. Example: MPPFLAGS += /I$(CM_UNIX_ROOT)/extensions
- Path or environment variables issues - Normally operator magically setups these path envs for you, but in some cases, the envs are messed up. A quick way to rectify would be to run vcvarsall.bat (located in VC installation folder, for example for vc14: "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"). The exact command to be run is "vcvarsall.bat x64" - you need to pass in x64 as a parameter. This should setup all the necessary paths correctly (including Windows SDK paths etc).
Legacy/Unsupported Versions
- Visual Studio 2010 (VC10.0, cl 16.00) - Require Windows SDK v7.0a or v7.1
- If you need an older VC++ compiler for legacy development, just install this and set VCVersion accordingly.
- Unsupported versions: Visual Studio 2012 (VC11, cl 17.00), Visual Studio 2013 (VC12, cl 18.00)
Helpful Links
- Windows SDK Archive
https://developer.microsoft.com/en-us/windows/downloads/sdk-archive - Visual C++ Build Tools
http://landinghub.visualstudio.com/visual-cpp-build-tools - Visual Studio Community 2015 (Login required, in case you can't get 2015 from link above) -https://my.visualstudio.com/Downloads?q=2015
- Windows SDK 10.0.14393 can also be obtained using the C++ Build Tools 2017 installer.
Comments
0 comments
Please sign in to leave a comment.