PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Toolchain and Make System  (Read 86 times)

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 9287
  • Windows 10
    • PlanetSquires Software
Toolchain and Make System
« on: June 03, 2020, 10:12:10 PM »

In order for Visual Studio Code to compile and/or debug your code, you must install a toolchain. Because we are using a portable version of VSCode, it is easier for use to work with the GCC family of toolchains. These are not native to Windows but the available ports do play nicely with portable setups.

TDM-GCC-64

Download a recent TDM-GCC-64 build from: https://jmeubank.github.io/tdm-gcc/download/

Select the one called “MinGW-w64 based”. During the installation process install it to the default folder specified, etc. Once installed, copy the entire folder from the installation folder (c:\tdm-gcc-64) to under the “vscode\data\tools” folder (create that tools folder yourself if you have not already done so) for your portable VSCode installation. Once you finish the copy, go into Windows Control Panel and Uninstall TDM-GCC-64 because you no longer need it anymore (we will now use the one that you copied to the vscode\data\tools folder).

Additional step for TDM-GCC-64 (important): I noticed that using this toolkit would fail when trying to initiate a Debugging session.

Here is how to fix it:

Use Windows file explorer to navigate to your \vscode\data\tools\TDM-GCC-64\bin folder. Make a copy of the gdb.exe file. Rename that copy from gdb – Copy.exe to x86_64-w64-mingw32-gdb.exe

CMake Build System

Download the CMake package from https://cmake.org/download/ get the “Binary distribution” and select the zip file download: Windows win64-x64 ZIP. Extract that zip so that it is in a folder off of vscode\data\tools

I have also evaluated using the mingw-64 8.1 toolchain but I have found that the TDM-GCC-64 works better (and seems to compile faster as well). Actually, TDM-GCC-64 is built using mingw-64 but specific changes an additions were made in order for the toolchain to work better on Windows systems.

I also downloaded and installed the LLVM toolchain (which includes the Clang compiler) into app\LLVM. However, during testing, the Clang compiler will not get recognized because I assume it can not find the MS Build Tools (I haven’t found a way to set that up as portable yet).

I already had Microsoft Build Tools installed (from previously installing Visual Studio Community Edition). It appears that Clang uses the Build Tools (at least on Windows)???? Not 100% sure (I know that it does for Rust but maybe not C++). I have not yet found a way to make the Build Tools portable. You can build/compile using the Build Tools toolchain and will use the Visual C++ compiler. Pretty cool but obviously probably not portable to Linux, etc. For now, until I learn the language better, I will stick with g++ and static linking. Granted the exe’s will be larger but that’s okay.
« Last Edit: June 03, 2020, 11:12:07 PM by Paul Squires »
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer