You lost me at 'compile'...
April 2, 2008 1:11 PM   RSS feed for this thread Subscribe

I've inherited a code....and now I need to move it to a 64-bit machine...how to get it to compile? $&*$%^&!

I have a program written in C that I've been modifying and running on my regular Windows 2000 machine using MS Visual C++ 6.0. Now I need to be able to compile and run the code on a Windows XP Professional 64 machine, using MS Visual Studio 2005.

I have been able to get the code to compile by copying the .dsw file, but when it runs it has stack errors, which I suspect are from the way the variables are defined. I have been told that there is a way to compile in a 32-bit way, by setting a flag or something...can anyone help me out with this, in very easy language? Or link me to instructions? I'm familiar with computers and several programming languages, but compiling options are beyond me.

I do not need the program to use the 64-bit capability of the machine, just want to be able to compile and run the same code I was running before, error-free. Thanks!
posted by lemonade to computers & internet (3 comments total)
I don't know about the windows end of things, but on linux, the bitness at which you compile (32 vs. 64) is determined by the libraries against which you are linking. If you're on a 64-bit operating system, you'll need to compile for 64-bit mode.

The most important thing is that you clean everything so that you have no 32-bit intermediate files hanging around. Likewise, you might consider simply making a new project, importing your code, and trying "fresh".
posted by Netzapper at 1:28 PM on April 2


In VS 2005, open up Project->Properties. In the properties window, open Configuration Properties->Linker->Advanced. There you can set Target Machine to MachineX86 (as opposed to MachineX64).

Also, under Configuration Properties->C/C++->General you'll want to make sure "Detect 64-bit Portability Issues" is set to Yes.
posted by jedicus at 1:35 PM on April 2


In g++ you use the flag -m32 to build a 32-bit version of your program on a 64-bit box. I would imagine a similar flag exists on Windows. This is an alternative if you don't want to actually make the program portable between different computer architectures. It sounds like this would be fine for you.
posted by chunking express at 10:55 AM on April 4


« Older I need suggestions for a Googl...   |   I am playing the Megaman Anniv... Newer »

You are not logged in, either login or create an account to post comments



Related Questions
Compiler, instruction,... Whats your function? January 29, 2008
Sending E-mails with PHP August 7, 2007
Mark CF, if you're reading this, shoo! January 23, 2007
help me understand programming grammar August 14, 2006
Xanga blog 'next/previous' date query September 19, 2005