VC11 LNK1107 referencing a header file - c++

So I've looked for almost 2 days now for a solution to my problem, but everyone else getting this error seems to be linking against a dll instead of a lib. However, that doesn't seem to be the case for me, so here I am.
I'm trying to build a project in Visual Studio 2012 using the vc110 (VS2012) toolchain. However, whenever I build the project, I get the following linker error from the build log (detailed verbosity):
1>Task "Link"
1> Environment Variables passed to tool:
1> VS_UNICODE_OUTPUT=1344
1> C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:PROMPT /OUT:"..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_out/Debug\EditorServiceMgr.exe" /INCREMENTAL /NOLOGO /LIBPATH:S:\twk_amf\Implementation\EditorServiceMgr\proj\Win\vc9\..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\..\..\..\..\..\..\external\Trolltech_Qt4\lib\win\x64\Debug msvcrtd.lib QtCored4.lib QtGuid4.lib QtXmld4.lib QtNetworkd4.lib QtUiToolsd.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 /NODEFAULTLIB /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcp.lib /NODEFAULTLIB:libcpd.lib /NODEFAULTLIB:libci.lib /NODEFAULTLIB:libcid.lib /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:libcpmt.lib /NODEFAULTLIB:libcpmtd.lib /NODEFAULTLIB:libcimt.lib /NODEFAULTLIB:libcimtd.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_out/Debug\EditorServiceMgr.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_out/Debug\EditorServiceMgr.lib" /MACHINE:X64 ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\EditorServiceMgrSvc.h
1> ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\EditorServiceMgrSvc.rc
1> ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\EditorServiceMgrSvc.res
1> ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_out/Debug\EditorServiceMgrSvc.dll
1> ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\EditorServiceMgr.res
1> ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\EditorServiceMgrSvc.obj
1> Tracking command:
1> C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\Tracker.exe /a /d C:\Windows\Microsoft.NET\Framework\v4.0.30319\FileTracker.dll /i S:\twk_results_win\ViewLocal\x64\MC_inter\EditorServiceMgr\Debug /r "S:\TWK_RESULTS_WIN\VIEWLOCAL\X64\MC_INTER\EDITORSERVICEMGR\DEBUG\EDITORSERVICEMGR.RES|S:\TWK_RESULTS_WIN\VIEWLOCAL\X64\MC_INTER\EDITORSERVICEMGR\DEBUG\EDITORSERVICEMGRSVC.H|S:\TWK_RESULTS_WIN\VIEWLOCAL\X64\MC_INTER\EDITORSERVICEMGR\DEBUG\EDITORSERVICEMGRSVC.OBJ|S:\TWK_RESULTS_WIN\VIEWLOCAL\X64\MC_INTER\EDITORSERVICEMGR\DEBUG\EDITORSERVICEMGRSVC.RC|S:\TWK_RESULTS_WIN\VIEWLOCAL\X64\MC_INTER\EDITORSERVICEMGR\DEBUG\EDITORSERVICEMGRSVC.RES|S:\TWK_RESULTS_WIN\VIEWLOCAL\X64\MC_OUT\DEBUG\EDITORSERVICEMGRSVC.DLL" /b MSBuildConsole_CancelEvent31ad2214810446c299127f83382c747d /c "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64\link.exe" /ERRORREPORT:PROMPT /OUT:"..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_out/Debug\EditorServiceMgr.exe" /INCREMENTAL /NOLOGO /LIBPATH:S:\twk_amf\Implementation\EditorServiceMgr\proj\Win\vc9\..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\..\..\..\..\..\..\external\Trolltech_Qt4\lib\win\x64\Debug msvcrtd.lib QtCored4.lib QtGuid4.lib QtXmld4.lib QtNetworkd4.lib QtUiToolsd.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 /NODEFAULTLIB /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcp.lib /NODEFAULTLIB:libcpd.lib /NODEFAULTLIB:libci.lib /NODEFAULTLIB:libcid.lib /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:libcpmt.lib /NODEFAULTLIB:libcpmtd.lib /NODEFAULTLIB:libcimt.lib /NODEFAULTLIB:libcimtd.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_out/Debug\EditorServiceMgr.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_out/Debug\EditorServiceMgr.lib" /MACHINE:X64 ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\EditorServiceMgrSvc.h
1> ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\EditorServiceMgrSvc.rc
1> ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\EditorServiceMgrSvc.res
1> ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_out/Debug\EditorServiceMgrSvc.dll
1> ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\EditorServiceMgr.res
1> ..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\EditorServiceMgrSvc.obj
1>..\..\..\..\..\..\twk_results_win/ViewLocal/x64/MC_inter/EditorServiceMgr/Debug\EditorServiceMgrSvc.h : fatal error LNK1107: invalid or corrupt file: cannot read at 0x5F2
1> The command exited with code 1107.
1>Done executing task "Link" -- FAILED.
From the build output, I thought that the linker might be trying to link against a header file, but I haven't been able to find any evidence of that.
The file referenced here, EditorServiceMgrSvc.h, only contains macro definitions, no includes. The header file is also referenced in the rc file, and is included as a symbol header file. Furthermore, there are only libs within the additional dependencies of the project's property pages.
I will put up what I can in addition to the build output, if needed, but I may not be able to put up that much since I'm working on proprietary code. Any ideas of what's happening here?
EDIT:
Note that this project was auto-converted from Visual Studio 2008 project format.

