I’ve got a Visual Studio project. It’s fairly simple, and it works. However, we’re in the process of porting our code to 64-bit. I’ve got this simple project compiling, but it fails to link:
fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
That tells me it’s trying to link the wrong version of the library. It should be linking the 64-bit library, but it’s trying to link the 32-bit library. That’s obviously wrong.
My problem is that I cannot figure out where my project is deciding to link that library. I’ve looked at:
- Project Properties, props files. Nowhere is a lib name specified, although the lib path is specified.
- Project Properties -> Linker -> Command Line. Not there either.
- I’ve looked through the header files for some kind of a
#pragma comment(lib, ), but I cannot find any use of that.
Where else can I look? Is there a way to have Visual Studio tell me how it is deciding to link in different libraries?
Not sure if it’s relevant, but this is a small unit test project, using CppUnit. It’s linking cppunit-vc100-MTd.lib when it should be linking cppunit-vc100-x64-MTd.lib
On your projects property page, under Linker, General, set the project link progress reporting to whatever you need to display the libraries being hit. /VERBOSE or /VERBOSE:lib will likely do what you want.
Example output of what shows up in the Output window with /VERBOSE:lib
etc..
Also, you may have a header file in your source tree that is bringing the file in via a
but that should be easy enough to search by Find In Files hitting your Include Path, which is one of the canned options in the Find in Files configuration.