LNK1112 on Directshow C++ CLR project

2019-08-20 11:47发布

问题:

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

回答1:

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.