prusa3d / PrusaSlicer

G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)
https://www.prusa3d.com/prusaslicer/
GNU Affero General Public License v3.0
7.71k stars 1.93k forks source link

PrusaSlicer failed to build deps due to LNK1394 and error C2220 with MSVC on windows in ASAN mode #8784

Closed spacelg closed 8 months ago

spacelg commented 2 years ago

Description of the bug

Hi All,

Environment: VS 2019 + Windows Server 2019

PrusaSlicer failed to build deps due to 'LINK : fatal error LNK1394: cannot infer default ASAN libraries; please specify them on the link command line' and 'error C2220: ... the following warning is treated as an error' with MSVC on windows in ASAN mode. Could you please help look at this issue?

And it can build pass in non-ASAN mode.

Project file & How to reproduce

Repro steps:

  1. git clone https://github.com/prusa3d/PrusaSlicer F:\gitP\prusa3d\PrusaSlicer
  2. Open a VS2019 x64 command.
  3. cd F:\gitP\prusa3d\PrusaSlicer\deps && mkdir PrusaSlicer-deps && cd F:\gitP\prusa3d\PrusaSlicer\deps\PrusaSlicer-deps
  4. set CL= /fsanitize=address /GS- /wd5072 & set LINK= /InferASanLibs /incremental:no /debug
  5. cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DCMAKE_BUILD_TYPE=Release ..
  6. msbuild /m /p:Platform=x64 /p:Configuration=Release ALL_BUILD.vcxproj /t:Rebuild

Errors: 19>LINK : fatal error LNK1394: cannot infer default ASAN libraries; please specify them on the link command line [F:\gitP\prusa3d\PrusaSlicer\deps\PrusaSlicer-deps\dep_GLEW-prefix\src\dep_GLEW-build\glew.vcxproj] [F:\gitP\prusa3d\PrusaSlicer\deps\PrusaSlicer-deps\dep_GLEW.vcxproj] ... 16>F:\gitP\prusa3d\PrusaSlicer\deps\PrusaSlicer-deps\dep_TBB-prefix\src\dep_TBB\include\oneapi\tbb\detail_utils.h(289): error C2220: <func:#14136 "??$run_initializer@Vlambda_38710ea00aac6a4251ba39913ba67f6a>@@@d0@detail@tbb@@YAXAEBV<lambda_38710ea00aac6a4251ba39913ba67f6a@@AEAU?$atomic@W4do_once_state@d0@detail@tbb@@@std@@@Z"> the following warning is treated as an error [F:\gitP\prusa3d\PrusaSlicer\deps\PrusaSlicer-deps\dep_OpenVDB-prefix\src\dep_OpenVDB-build\openvdb\openvdb\cmd\vdb_print.vcxproj] [F:\gitP\prusa3d\PrusaSlicer\deps\PrusaSlicer-deps\dep_OpenVDB.vcxproj]

build_deps_asan.log

Checklist of files included above

Version of PrusaSlicer

master branch dba1179 commit

Operating system

Windows Server 2019

Printer model

not clear

lukasmatena commented 8 months ago

Closing, outdated.