WorkingwithWSLEnvironment
SupposeyouneedtouseLinuxtoolchaintobuildaprojectonyourWindows
machine.YoucanuseCygwinforthat,ortryanothersolution-Microsoft
SubsystemforLinux(WSL).WSLisacompatibilitylayerforrunningLinuxbinary
executablesnativelyonWindows10.Fornow,itsupportsUbuntu,OpenSUSEand
SLESdistributions.
WithWSLdeployedonyoursystem,youareabletouseCMake,CandC++
compilersfromLinuxinCLionrunningonyourWindowsmachine.
GettingstartedwithWSL
Let’sstartwiththesimpleinstructiononhowtosetuptheWSLenvironmentin
CLion:
ForStep1,besuretouseWindows10withthelatest“FallCreatorsUpdate”
(minimumversion1709,build16299.15).SeetheofficialguideInstalltheWindows
SubsystemforLinuxforinstructions.
NotethatCLiondoesnotsupportlegacyWSL,whichyoumayhaveinstalledbefore
upgradingyoursystemtothebuild16299.15orhigherofWindows10.Inthiscase,
youneedtoupdateyourWSLdistribution.
1.DownloadandinstallWSLdistribution(forinstance,Ubuntu)from
MicrosoftStore
2.RunUbuntu.Note:uponthefirstlunchofUbuntuthesystemmayprompt
youtoenabletheWindowsoptionalfeature.Inthiscase,youneedto:
OpenWindowsPowerShellasAdministratorandrunthe
following:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-
Linux
Restartyourcomputer.