The question is published on by Tutorial Guruji team.
I am attempting to build an executable and some associated dlls in Windows VS Command Prompt. The project comes with a scons file, so I simply type scons in a VS Cmd Prompt.
The executable is being built inside an “x86” VS Cmd Prompt. However, when run the executable is not 32 bit (confirmed with Task Manager.) My coworker builds the same exact project on his 64 bit machine, using the scons file, and his executable is 32 bit on my computer. (confirmed with Task Manager once again)
The dll’s are being loaded by a 32 bit JVM, and they throw an error as they are 64 bit. My coworkers dll’s do not.
We cannot figure out why my computer is forcing a 64 bit build inside the “x86” VS environment. Does anyone have any suggestions?
P.S. – I have MS VS 2010 and he has the MS VS 2010 Express.
P.S.S. – I have 64 bit python, and thus my scons is also 64 bit. However, so does my coworker though.
Scons would normally determine what tool-chain (i.e., compiler) to use (if you don’t specify it explicitly) based on what it can find installed.
A Visual Studio 2010 Express can only build 32-bit binaries – even on a 64-bit Windows – so that is what Scons would do. With a Visual Studio 2010 ‘non-express’ in which both 32- and 64-bit compilers are available, Scons would presumably go for a 64-bit build on a 64-bit Windows.
To specify a 32- or 64-bit build of a Scons project, you can set
TARGET_ARCH to ‘x86’ or ‘x86_64’, respectively. See also Scons Construction Variables.