Related

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?

Antlr4 cpp conflict swith with llvm?

I want to integrate my grammar in antlr4 with llvm to generate llvm IR.
I make the example code(Kaleidoscope\Chapter3) in llvm into a antlr program.
Standalone llvm example or antlr4 cpp runtime program works both OK.
My environment:
Windows, visual studio 2019, Debug , (Debug DLL in antlr4-runtime, compiled from source.)
However I got the following error message:
Not clue how to fix it.
Severity Code Description File Project Line Suppression State
Error LNK2019 unresolved external symbol "__declspec(dllimport) public: virtual struct antlrcpp::Any __cdecl antlr4::tree::AbstractParseTreeVisitor::visit(class antlr4::tree::ParseTree *)" (__imp_?visit#AbstractParseTreeVisitor#tree#antlr4##UEAA?AUAny#antlrcpp##PEAVParseTree#23##Z) referenced in function "void __cdecl work3(void)" (?work3##YAXXZ) examples\Kaleidoscope\Chapter3_2\antlr_try.obj Kaleidoscope-Ch3_2 1
Link command:
1>Target Link:
1> Using "Link" task from assembly "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.Build.CppTasks.Common.dll".
1> Task "Link"
1> All source files are not up-to-date: missing command TLog "W:\ubuntu\llvm7_build\examples\Kaleidoscope\Chapter3_2\Kaleidoscope-Ch3_2.dir\Debug\Kaleidos.BE9FF897.tlog\link.command.1.tlog".
1> Environment Variables passed to tool:
1> VS_UNICODE_OUTPUT=1812
1> C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\bin\HostX64\x64\link.exe /ERRORREPORT:PROMPT /OUT:"W:\ubuntu\llvm7_build\Debug\bin\Kaleidoscope-Ch3_2.exe" /INCREMENTAL /NOLOGO "antlr4-runtime.lib" ..\..\..\Debug\lib\LLVMCore.lib ..\..\..\Debug\lib\LLVMSupport.lib ..\..\..\Debug\lib\LLVMBinaryFormat.lib psapi.lib shell32.lib ole32.lib uuid.lib advapi32.lib ..\..\..\Debug\lib\LLVMDemangle.lib kernel32.lib user32.lib gdi32.lib winspool.lib oleaut32.lib comdlg32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"W:/ubuntu/llvm7_build/Debug/bin/Kaleidoscope-Ch3.pdb" /SUBSYSTEM:CONSOLE /STACK:"10000000" /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"W:/ubuntu/llvm7_build/Debug/lib/Kaleidoscope-Ch3.lib" /MACHINE:X64 /machine:x64 "Kaleidoscope-Ch3_2.dir\Debug\windows_version_resource.res"
1> "Kaleidoscope-Ch3_2.dir\Debug\antlr_try.obj"
1> "Kaleidoscope-Ch3_2.dir\Debug\asts.obj"
1> "Kaleidoscope-Ch3_2.dir\Debug\EvalVisitor.obj"
1> "Kaleidoscope-Ch3_2.dir\Debug\myllvmBaseVisitor.obj"
1> "Kaleidoscope-Ch3_2.dir\Debug\myllvmLexer.obj"
1> "Kaleidoscope-Ch3_2.dir\Debug\myllvmParser.obj"
1> "Kaleidoscope-Ch3_2.dir\Debug\myllvmVisitor.obj"
1> "Kaleidoscope-Ch3_2.dir\Debug\toy.obj"
1> Tracking command:
1> C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Tracker.exe /a /d "C:\Program Files (x86)\MSBuild\15.0\FileTracker\FileTracker32.dll" /i W:\ubuntu\llvm7_build\examples\Kaleidoscope\Chapter3_2\Kaleidoscope-Ch3_2.dir\Debug\Kaleidos.BE9FF897.tlog /r "W:\UBUNTU\LLVM7_BUILD\EXAMPLES\KALEIDOSCOPE\CHAPTER3_2\KALEIDOSCOPE-CH3_2.DIR\DEBUG\ANTLR_TRY.OBJ|W:\UBUNTU\LLVM7_BUILD\EXAMPLES\KALEIDOSCOPE\CHAPTER3_2\KALEIDOSCOPE-CH3_2.DIR\DEBUG\ASTS.OBJ|W:\UBUNTU\LLVM7_BUILD\EXAMPLES\KALEIDOSCOPE\CHAPTER3_2\KALEIDOSCOPE-CH3_2.DIR\DEBUG\EVALVISITOR.OBJ|W:\UBUNTU\LLVM7_BUILD\EXAMPLES\KALEIDOSCOPE\CHAPTER3_2\KALEIDOSCOPE-CH3_2.DIR\DEBUG\MYLLVMBASEVISITOR.OBJ|W:\UBUNTU\LLVM7_BUILD\EXAMPLES\KALEIDOSCOPE\CHAPTER3_2\KALEIDOSCOPE-CH3_2.DIR\DEBUG\MYLLVMLEXER.OBJ|W:\UBUNTU\LLVM7_BUILD\EXAMPLES\KALEIDOSCOPE\CHAPTER3_2\KALEIDOSCOPE-CH3_2.DIR\DEBUG\MYLLVMPARSER.OBJ|W:\UBUNTU\LLVM7_BUILD\EXAMPLES\KALEIDOSCOPE\CHAPTER3_2\KALEIDOSCOPE-CH3_2.DIR\DEBUG\MYLLVMVISITOR.OBJ|W:\UBUNTU\LLVM7_BUILD\EXAMPLES\KALEIDOSCOPE\CHAPTER3_2\KALEIDOSCOPE-CH3_2.DIR\DEBUG\TOY.OBJ|W:\UBUNTU\LLVM7_BUILD\EXAMPLES\KALEIDOSCOPE\CHAPTER3_2\KALEIDOSCOPE-CH3_2.DIR\DEBUG\WINDOWS_VERSION_RESOURCE.RES" /b MSBuildConsole_CancelEvent1847db8bdd10464784fa77f132d003d1 /c "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\bin\HostX64\x64\link.exe" /ERRORREPORT:PROMPT /OUT:"W:\ubuntu\llvm7_build\Debug\bin\Kaleidoscope-Ch3_2.exe" /INCREMENTAL /NOLOGO "antlr4-runtime.lib" ..\..\..\Debug\lib\LLVMCore.lib ..\..\..\Debug\lib\LLVMSupport.lib ..\..\..\Debug\lib\LLVMBinaryFormat.lib psapi.lib shell32.lib ole32.lib uuid.lib advapi32.lib ..\..\..\Debug\lib\LLVMDemangle.lib kernel32.lib user32.lib gdi32.lib winspool.lib oleaut32.lib comdlg32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"W:/ubuntu/llvm7_build/Debug/bin/Kaleidoscope-Ch3.pdb" /SUBSYSTEM:CONSOLE /STACK:"10000000" /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"W:/ubuntu/llvm7_build/Debug/lib/Kaleidoscope-Ch3.lib" /MACHINE:X64 /machine:x64 "Kaleidoscope-Ch3_2.dir\Debug\windows_version_resource.res"
1> "Kaleidoscope-Ch3_2.dir\Debug\antlr_try.obj"
1> "Kaleidoscope-Ch3_2.dir\Debug\asts.obj"
1> "Kaleidoscope-Ch3_2.dir\Debug\EvalVisitor.obj"
1> "Kaleidoscope-Ch3_2.dir\Debug\myllvmBaseVisitor.obj"
1> "Kaleidoscope-Ch3_2.dir\Debug\myllvmLexer.obj"
1> "Kaleidoscope-Ch3_2.dir\Debug\myllvmParser.obj"
1> "Kaleidoscope-Ch3_2.dir\Debug\myllvmVisitor.obj"
1> "Kaleidoscope-Ch3_2.dir\Debug\toy.obj"

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...

linker error after changed the type of c++ project from x86 to x64

I had a project which was compiled and liked well, but I need to linked it with a 64 bit library and I tried to change the type of project to 64 and now the project doesn't linked correctly.
The error that I am getting is:
Error 1 error LNK1112: module machine type 'X86' conflicts with target machine type 'x64' \createDLL.obj
checking output, I can see that the linker is called in this way:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"..\Debug\createDLL.exe" /INCREMENTAL /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 /DEBUG /PDB:"..\Debug\createDLL.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE:NO /IMPLIB:"..\Debug\createDLL.lib" /MACHINE:X64 /SAFESEH Debug\createDLL.obj
apparently the linker is looking for an obj which compiled for 64 but it can not find it
How can I set the compiler to compile for x64?
I am using VS 2012
1)Try to get 32 bit version of the library if possible.
2)Check the options in Project->Properties->Configuration properties->Linker . Check settings in General ,Input & Advanced pages mainly in it.Should solve your problem

LNK1112 on Directshow C++ CLR project

i am trying to rebuild a program in CLR C++ from C++ and i get the linker error
1>strmbasd.lib(strmiids.obj) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
my project is set to Win32 and the properties are set to target machine x86. i keep rebuilding baseclasses to match the Win32 and I don't know where or why its failing
Linker command line looks like:
/OUT:"C:\Users\ME\Documents\Code\X C++\Trial2\DirectshowC++\Debug\DirectshowC++.exe" /INCREMENTAL /NOLOGO /MANIFEST /MANIFESTFILE:"Debug\DirectshowC++.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /ASSEMBLYDEBUG /PDB:"C:\Users\ME\Documents\Code\X C++\Trial2\DirectshowC++\Debug\DirectshowC++.pdb" /SUBSYSTEM:WINDOWS /ENTRY:"main" /DYNAMICBASE /FIXED:No /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PROMPT strmiids.lib strmbasd.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
I would try adding "C:\Program Files\Microsoft SDKs\Windows\v6.0\Lib\x86" as the first entry to the linker path option. Obviously you should fix up the path to match the installed folder on your system.