[chennes/MantisToGitHub] [MSVC][Build][Permissive-][std:c++latest] FreeCAD failed to build on MSVC

Issue imported from tracker.freecad.org/view.php?id=0004765

  • Reporter: QuellaZhang
  • Date submitted: 2021-10-15
  • FreeCAD version:
  • Category: Bug
  • Status: acknowledged
  • Tags:

Hi All,

The MSVC team recently added FreeCAD as part of RWC testing to detect compiler regressions. And we found some errors when building FreeCAD with ‘/permissive-‘ and ‘/std:c++latest’ option. Can you help to fix these issues? Thanks.

I noticed that some of these errors are come from Boost library, and these issue have been fixed on Boost latest version. After I fixed Boost errors, more errors were exposed by the project itself.

  1. open VS2019 x64 tools command
  2. git clone github.com/FreeCAD/FreeCAD.git F:\gitP\FreeCAD\FreeCAD
  3. download github.com/apeltauer/FreeCAD/releases/tag/LibPack_12.5.2 F:\gitP\FreeCAD\tools\FreeCADLibs_12.5.2_x64_VC17
  4. mkdir F:\gitP\FreeCAD\FreeCAD\build_amd64 && cd F:\gitP\FreeCAD\FreeCAD\build_amd64
  5. set CL= /permissive- or set CL= /std:c++latest
  6. set PATH=F:\gitP\FreeCAD\tools\FreeCADLibs_12.5.2_x64_VC17\bin;%PATH%
  7. set PATH=F:\gitP\FreeCAD\tools\FreeCADLibs_12.5.2_x64_VC17\bin\Scripts;%PATH%
  8. cmake -G “Visual Studio 16 2019” -A x64 -DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DFREECAD_LIBPACK_DIR=F:\gitP\FreeCAD\tools\FreeCADLibs_12.5.2_x64_VC17 -DBUILD_FEM_NETGEN=OFF -DFREECAD_RELEASE_PDB=OFF -DFREECAD_RELEASE_SEH=OFF -DCMAKE_BUILD_TYPE=Release ..
  9. msbuild /m /p:Platform=x64 /p:Configuration=Release FreeCAD.sln /t:Rebuild
  • Priority: normal
  • Severity: minor
  • Category: Bug
  • Updated: 2021-12-22

Thank you for the report — we’ll look into these issues.


github.com/FreeCAD/FreeCAD/commit/833868bd1394862f6fab079fa74685f09675129a fixes one of the issues.


github.com/FreeCAD/FreeCAD/commit/6d2aa6acc9f58d8f8cf0d4744d9a0ed86ac18ed5 fixes another.


github.com/FreeCAD/FreeCAD/commit/6ad156b6b77 fixes another one


and another one: github.com/FreeCAD/FreeCAD/commit/5fba9cec

Read more here: Source link