0

I am using a 64 bit VS-2008 compiler to compile the code and it generates 64 bit binaries.But I have a one module which should be built to generate 32 bit binaries.

Is it possible to compile and generate 32 bit binaries using 64 bit compiler.

If Yes, then what option we need to specify so that at runtime the 64 bit compiler consider the code as 32 bit and generates 32 bit binaries.

P.S.: I am using VS 2008 compiler (amd64/Bin/cl.exe). I specify the compiler at first(i.e. 64 bit) and then compile my all the modules.

Thanks, Nikhil

Nikhil
  • 299
  • 3
  • 6
  • 17
  • any reason you cannot use the 32bit compiler to compile 32bit binaries? – stijn Mar 06 '13 at 08:09
  • @stijn: we have developed our own script for compilation and build which internally uses VS compilers. So before we start the compilation we need to specify which is version of compiler you are going to use and based on that it selects the compiler and build the whole code. In this case we have specified 64 bit compiler as we need 64bit binaries but one module should be built as 32 bit as it has some third party libs which are 32 bit. Yes, we can compile this with 32bit VS compiler but in this case it will generate 32 bit binaries but we need 64 bit :) . – Nikhil Mar 06 '13 at 08:27
  • In our build and compilation script, the compiler reads one file(contains all compilation & linker options as in VS) that is found in each module and based on that it does the compilation. Now here I am looking for a option which should guide to 64 bit compiler to compile as 32 bit? – Nikhil Mar 06 '13 at 08:39
  • I'm afraid you are going to have to fix your build scripts then - afaik it is not possible to geberate 32bit binaries using the 64bit compiler.. See here for example: http://stackoverflow.com/questions/1036380/can-i-still-develop-32-bit-applications-using-a-64-bit-machine – stijn Mar 06 '13 at 09:35

0 Answers0