views:

750

answers:

2

Hello, 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

+2  A: 

The error is explicit, you are trying to link libraries that were compiled with different CPU targets. An executable image can only contain pure x86 (32-bit) or pure x64 (64-bit) code. Mixing is not possible.

You change the target CPU by creating a new configuration for the project, only changing the linker setting isn't enough. Build + Configuration Manager, Active solution platform combo on upper right, choose New and select x64. That creates a new configuration with several modified project settings, most importantly the compiler that will be used.

Beware that prior to VS2010, the 64-bit compilers are not installed by default. If you don't see x64 in the platform combo then you'll need to re-run setup.exe and turn on the option to install the 64-bit compilers. Then also re-run any service pack installer you may have applied.

A possible approach with less pain points is to use the 32-bit version of the library.

Hans Passant
its logical but I compiled this libraries on windows using makefile with (I think) default settings witch 32 bit architecture.
gruber
Hmm, avoid making assumptions when you get errors you cannot explain.
Hans Passant
I explained my error, You dont know the answer then dont answer
gruber
Please install a web cam on your machine so we can look over your shoulder.
Hans Passant
A: 

hi,

i ve same problem. i ve setup all configuration which is mentions in below points but can't find any solution Configuration points are

  1. To choose the x64 platform, click Build > Configuration Manager. Under Active Solution Platform, select In the dialog that comes up, select x64 as the new platform (it may come up by default) and then click Ok.
  2. select the x64 platform in the VC window.
  3. Check the Linker > Command Line property page to make sure there is no /MACHINE switch there 3.1 if you find /MACHINE ** in the additional options window, just deletle it. 3.2. if you find /MACHINE ** in the all options window, go to the Linker > Advanced property page and make sure that Target Machine is "Not Set".

which i get from this link http://software.intel.com/en-us/forums/showthread.php?t=61666

MY Question is that when create 64 platform by select Under Active Solution Platform. A small window opened. there is 2 option in combo BOX 1. empty 2. win32

I wanna mention one thing here that im working on VS C++ 2008 a dll project.i'm working on 64 bit system with 64 bit OS (win 7).

I ve tried both but when i select 2nd one 'win32' then i'll face same problem. Other thing which i ve observed that my project use a .obj file which was create when i run this on win32 OS and system. but now my probject use same .obj file even in x64 OS.

MY first Question :

How can i used new created .obj file which is exist /x64/release folder instead of old one which is exit in /release folder

But when i use 1st one i m facing thes problems

Error 2 fatal error C1190: managed targeted code requires a '/clr' option d:\xyz\src\desktop\configurator2\xDocBridge\xDocBridge.cpp 21 xDocBridge

Error 3 error C2653: 'System' : is not a class or namespace name d:\xyz\src\desktop\configurator2\xDocBridge\AssemblyInfo.cpp 3 xDocBridge

Error 4 error C2871: 'Reflection' : a namespace with this name does not exist d:\xyz\src\desktop\configurator2\xDocBridge\AssemblyInfo.cpp 3 xDocBridge

Error 5 error C2653: 'System' : is not a class or namespace name d:\xyz\src\desktop\configurator2\xDocBridge\AssemblyInfo.cpp 4 xDocBridge

Error 6 error C2871: 'CompilerServices' : a namespace with this name does not exist d:\xyz\src\desktop\configurator2\xDocBridge\AssemblyInfo.cpp 4 xDocBridge

Error 7 error C2337: 'AssemblyTitleAttribute' : attribute not found d:\xyz\src\desktop\configurator2\xDocBridge\AssemblyInfo.cpp 11 xDocBridge

Error 8 error C2337: 'AssemblyDescriptionAttribute' : attribute not found d:\xyz\src\desktop\configurator2\xDocBridge\AssemblyInfo.cpp 12 xDocBridge

Error 9 error C2337: 'AssemblyConfigurationAttribute' : attribute not found d:\xyz\src\desktop\configurator2\xDocBridge\AssemblyInfo.cpp 13 xDocBridge

Error 10 error C2337: 'AssemblyCompanyAttribute' : attribute not found d:\xyz\src\desktop\configurator2\xDocBridge\AssemblyInfo.cpp 14 xDocBridge

Error 11 error C2337: 'AssemblyProductAttribute' : attribute not found d:\xyz\src\desktop\configurator2\xDocBridge\AssemblyInfo.cpp 15 xDocBridge

Error 12 error C2337: 'AssemblyCopyrightAttribute' : attribute not found d:\xyz\src\desktop\configurator2\xDocBridge\AssemblyInfo.cpp 16 xDocBridge

Error 13 error C2337: 'AssemblyTrademarkAttribute' : attribute not found d:\xyz\src\desktop\configurator2\xDocBridge\AssemblyInfo.cpp 17 xDocBridge

Error 14 error C2337: 'AssemblyCultureAttribute' : attribute not found d:\xyz\src\desktop\configurator2\xDocBridge\AssemblyInfo.cpp 18 xDocBridge

Error 15 error C2337: 'AssemblyVersionAttribute' : attribute not found d:\xyz\src\desktop\configurator2\xDocBridge\AssemblyInfo.cpp 31 xDocBridge

Error 16 error C2337: 'AssemblyDelaySignAttribute' : attribute not found d:\xyz\src\desktop\configurator2\xDocBridge\AssemblyInfo.cpp 55 xDocBridge

Error 17 error C2337: 'AssemblyKeyFileAttribute' : attribute not found d:\xyz\src\desktop\configurator2\xDocBridge\AssemblyInfo.cpp 56 xDocBridge

Error 18 error C2337: 'AssemblyKeyNameAttribute' : attribute not found d:\xyz\src\desktop\configurator2\xDocBridge\AssemblyInfo.cpp 57 xDocBridge

MY 2nd Question :

which option i used when create new platform for 64 a) empty b) wind32

and how to fixed above mentioned problems

thanx for help