LNK1112 on Directshow C++ CLR project - c++

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.

Related

Visual Studio with CMake stopped working. How do I completely reset to a working state?

I was working on a C++ CMake project which was displaying and building fine in Visual Studio. Then I did something, I'm not sure what I did, but it seemed to break CMake. Now I get the following error:
Error CMake Error at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.24/Modules/CMakeTestCCompiler.cmake:69 (message):
The C compiler
"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: E:/DOCS/PROGRAMMING/22-02_Qt/vs_simple/VsConsole5/out/build/x64-debug/CMakeFiles/CMakeTmp
Run Build Command(s):C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe cmTC_c94d5 && [1/2] Building C object CMakeFiles\cmTC_c94d5.dir\testCCompiler.c.obj
[2/2] Linking C executable cmTC_c94d5.exe
FAILED: cmTC_c94d5.exe
cmd.exe /C "cd . && "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_c94d5.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1434~1.319\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_c94d5.dir\testCCompiler.c.obj /out:cmTC_c94d5.exe /implib:cmTC_c94d5.lib /pdb:cmTC_c94d5.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 ."
LINK Pass 1: command "C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1434~1.319\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_c94d5.dir\testCCompiler.c.obj /out:cmTC_c94d5.exe /implib:cmTC_c94d5.lib /pdb:cmTC_c94d5.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 /MANIFEST /MANIFESTFILE:CMakeFiles\cmTC_c94d5.dir/intermediate.manifest CMakeFiles\cmTC_c94d5.dir/manifest.res" failed (exit code 1104) with the following output:
LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project. C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.24/Modules/CMakeTestCCompiler.cmake 69
I get this error, even if I make a completely fresh CMake project via File > New > Project > CMake Project from within Visual Studio.
I've tried uninstalling and re-installing:
Visual Studio
Multiple different Windows SDK versions
CMake
I was hoping that doing this would return Visual Studio + CMake to a working state again but I am still getting the same error.
I also tried manually setting LIB and INCLUDE environment variables to the appropriate directories and that did get rid of the error but then the program wouldn't build, I got a bunch of errors like this:
Error (active) E1696 cannot open source file "ctype.h" VsSimple.exe - x64-Debug C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include\cctype
I also tried deleting everything in the project folder apart from CMakeLists.txt, the .cpp file and the .h file. Unfortunately still no luck.

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?

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?

VC11 LNK1107 referencing a header file

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.

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