How make "boost::stacktrace" work with Clang on Windows? - c++

I am trying to use boost::stacktrace under Clang on Windows.
While it works with the MSVC compiler, using clang-cl instead it just outputs memory addresses like 0x00007FF63D371D14 in main.exe instead of function names and line numbers like foo at main.cpp:7.
Here is a minimal reproducible example:
main.cpp
#include <boost/stacktrace.hpp>
#include <iostream>
void foo() {
const auto stacktrace = boost::stacktrace::to_string(boost::stacktrace::stacktrace());
std::cout << stacktrace;
}
int main() {
foo();
return 0;
}
CMakeList.txt
cmake_minimum_required(VERSION 3.20)
project(test_boost_traceback CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Boost REQUIRED COMPONENTS)
add_executable(main main.cpp)
target_link_libraries(main PRIVATE Boost::boost)
Build commands
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
set BOOST_ROOT=C:/Program Files/boost/boost_1_79_0
set PATH=C:\Program Files\CMake\bin;%PATH%
set PATH=C:\Program Files\Ninja;%PATH%
set CC=clang-cl
set CXX=clang-cl
mkdir build_clang_cl_debug
cd build_clang_cl_debug
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Debug
ninja -v
main.exe
The build for MSVC is the same, just removing the lines that set CC and CXX, and leaving them unset.
Here is the output for MSVC:
[1/2] C:\PROGRA~2\MICROS~2\2022\BUILDT~1\VC\Tools\MSVC\1434~1.319\bin\Hostx64\x64\cl.exe
/nologo /TP -external:I"C:\Program Files\boost\boost_1_79_0" -external:W0
/DWIN32 /D_WINDOWS /EHsc /Zi /Ob0 /Od /RTC1 -MDd -std:c++20 /showIncludes
/FoCMakeFiles\main.dir\main.cpp.obj /FdCMakeFiles\main.dir\
/FS -c test_boost_traceback\main.cpp
[2/2] cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe
--intdir=CMakeFiles\main.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\rc.exe
--mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\mt.exe --manifests
-- C:\PROGRA~2\MICROS~2\2022\BUILDT~1\VC\Tools\MSVC\1434~1.319\bin\Hostx64\x64\link.exe
/nologo CMakeFiles\main.dir\main.cpp.obj /out:main.exe /implib:main.lib /pdb:main.pdb
/version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console
kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib
oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
0# boost::stacktrace::basic_stacktrace<std::allocator<boost::stacktrace::frame> >
::init at C:\Program Files\boost\boost_1_79_0\boost\stacktrace\stacktrace.hpp:76
1# boost::stacktrace::basic_stacktrace<std::allocator<boost::stacktrace::frame> >
::basic_stacktrace<std::allocator<boost::stacktrace::frame> > at
C:\Program Files\boost\boost_1_79_0\boost\stacktrace\stacktrace.hpp:129
2# foo at test_boost_traceback\main.cpp:6
3# main at test_boost_traceback\main.cpp:13
4# invoke_main at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:79
5# __scrt_common_main_seh at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
6# __scrt_common_main at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:331
7# mainCRTStartup at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp:17
8# BaseThreadInitThunk in KERNEL32
9# RtlUserThreadStart in ntdll
Here is the build commands and the output for Clang-cl:
[1/2] C:\PROGRA~2\MICROS~2\2022\BUILDT~1\VC\Tools\Llvm\x64\bin\clang-cl.exe
/nologo -TP -imsvc"C:\Program Files\boost\boost_1_79_0"
/DWIN32 /D_WINDOWS /EHsc /Zi /Ob0 /Od /RTC1 -MDd -std:c++20 /showIncludes
/FoCMakeFiles\main.dir\main.cpp.obj /FdCMakeFiles\main.dir\
-c -- test_boost_traceback\main.cpp
[2/2] cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe
--intdir=CMakeFiles\main.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\rc.exe
--mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\mt.exe --manifests
-- C:\PROGRA~2\MICROS~2\2022\BUILDT~1\VC\Tools\Llvm\x64\bin\lld-link.exe
/nologo CMakeFiles\main.dir\main.cpp.obj /out:main.exe /implib:main.lib /pdb:main.pdb
/version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console
kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib
oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
0# 0x00007FF626A71D24 in test_boost_traceback\build_clang_cl_debug\main.exe
1# 0x00007FF626A71041 in test_boost_traceback\build_clang_cl_debug\main.exe
2# 0x00007FF626A71121 in test_boost_traceback\build_clang_cl_debug\main.exe
3# 0x00007FF626A78059 in test_boost_traceback\build_clang_cl_debug\main.exe
4# 0x00007FF626A7818E in test_boost_traceback\build_clang_cl_debug\main.exe
5# 0x00007FF626A7820E in test_boost_traceback\build_clang_cl_debug\main.exe
6# 0x00007FF626A7822E in test_boost_traceback\build_clang_cl_debug\main.exe
7# 0x00007FFA41D774B4 in C:\Windows\System32\KERNEL32.DLL
8# 0x00007FFA42DA26A1 in C:\Windows\SYSTEM32\ntdll.dll
I tried some of the build options in the boost stacktrace documentation. They all lead to some errors and I am not sure which one applies to Windows and Clang-cl.
How can I make this work?

