You lost me at 'compile'...
April 2, 2008 1:11 PM   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 answers 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, 2008


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


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


« Older Grand Central alternatives?   |   To The Pain: Megaman Anniversary Collection button... Newer »
This thread is closed to new comments.