Im trying to run sample app from wxFreeChart library. After compilation on linking there is an error:
wxcode_msw28d_freechart.lib(wxfreechart_lib_xydataset.obj) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
I tried to switch linker option\advanced\target machine to MachineX64 but it doesnt work.
Im using visual studio 2008, any suggestion ?
thanks for help
I know this is a bit old, but I thought I would provide another tip. In my situation, I inherited this application that I had to maintain. The VS2008 project came with the same string in C/C++->OutputFIles->"ObjectFIleName" and "Program Database File Name" (for both platforms Win32 and x64). So when I built Win32 platform, it built fine, but when I tried to build x64, I got the error:
\Debug64\Objects\common.obj : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
Obviously, both patforms were storing common.obj at the same location, so when I tried to build x64, the linker took the existing object file, which was x86.
To fix I just replaced the existing string with the macro "$(IntDir)\" for x64 (no quotes), and made sure that the macro resolved to the correct path, as in the rest of the projects. That solved my problem.
This problem has nothing to do with the linker, so modifying it's setting won't affect the outcome. You're getting this because I assume you're trying to target x86 but for one reason or another wxcode_msw28d_freechart.lib is being built as an x64 file.
Try looking at wxcode_msw28d_freechart.lib and whatever source code it derives from. Your problem is happening there. See if there are some special build steps that are using the wrong set of tools (x64 instead of x86).
building on these answers - i also had to modify an X86 reference under Librarian -> Command Line -> Additional Options (for the x64 Platform)
Since the problem is due to the difference in compilation and target machine specifications (x86 & x64) Follow the steps below:
This solved my problem.
I bumped into this too and found a solution.
First on how I got into this problem. I have a project which builds in x86. Then I used the Configuration Manager to add x64, and I hit this problem.
By looking at
BuildLog.htm
carefully, I saw both of these listed as linker options:I could not find anywhere in the Property Pages dialog where I could change this, so I opened up the
.vcproj
file and looked for the appropriate line and changed it to:and problem solved.
Go to project properties-> configuration properties -> Librarian Set Target Machine to MachineX64 (/MACHINE:X64)