JustinFisher
asked on
Unable to build simple 64-bit C++ app in VS2008
I'm trying to build a trivial "hello world" type program using the Windows console app template with precompiled headers, on an x64 platform targetting an x64 platform. I get the following error:
.\x64\Debug\stdafx.obj : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
this happens despite there being no mention of x86 in my project properties. It appears that the stdafx.cpp is being compiled for x86 regardless of what I specify.
.\x64\Debug\stdafx.obj : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
this happens despite there being no mention of x86 in my project properties. It appears that the stdafx.cpp is being compiled for x86 regardless of what I specify.
// Test64c.cpp : Defines the entry point for the console application.
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
#pragma once
#include "targetver.h"
#include <tchar.h>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
In the course of looking at the lib paths, I discovered problems with the x64 command scripts that were causing the environment to not initialize correctly. it appears that the C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC path isn't handled very well (the "(x86)" seems to cause some commands to get lost).
ASKER
Although it turned out not to be the libs that were the problem, the suggestion pointed me in the right direction.
ASKER