MSVC uses WinDbg which is shipped with the compiler.
This also works under clang-cl but we need to define the macro BOOST_STACKTRACE_USE_WINDBG and specifically link to ole32.lib and dbgeng.lib as described here.
For CMake we achieved this by adding this (main being our target):
target_link_options(main PRIVATE dbgeng.lib)
target_compile_definitions(main PRIVATE BOOST_STACKTRACE_USE_WINDBG)
The ole32.lib is automatically linked.
This works for both the Debug and RelWithDebInfo. It doesn't work with Release as this strips all the symbols, but that's the same for MSVC.

Related

LNK1181: cannot open input file 'usd.lib' from USD SDK despite linking it in CMake

I have downloaded prebuilt binaries for Pixar's USD SDK, and set up a rudimentary CMake project to use it:
# my-project/CMakeLists.txt
cmake_minimum_required(VERSION 3.8)
project("my-project")
add_subdirectory(thirdparty/usd) # This CMakeLists.txt just calls include(pxrConfig.cmake)
add_executable(my-project "my-project.cpp" "my-project.h")
target_link_libraries(my-project
usd
)
The C++ files are default and don't actually use the USD target yet:
// my-project.h
#pragma once
#include <iostream>
// my-project.cpp
#include "my-project.h"
int main()
{
std::cout << "Hello CMake." << std::endl;
return 0;
}
However, when building, I get a link error that usd.lib cannot be found
[proc] Executing command: "C:\Programs\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" --build c:/Users/Drew/Documents/git/my-project/out/build/x64-release --target my-project
[build] [1/2](0.491s) Building CXX object CMakeFiles\my-project.dir\my-project.cpp.obj
[build] [2/2](0.534s) Linking CXX executable my-project.exe
[build] FAILED: my-project.exe
[build] cmd.exe /C "cd . && "C:\Programs\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\my-project.dir --rc=C:\PROGRA~2\WINDOW~4\10\bin\100190~1.0\x86\rc.exe --mt=C:\PROGRA~2\WINDOW~4\10\bin\100190~1.0\x86\mt.exe --manifests -- C:\Programs\MICROS~1\2022\COMMUN~1\VC\Tools\MSVC\1431~1.311\bin\Hostx86\x64\link.exe /nologo CMakeFiles\my-project.dir\my-project.cpp.obj /out:my-project.exe /implib:my-project.lib /pdb:my-project.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console usd.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
[build] LINK: command "C:\Programs\MICROS~1\2022\COMMUN~1\VC\Tools\MSVC\1431~1.311\bin\Hostx86\x64\link.exe /nologo CMakeFiles\my-project.dir\my-project.cpp.obj /out:my-project.exe /implib:my-project.lib /pdb:my-project.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console usd.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:my-project.exe.manifest" failed (exit code 1181) with the following output:
[build] LINK : fatal error LNK1181: cannot open input file 'usd.lib'
If relevant, the configure command was
[proc] Executing command: "C:\Programs\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe -DCMAKE_INSTALL_PREFIX=c:/Users/Drew/Documents/git/my-project/out/install/x64-release -Sc:/Users/Drew/Documents/git/my-project -Bc:/Users/Drew/Documents/git/my-project/out/build/x64-release -G Ninja
Pixar's cmake code sets up the usd target like so
add_library(usd SHARED IMPORTED)
set_target_properties(usd PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "PXR_PYTHON_ENABLED=1"
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;E:/w/ca6c508eae419cf8/_install/win64_py36_release/include;E:/w/ca6c508eae419cf8/_install/win64_py36_release/include"
INTERFACE_LINK_LIBRARIES "arch;kind;pcp;sdf;ar;plug;tf;trace;vt;work;E:/w/ca6c508eae419cf8/_install/win64_py36_release/lib/boost_python36-vc141-mt-x64-1_70.lib;E:/w/ca6c508eae419cf8/_install/win64_py36_release/lib/tbb.lib"
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "E:/w/ca6c508eae419cf8/_install/win64_py36_release/include;E:/w/ca6c508eae419cf8/_install/win64_py36_release/include"
)
# Import target "usd" for configuration "Release"
set_property(TARGET usd APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(usd PROPERTIES
IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/usd.lib"
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/usd.dll"
)
list(APPEND _IMPORT_CHECK_TARGETS usd )
list(APPEND _IMPORT_CHECK_FILES_FOR_usd "${_IMPORT_PREFIX}/lib/usd.lib" "${_IMPORT_PREFIX}/lib/usd.dll" )
so it should be set up properly.
What am I doing wrong with my project setup to cause this linker error?

vscode cmake mvsc compiler not found [duplicate]

This question already has answers here:
CMake cannot open "ucrtd.lib"
(3 answers)
Closed 11 months ago.
I downloaded vscode with (C/C++ and cmake extentions) and Visual Studio Tools 2022. Created and QuickStart project with the cmake extention which is a simple:
#include <iostream>
int main(int, char**) {
std::cout << "Hello, world!\n";
}
cmake_minimum_required(VERSION 3.0.0)
project(hello-cmake VERSION 0.1.0)
include(CTest)
enable_testing()
add_executable(hello-cmake main.cpp)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
but I keep getting this error:
[variant] Loaded new set of variants
[kit] Successfully loaded 4 kits from C:\Users\Will\AppData\Local\CMakeTools\cmake-tools-kits.json
[visual-studio] Patch Windows SDK bin path from C:\Program Files (x86)\Windows Kits\10\bin\x86 to C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86 for C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat
[proc] Executing command: "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -Sc:/Users/Will/source/hello-cmake -Bc:/Users/Will/source/hello-cmake/build -G "Visual Studio 17 2022"
[main] Configuring folder: hello-cmake
[proc] Executing command: "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -Sc:/Users/Will/source/hello-cmake -Bc:/Users/Will/source/hello-cmake/build -G "Visual Studio 17 2022"
[cmake] Not searching for unused variables given on the command line.
[cmake] -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19044.
[cmake] -- The C compiler identification is unknown
[cmake] -- The CXX compiler identification is unknown
[cmake] CMake Error at CMakeLists.txt:2 (project):
[cmake] No CMAKE_C_COMPILER could be found.
[cmake]
[cmake]
[cmake]
[cmake] CMake Error at CMakeLists.txt:2 (project):
[cmake] No CMAKE_CXX_COMPILER could be found.
[cmake]
[cmake]
[cmake]
[cmake] -- Configuring incomplete, errors occurred!
[cmake] See also "C:/Users/Will/source/hello-cmake/build/CMakeFiles/CMakeOutput.log".
[cmake] See also "C:/Users/Will/source/hello-cmake/build/CMakeFiles/CMakeError.log".
[visual-studio] Patch Windows SDK bin path from C:\Program Files (x86)\Windows Kits\10\bin\x86 to C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86 for C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat
this is the CMakeError
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler:
Build flags:
Id flags:
The output was:
1
Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 4/1/2022 5:43:21 PM.
Project "C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdC\CompilerIdC.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "Debug\".
Creating directory "Debug\CompilerIdC.tlog\".
InitializeBuildStatus:
Creating "Debug\CompilerIdC.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\CL.exe /c /nologo /W0 /WX- /diagnostics:column /Od /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc143.pdb" /external:W0 /Gd /TC /FC /errorReport:queue CMakeCCompilerId.c
CMakeCCompilerId.c
Link:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdC.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdC.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdC.lib" /MACHINE:X64 Debug\CMakeCCompilerId.obj
LINK : fatal error LNK1104: cannot open file 'ucrtd.lib' [C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdC\CompilerIdC.vcxproj]
Done Building Project "C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdC\CompilerIdC.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdC\CompilerIdC.vcxproj" (default target) (1) ->
(Link target) ->
LINK : fatal error LNK1104: cannot open file 'ucrtd.lib' [C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdC\CompilerIdC.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.60
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler:
Build flags:
Id flags:
The output was:
1
Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 4/1/2022 5:43:21 PM.
Project "C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdC\CompilerIdC.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "Debug\".
Creating directory "Debug\CompilerIdC.tlog\".
InitializeBuildStatus:
Creating "Debug\CompilerIdC.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\CL.exe /c /nologo /W0 /WX- /diagnostics:column /Od /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc143.pdb" /external:W0 /Gd /TC /FC /errorReport:queue CMakeCCompilerId.c
CMakeCCompilerId.c
Link:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdC.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdC.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdC.lib" /MACHINE:X64 Debug\CMakeCCompilerId.obj
LINK : fatal error LNK1104: cannot open file 'ucrtd.lib' [C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdC\CompilerIdC.vcxproj]
Done Building Project "C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdC\CompilerIdC.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdC\CompilerIdC.vcxproj" (default target) (1) ->
(Link target) ->
LINK : fatal error LNK1104: cannot open file 'ucrtd.lib' [C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdC\CompilerIdC.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.43
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler:
Build flags:
Id flags:
The output was:
1
Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 4/1/2022 5:43:22 PM.
Project "C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdCXX\CompilerIdCXX.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "Debug\".
Creating directory "Debug\CompilerIdCXX.tlog\".
InitializeBuildStatus:
Creating "Debug\CompilerIdCXX.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\CL.exe /c /nologo /W0 /WX- /diagnostics:column /Od /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc143.pdb" /external:W0 /Gd /TP /FC /errorReport:queue CMakeCXXCompilerId.cpp
CMakeCXXCompilerId.cpp
Link:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdCXX.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdCXX.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdCXX.lib" /MACHINE:X64 Debug\CMakeCXXCompilerId.obj
LINK : fatal error LNK1104: cannot open file 'ucrtd.lib' [C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdCXX\CompilerIdCXX.vcxproj]
Done Building Project "C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdCXX\CompilerIdCXX.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdCXX\CompilerIdCXX.vcxproj" (default target) (1) ->
(Link target) ->
LINK : fatal error LNK1104: cannot open file 'ucrtd.lib' [C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdCXX\CompilerIdCXX.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.44
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler:
Build flags:
Id flags:
The output was:
1
Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 4/1/2022 5:43:23 PM.
Project "C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdCXX\CompilerIdCXX.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "Debug\".
Creating directory "Debug\CompilerIdCXX.tlog\".
InitializeBuildStatus:
Creating "Debug\CompilerIdCXX.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\CL.exe /c /nologo /W0 /WX- /diagnostics:column /Od /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc143.pdb" /external:W0 /Gd /TP /FC /errorReport:queue CMakeCXXCompilerId.cpp
CMakeCXXCompilerId.cpp
Link:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdCXX.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdCXX.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdCXX.lib" /MACHINE:X64 Debug\CMakeCXXCompilerId.obj
LINK : fatal error LNK1104: cannot open file 'ucrtd.lib' [C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdCXX\CompilerIdCXX.vcxproj]
Done Building Project "C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdCXX\CompilerIdCXX.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdCXX\CompilerIdCXX.vcxproj" (default target) (1) ->
(Link target) ->
LINK : fatal error LNK1104: cannot open file 'ucrtd.lib' [C:\Users\Will\source\hello-cmake\build\CMakeFiles\3.22.22022201-MSVC_2\CompilerIdCXX\CompilerIdCXX.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.44
This is actually the answer.
https://stackoverflow.com/a/71418520/6656422
10.0.19041.0is a bad windows sdk version. I installed 10.0.20348.0 and it works no problem.

VS is reporting object file to be old when it was just built/created. How can I turn off /LTCG to test with?

I'm attempting to build Pangolin, with the Python pybind11 'extension', for Windows.
This is a cmake based project that I'm trying to build using VS2017.
(I had a go using MinGW64 and CodeBlocks but had too many problems)
I seem close to getting to the end but then stumble when linking.
VS is reporting that a file, (attach.cpp.obj) was created with an older compiler. But when I look at the timestamp of that file it was just created. This is also a freshly cloned instance of the Pangolin project and I haven't used any other compiler/linker with it.
These are the actual error messages:
[46/46] cmd.exe /C "cd . && D:\software_installs\VS2017Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe -E vs_link_dll --intdir=src\CMakeFiles\pypangolin.dir --manifests -- D:\software_installs\VS2017Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\link.exe /nologo src\CMakeFiles\pypangolin.dir\python\pypangolin\attach.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\colour.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\datalog.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\display.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\gl.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\gl_draw.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\glsl.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\handler.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\image.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\image_view.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\opengl_render_state.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\params.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\pixel_format.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\plotter.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\var.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\video.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\view.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\viewport.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\widget.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\window.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin_module.cpp.obj /out:src\pypangolin.cp36-win_amd64.pyd /implib:src\pypangolin.lib /pdb:src\pypangolin.pdb /dll /version:0.0 /machine:x64 /debug /INCREMENTAL -LIBPATH:C:\PROGRA~2\WI3CF2~1\10\Lib\100177~1.0\ucrt\x64 C:\Python36\libs\Python36.lib src\pangolin.lib opengl32.lib glu32.lib C:\Python36\libs\Python36.lib C:\Users\Fred\CMakeBuilds\2a8b3e97-005e-803f-a2dd-1ca65471a4a2\install\x64-Release\lib\glew.lib mf.lib mfplat.lib mfreadwrite.lib mfuuid.lib strmiids.lib C:\Users\Fred\CMakeBuilds\2a8b3e97-005e-803f-a2dd-1ca65471a4a2\install\x64-Release\lib\libpng16_static.lib C:\Users\Fred\CMakeBuilds\2a8b3e97-005e-803f-a2dd-1ca65471a4a2\install\x64-Release\lib\libzlibstatic.a C:\Users\Fred\CMakeBuilds\2a8b3e97-005e-803f-a2dd-1ca65471a4a2\install\x64-Release\lib\libjpeg.a kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
FAILED: src/pypangolin.cp36-win_amd64.pyd
cmd.exe /C "cd . && D:\software_installs\VS2017Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe -E vs_link_dll --intdir=src\CMakeFiles\pypangolin.dir --manifests -- D:\software_installs\VS2017Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\link.exe /nologo src\CMakeFiles\pypangolin.dir\python\pypangolin\attach.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\colour.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\datalog.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\display.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\gl.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\gl_draw.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\glsl.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\handler.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\image.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\image_view.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\opengl_render_state.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\params.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\pixel_format.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\plotter.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\var.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\video.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\view.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\viewport.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\widget.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\window.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin_module.cpp.obj /out:src\pypangolin.cp36-win_amd64.pyd /implib:src\pypangolin.lib /pdb:src\pypangolin.pdb /dll /version:0.0 /machine:x64 /debug /INCREMENTAL -LIBPATH:C:\PROGRA~2\WI3CF2~1\10\Lib\100177~1.0\ucrt\x64 C:\Python36\libs\Python36.lib src\pangolin.lib opengl32.lib glu32.lib C:\Python36\libs\Python36.lib C:\Users\Fred\CMakeBuilds\2a8b3e97-005e-803f-a2dd-1ca65471a4a2\install\x64-Release\lib\glew.lib mf.lib mfplat.lib mfreadwrite.lib mfuuid.lib strmiids.lib C:\Users\Fred\CMakeBuilds\2a8b3e97-005e-803f-a2dd-1ca65471a4a2\install\x64-Release\lib\libpng16_static.lib C:\Users\Fred\CMakeBuilds\2a8b3e97-005e-803f-a2dd-1ca65471a4a2\install\x64-Release\lib\libzlibstatic.a C:\Users\Fred\CMakeBuilds\2a8b3e97-005e-803f-a2dd-1ca65471a4a2\install\x64-Release\lib\libjpeg.a kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
LINK Pass 1: command "D:\software_installs\VS2017Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\link.exe /nologo src\CMakeFiles\pypangolin.dir\python\pypangolin\attach.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\colour.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\datalog.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\display.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\gl.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\gl_draw.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\glsl.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\handler.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\image.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\image_view.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\opengl_render_state.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\params.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\pixel_format.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\plotter.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\var.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\video.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\view.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\viewport.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\widget.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin\window.cpp.obj src\CMakeFiles\pypangolin.dir\python\pypangolin_module.cpp.obj /out:src\pypangolin.cp36-win_amd64.pyd /implib:src\pypangolin.lib /pdb:src\pypangolin.pdb /dll /version:0.0 /machine:x64 /debug /INCREMENTAL -LIBPATH:C:\PROGRA~2\WI3CF2~1\10\Lib\100177~1.0\ucrt\x64 C:\Python36\libs\Python36.lib src\pangolin.lib opengl32.lib glu32.lib C:\Python36\libs\Python36.lib C:\Users\Fred\CMakeBuilds\2a8b3e97-005e-803f-a2dd-1ca65471a4a2\install\x64-Release\lib\glew.lib mf.lib mfplat.lib mfreadwrite.lib mfuuid.lib strmiids.lib C:\Users\Fred\CMakeBuilds\2a8b3e97-005e-803f-a2dd-1ca65471a4a2\install\x64-Release\lib\libpng16_static.lib C:\Users\Fred\CMakeBuilds\2a8b3e97-005e-803f-a2dd-1ca65471a4a2\install\x64-Release\lib\libzlibstatic.a C:\Users\Fred\CMakeBuilds\2a8b3e97-005e-803f-a2dd-1ca65471a4a2\install\x64-Release\lib\libjpeg.a kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:src\CMakeFiles\pypangolin.dir/intermediate.manifest src\CMakeFiles\pypangolin.dir/manifest.res" failed (exit code 1257) with the following output:
attach.cpp.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
C:\WINDOWS\system32\LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
C:\WINDOWS\system32\EXEC : fatal error C1047: The object or library file 'src\CMakeFiles\pypangolin.dir\python\pypangolin\attach.cpp.obj' was created with an older compiler than other objects; rebuild old objects and libraries
C:\WINDOWS\system32\LINK : fatal error LNK1257: code generation failed
ninja: build stopped: subcommand failed.
I have tried to find where to turn off '/LTCG' but it seems hard to do as its a cmake project.
I must confess that I have had to rename one or two .lib files and copy in the odd precompiled .lib to get this far, due to mismatches in CMakeLists etc.
Does anyone know why this is happening?
Or at least how I can test link without /LTCG?

boost::stacktrace on Windows MSVS 2017

I'd like a backtrace when my Windows application crashes. Boost stacktrace looks interesting, and I've played with it a bit in Linux; however, I'm getting a zero result from safe_dump_to() in Windows!
I presume I've made a simple oversight, and I'm hoping someone can help.
I'm using the MSVS2017 compiler with ninja and CMake.
I've built Boost v1.67 built with these flags:
link=static address-model=64 variant=release threading=multi
I ran the tests in boost_1_67_0/libs/stacktrace/test/ to make sure I'd built the library correctly.
Here is my CMake file, note I used -DCMAKE_BUILD_TYPE=RelWithDebInfo:
cmake_minimum_required(VERSION 3.0)
set( target_name stacktrace_test)
# boost
set(Boost_USE_STATIC_LIBS ON)
find_package( Boost REQUIRED COMPONENTS date_time filesystem thread
system stacktrace_windbg)
add_executable(${target_name} main.cpp)
set_property(TARGET ${target_name} PROPERTY CXX_STANDARD 14 )
target_compile_definitions(${target_name} PUBLIC
BOOST_ALL_NO_LIB=1 # disable pragama inclusion
BOOST_STACKTRACE_LINK=1
BOOST_STACKTRACE_USE_WINDBG=1
)
target_include_directories(${target_name} SYSTEM PUBLIC
${Boost_INCLUDE_DIRS}
)
target_link_libraries(${target_name}
${Boost_LIBRARIES} # boost
dbgeng
ole32
)
Here is my code, based on Boost stactrace's getting started page:
#include <iostream>
#include <signal.h> // ::signal, ::raise
#include <boost/stacktrace/stacktrace.hpp>
#include <boost/filesystem.hpp>
void handler(int signum)
{
::signal(signum, SIG_DFL);
size_t result = boost::stacktrace::safe_dump_to("./backtrace.dump");
std::cout << " " << result << std::endl;
::raise(SIGABRT);
}
void crash()
{
abort();
}
int main(int,char**)
{
::signal(SIGSEGV, &handler);
::signal(SIGABRT, &handler);
if(boost::filesystem::exists("backtrace.dump")) // existing stacktrace?
{
std::ifstream ifs("backtrace.dump");
boost::stacktrace::stacktrace st =
boost::stacktrace::stacktrace::from_dump(ifs);
std::cout << "Stacktrace from prior run:\n" << st << std::endl;
ifs.close(); // cleanup
boost::filesystem::remove("backtrace.dump");
return 0;
}
crash();
return 0;
}
And here is the output from my compilation:
C:\SRC\sandbox\boost\stacktrace\win-simple\Build_RWD>ninja -v
[1/2 50%]:C:\PROGRA~2\MICROS~1\2017\BUILDT~1\VC\Tools\MSVC\1413~1.261\bin\Hostx64\x64\cl.exe /nologo /TP -DBOOST_ALL_NO_LIB=1 -DBOOST_STACKTRACE_LINK=1 -DBOOST_STACKTRACE_USE_WINDBG=1 -IC:\3rd_libs\boost\boost_1_67_0 /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /Zi /O2 /Ob1 /DNDEBUG -std:c++14 /showIncludes /FoCMakeFiles\stacktrace_test.dir\main.cpp.obj /FdCMakeFiles\stacktrace_test.dir\ /FS -c ..\main.cpp
[2/2 100%]:cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\stacktrace_test.dir --manifests -- C:\PROGRA~2\MICROS~1\2017\BUILDT~1\VC\Tools\MSVC\1413~1.261\bin\Hostx64\x64\link.exe /nologo CMakeFiles\stacktrace_test.dir\main.cpp.obj /out:stacktrace_test.exe /implib:stacktrace_test.lib /pdb:stacktrace_test.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console C:\3rd_libs\boost\boost_1_67_0\stage\lib\libboost_date_time.lib C:\3rd_libs\boost\boost_1_67_0\stage\lib\libboost_filesystem.lib C:\3rd_libs\boost\boost_1_67_0\stage\lib\libboost_thread.lib C:\3rd_libs\boost\boost_1_67_0\stage\lib\libboost_system.lib C:\3rd_libs\boost\boost_1_67_0\stage\lib\libboost_stacktrace_windbg.lib C:\3rd_libs\boost\boost_1_67_0\stage\lib\libboost_chrono.lib C:\3rd_libs\boost\boost_1_67_0\stage\lib\libboost_atomic.lib dbgeng.lib ole32.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
LINK : stacktrace_test.exe not found or not built by the last incremental link; performing full link
I've reviewed the compilation flags and nothing jumps out at me.
Any help is appreciated!
Thank you,
SB
As it turns out,functionality in boost::stacktrace is disabled for windows as it's reported it may cause deadlocks. Re-enabling the code in stacktrace/detail/safe_dump_win.ipp solved the problem for me.
Note that I took the github development version of safe_dump_win.ipp, frame_msvc.ipp, and frame_unwind.ipp as my starting point.
In my limited testing I have not seen the deadlock. Should the software deadlock I will be in no worse shape than if it quietly crashed and, hopefully, I will get more traces than deadlocks!

MS C++ 2012 linker hangs but only in debug mode x64

I just upgraded to MSVC 2012 Express (which is saying trial btw. I wonder why as it should be free). After lots of changes from MSVC 2005 it started working, but the linker hangs, but only in debug mode x64, in all other 3 modes it works! Here are the commandline arguments (I called it from a script, but it does the same thing when called from IDE).
cl.exe /fp:precise /Od /MTd /bigobj /RTCscu /Zi /GS- /TP /Fd"!temp/DebugDebug1/MRotary/vc70.pdb" /D_USRDLL /D_WINDLL /D_WINDOWS
/DWIN64 /Fo"!temp/DebugDebug1/MRotary/main.obj"
/FR"!temp/DebugDebug1/MRotary/" /I "C:/Program Files (x86)/Microsoft
Visual Studio 11.0/Vc/include" /I "C:/Program Files (x86)/Windows
Kits/8.0/Include/um" /I "C:/Program Files (x86)/Windows
Kits/8.0/Include/shared" /I "C:/Program Files
(x86)/Intel/IPP/6.1.2.041/em64t/include" /D_MBCS /c /W3 /EHsc /GF /Gd
/Zc:wchar_t /Zc:forScope /nologo MDrummer/VSTEffects/main.cpp
link.exe !temp/DebugDebug1/MRotary/icon.res !temp/DebugDebug1/MRotary/main.obj
!temp/DebugDebug1/MRotary/resourcesrotary.obj
!temp/DebugDebug1/MRotary/mlibrary.obj mlibraryasm_x64_debug.lib
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
odbccp32.lib comctl32.lib wsock32.lib winmm.lib msimg32.lib psapi.lib
opengl32.lib Glu32.lib freetype_x64_debug.lib zlib_x64_debug.lib
libpng_x64_debug.lib libtiff_x64_debug.lib libjpeg_x64_debug.lib
giflib_x64_debug.lib bzip2_x64_debug.lib libflac_x64_debug.lib
vstsdk3_x64_debug.lib ippcoreem64tl.lib ippsemergedem64t.lib
ippsmergedem64t.lib ippiemergedem64t.lib ippimergedem64t.lib
ippvmemergedem64t.lib ippvmmergedem64t.lib /OUT:"c:/program
files/vstplugins/MeldaProductionx64/Modulation/MRotary.dll"
/INCREMENTAL:NO /DEBUG /MACHINE:X64 /SUBSYSTEM:WINDOWS
/DEF:"D:/Programming/Mlibrary/mvstplugin.def" /DLL
/IMPLIB:"D:/Programming/MDrummer/!temp/DebugDebug1/MRotary.lib"
/PDB:"c:/program
files/vstplugins/MeldaProductionx64/Modulation/MRotary.pdb"
/LIBPATH:"D:/Programming/Mlibrary/library"
/LIBPATH:"D:/Programming/MDrummer"
/LIBPATH:"D:/Programming/MDrummer/!temp/DebugDebug1"
/LIBPATH:"D:/Programming/MDrummer/c:\program
files\vstplugins\MeldaProductionx64" /LIBPATH:"C:/Program Files
(x86)/Microsoft Visual Studio 11.0/Vc/lib/amd64" /LIBPATH:"C:/Program
Files (x86)/Windows Kits/8.0/Lib/win8/um/x64" /LIBPATH:"C:/Program
Files (x86)/Intel/IPP/6.1.2.041/em64t/lib" /LIBPATH:"C:/Program Files
(x86)/Intel/IPP/6.1.2.041/em64t/stublib" /OPT:REF /OPT:ICF /nologo
/MANIFEST:NO
Any ideas? I searched there have been troubles with this, but nothing seems related to this specific one.
Ok so apparently it starts working if I remove "/OPT:REF /OPT:ICF", but why and why only in such specific circumstances, that's a question...