This page details how to set up a working C/C++ development environment for CM/CET using VC14. These instructions were tested on a Windows 1C, verified to work.
Requirements
- Compiler: Visual Studio 2015 (VC14.0, cl 19.00), Visual Studio 2017 (VC15, cl 19.10) & later.
- SDK: Windows SDK 10.0.14393.0 – Included with Visual Studio 2015 Update 3 or as a separate download.
Setup Procedure for Windows 10
- Install Microsoft C++ Build Tools 2015 (VC14) + Windows SDK 10.0.14393
- Download Microsoft C++ Build Tools 2015 from http://go.microsoft.com/fwlink/?LinkId=691126&fixForIE=.exe
- Download Windows SDK 10.0.14393 from https://go.microsoft.com/fwlink/p/?LinkId=838916
- 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 set up:
- Set up a workspace with "Core C++ Lib Sources" checked.
- Start a command prompt from CET Operator (CMD button)
- Go to home/dll/os by typing " cd dll/os"
- Type "make publish", which should build both 32bit and 64bit versions of that dll.
- You now have a working setup if you don't get any errors.
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, 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 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 the compiler is installed. Try verifying the environment variables too.
- "windows.h not found" or similar – You're missing the SDK. Reinstall the SDK and verify the version. Try verifying the 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.
- 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 this would be to run vcvarsall.bat (located in the 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 set up 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/Untested versions: Visual Studio 2012 (VC11, cl 17.00) and 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 the 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
2 comments
What’s the use case for this? Is it possible to debug or add breakpoints for CET using this?
Hi Felipe,
This is used for having something in CET work with other non-CM code external programs written in C# or C++.
Here's an article on how to use dll files.
Please sign in to leave a comment.