Next: Disabling SxS
From: "Allan Bruce" <abruceA T on 17 Feb 2005 16:42 I am trying to port my applications to 64-bit - in particular AMD64. I am running Visual Studio 2005 beta 1 under Windows XP x64 beta RC2 (build 1433) but I am getting a strange error: ".\ReleaseAMD64\drivespace.obj : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'" I have looked through the project properties and nothing specifies the machine type as X86, under linker->advanced->machinetype I have specified AMD64. This can be verified by looking at the command line - and nothing about X86 appears there either. Does anybody know how I can get this to work? Thanks, Allan
From: Stephen Kellett on 17 Feb 2005 17:49 In message <111a44q1fivrt92(a)corp.supernews.com>, Allan Bruce <abruceA(a)T.csd.abdn.ac.uk.?.?.?.invalid> writes >I am trying to port my applications to 64-bit - in particular AMD64. I am >running Visual Studio 2005 beta 1 under Windows XP x64 beta RC2 (build 1433) >but I am getting a strange error: >".\ReleaseAMD64\drivespace.obj : fatal error LNK1112: module machine type >'X86' conflicts with target machine type 'x64'" >I have looked through the project properties and nothing specifies the >machine type as X86, under linker->advanced->machinetype I have specified >AMD64. This can be verified by looking at the command line - and nothing >about X86 appears there either. Does anybody know how I can get this to >work? Take a look at all of your defines, for everything. I remember porting to the IA64 and we had this problem. Turned out that somewhere a _X86_ had crept in for one file. Don't know how it happened etc, etc. But it caused this problem. Stephen -- Stephen Kellett Object Media Limited http://www.objmedia.demon.co.uk RSI Information: http://www.objmedia.demon.co.uk/rsi.html
From: "Allan Bruce" <abruceA T on 18 Feb 2005 01:42 > Take a look at all of your defines, for everything. I remember porting to > the IA64 and we had this problem. Turned out that somewhere a _X86_ had > crept in for one file. Don't know how it happened etc, etc. But it caused > this problem. > > Stephen windows.h defines _X86_ so I tried adding #define _AMD64_ before including it and now I get a different error. e:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\Include\WinNT.h(9289) : error C3861: '__readfsdword': identifier not found My example program is merely: #define _AMD64_ #include <windows.h> int __stdcall WinMain (HINSTANCE, HINSTANCE, PSTR, int) { return 0; } Allan
From: Stephen Kellett on 18 Feb 2005 05:40 In message <111b3i7n5u7gl15(a)corp.supernews.com>, Allan Bruce <abruceA(a)T.csd.abdn.ac.uk.?.?.?.invalid> writes >> Take a look at all of your defines, for everything. I remember porting to >> the IA64 and we had this problem. Turned out that somewhere a _X86_ had >> crept in for one file. Don't know how it happened etc, etc. But it caused >> this problem. >windows.h defines _X86_ so I tried adding #define _AMD64_ before including Thats not what I meant. The solution to my problem was NOT by adding defines (as you have done), but by looking for _X86_ not in the source or headers, but in the makefile/project file. Given that your demonstration of the bug is so trivial (excellent you could define it so neatly!) I guess the other thing to check is that none of the files in your Visual Studio environment are used by the compiler. *ALL* of the header, lib, compiler and linker files should be coming from the AMD64 directories. Be sure to do a full rebuild after moving all the AMD64 directories to the top of the directories list in Visual Studio. Note I haven't worked with the AMD64 version only the IA64 version, although I'd expect them to be essentially the same. My experience was whilst porting a 2,000,000 line C++ application to IA64. Stephen -- Stephen Kellett Object Media Limited http://www.objmedia.demon.co.uk RSI Information: http://www.objmedia.demon.co.uk/rsi.html
From: "Allan Bruce" <abruceA T on 18 Feb 2005 15:04
"Stephen Kellett" <snail(a)objmedia.demon.co.uk> wrote in message news:Pk8MUXDkYcFCFwYV(a)objmedia.demon.co.uk... > In message <111b3i7n5u7gl15(a)corp.supernews.com>, Allan Bruce > <abruceA(a)T.csd.abdn.ac.uk.?.?.?.invalid> writes >>> Take a look at all of your defines, for everything. I remember porting >>> to >>> the IA64 and we had this problem. Turned out that somewhere a _X86_ had >>> crept in for one file. Don't know how it happened etc, etc. But it >>> caused >>> this problem. > >>windows.h defines _X86_ so I tried adding #define _AMD64_ before including > > Thats not what I meant. The solution to my problem was NOT by adding > defines (as you have done), but by looking for _X86_ not in the source or > headers, but in the makefile/project file. > > Given that your demonstration of the bug is so trivial (excellent you > could define it so neatly!) I guess the other thing to check is that none > of the files in your Visual Studio environment are used by the compiler. > *ALL* of the header, lib, compiler and linker files should be coming from > the AMD64 directories. Be sure to do a full rebuild after moving all the > AMD64 directories to the top of the directories list in Visual Studio. > > Note I haven't worked with the AMD64 version only the IA64 version, > although I'd expect them to be essentially the same. My experience was > whilst porting a 2,000,000 line C++ application to IA64. > > Stephen I had a look at my solution/project files and nothing to do with X86 is defined there, this is located in <windows.h> however: #if !defined(_68K_) && !defined(_MPPC_) && !defined(_X86_) && !defined(_IA64_) && !defined(_AMD64_) && defined(_M_IX86) #define _X86_ #endif This is the line causing the problems but I cannot find a solution :-( Allan |