Reputation: 107
I use Visual Studio 2010 Premium. I have two project A and B and I try to compile both to a 64-bit platform.
Project A outputs a .dll and a .lib file which project B relies on.
I already compiled successfully project A to a 64-bit platform, yet when I compile project B I get the following error :
mfcs100d.lib(nolib.obj) : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
What could be the problem ? I don't really know what is this mfcs100d.lib file.
I've used "Dependency Walker" on project A's dll file and it seems to be relying solely on 64-bit dll files.
Additionally, I went to the Project B's (Property Pages -> Configuration Properties -> Linker -> Advanced) and confirmed that 'Target Machine' is set to "MachineX64".
Also, On the Configuration Manager the Platform is set to x64.
Someone infromed me that the problem may be such :
Going to project B's (Property Pages -> Configuration Properties -> C\C++ -> Preprocessor -> Preprocessor Definitions) I have the following values there :
WIN32
_DEBUG
_WINDOWS
_AFXEXT
Is that truly related ? Should I replace the 'WIN32' value ? if so, then how ? I don't really understand the meaning of those definitions and how to change them.
Edit : I just realized that probably it's not related at all. Those are simply definitions for the preprocessor, such as the ones which can be determined by a C++ #define command. Yet I could be wrong.
Upvotes: 1
Views: 17046
Reputation: 21
When you add the x64 target, go into the General settings and look at Output Directory and Intermediate Directory. For the Debug target change from "Debug" to "Debug64", same for Release target.
Upvotes: 2
Reputation: 942187
Pretty hard to get this wrong. Start with Build + Configuration Manager and double-check that x64 is selected for both projects. Next step is to verify the library search path. Right-click the project, Properties, VC++ Directories, Library Directories. Click on the combobox arrow to view the "Inherited values". $(VCInstallDir)atlmfc\lib\amd64 should be the second in the list, that's where the 64-bit version of mfcs100d.lib is located.
Upvotes: 5