Quantcast

Cross compiling for Windows x64/amd64 on 32-bit Windows

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Cross compiling for Windows x64/amd64 on 32-bit Windows

Arindam Mukherjee
Hi,

I have a Windows XP build setup with Visual Studio 2008 SP1 and
Windows SDK 6. I have set up a CMake project for a source base that is
built on Linux, Solaris, AIX and Windows. So far I have managed to get
the Windows 32-bit build going but cannot make the x64 cross-compile
work.

It seems that CMake generates 32-bit builds even when I initialize the
64-bit build system (vcvarsall.bat x64). What is the correct way to
set such a build up.

Thanks,
Arindam
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cross compiling for Windows x64/amd64 on 32-bit Windows

John Drescher-2
On Mon, Oct 1, 2012 at 4:35 PM, Arindam Mukherjee
<[hidden email]> wrote:

> Hi,
>
> I have a Windows XP build setup with Visual Studio 2008 SP1 and
> Windows SDK 6. I have set up a CMake project for a source base that is
> built on Linux, Solaris, AIX and Windows. So far I have managed to get
> the Windows 32-bit build going but cannot make the x64 cross-compile
> work.
>
> It seems that CMake generates 32-bit builds even when I initialize the
> 64-bit build system (vcvarsall.bat x64). What is the correct way to
> set such a build up.
>

I do not believe Visual Studio will build x64 targets on 32 bit
windows. The first issue would be installing the x64 compiler. However
I could be wrong.

John
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cross compiling for Windows x64/amd64 on 32-bit Windows

Xavier Besseron
In reply to this post by Arindam Mukherjee
Hi,

I was able to build win64 executable on my 32-bit Windows.

First, I had to make the "full installation" of VS 2008 (the "default
installation" did not provide the win64 compiler in my case). Then, I
had to select the "Visual Studio 9 2008 Win64" generator in CMake. And
the project built correctly.

However, it is not possible to execute the generated binaries on a
32-bit Windows.


Xavier

On Mon, Oct 1, 2012 at 10:45 PM, John Drescher <[hidden email]> wrote:

> On Mon, Oct 1, 2012 at 4:35 PM, Arindam Mukherjee
> <[hidden email]> wrote:
>> Hi,
>>
>> I have a Windows XP build setup with Visual Studio 2008 SP1 and
>> Windows SDK 6. I have set up a CMake project for a source base that is
>> built on Linux, Solaris, AIX and Windows. So far I have managed to get
>> the Windows 32-bit build going but cannot make the x64 cross-compile
>> work.
>>
>> It seems that CMake generates 32-bit builds even when I initialize the
>> 64-bit build system (vcvarsall.bat x64). What is the correct way to
>> set such a build up.
>>
>
> I do not believe Visual Studio will build x64 targets on 32 bit
> windows. The first issue would be installing the x64 compiler. However
> I could be wrong.
>
> John
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cross compiling for Windows x64/amd64 on 32-bit Windows

Arindam Mukherjee
On Tue, Oct 2, 2012 at 2:48 AM, Xavier Besseron <[hidden email]> wrote:

> Hi,
>
> I was able to build win64 executable on my 32-bit Windows.
>
> First, I had to make the "full installation" of VS 2008 (the "default
> installation" did not provide the win64 compiler in my case). Then, I
> had to select the "Visual Studio 9 2008 Win64" generator in CMake. And
> the project built correctly.
>
> However, it is not possible to execute the generated binaries on a
> 32-bit Windows.
>
>

Thanks! That works perfectly. From a driver batch script, I now use:

cmake -G "Visual Studio 9 2008 Win32" src_dir

and:

cmake -G "Visual Studio 9 2008 Win64" src_dir

This, I guess, should work even if I move to a 64-bit build machine.

Thanks again.
Arindam
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cross compiling for Windows x64/amd64 on 32-bit Windows

David Cole
On Tue, Oct 2, 2012 at 5:30 AM, Arindam Mukherjee <[hidden email]> wrote:
On Tue, Oct 2, 2012 at 2:48 AM, Xavier Besseron <[hidden email]> wrote:
> Hi,
>
> I was able to build win64 executable on my 32-bit Windows.
>
> First, I had to make the "full installation" of VS 2008 (the "default
> installation" did not provide the win64 compiler in my case). Then, I
> had to select the "Visual Studio 9 2008 Win64" generator in CMake. And
> the project built correctly.
>
> However, it is not possible to execute the generated binaries on a
> 32-bit Windows.
>
>

Thanks! That works perfectly. From a driver batch script, I now use:

cmake -G "Visual Studio 9 2008 Win32" src_dir

and:

cmake -G "Visual Studio 9 2008 Win64" src_dir

This, I guess, should work even if I move to a 64-bit build machine.

Thanks again.
Arindam
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


cmake -G "Visual Studio 9 2008 Win32" src_dir

will not work. There is no such generator. Leave out the " Win32" for this case... it is implied.


HTH,
David


--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cross compiling for Windows x64/amd64 on 32-bit Windows

Arindam Mukherjee
On Tue, Oct 2, 2012 at 4:22 PM, David Cole <[hidden email]> wrote:

> On Tue, Oct 2, 2012 at 5:30 AM, Arindam Mukherjee
> <[hidden email]> wrote:
>>
>> On Tue, Oct 2, 2012 at 2:48 AM, Xavier Besseron <[hidden email]>
>> wrote:
>> > Hi,
>> >
>> > I was able to build win64 executable on my 32-bit Windows.
>> >
>> > First, I had to make the "full installation" of VS 2008 (the "default
>> > installation" did not provide the win64 compiler in my case). Then, I
>> > had to select the "Visual Studio 9 2008 Win64" generator in CMake. And
>> > the project built correctly.
>> >
>> > However, it is not possible to execute the generated binaries on a
>> > 32-bit Windows.
>> >
>> >
>>
>> Thanks! That works perfectly. From a driver batch script, I now use:
>>
>> cmake -G "Visual Studio 9 2008 Win32" src_dir
>>
>> and:
>>
>> cmake -G "Visual Studio 9 2008 Win64" src_dir
>>
>> This, I guess, should work even if I move to a 64-bit build machine.
>>
>> Thanks again.
>> Arindam
>> --
>>
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
>
>
>
> cmake -G "Visual Studio 9 2008 Win32" src_dir
>
> will not work. There is no such generator. Leave out the " Win32" for this
> case... it is implied.
>
>

How would it be on a Windows x64 box? I don't have access to one.
Would "Visual Studio 9 2008" still mean 32-bit on it?

Arindam
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cross compiling for Windows x64/amd64 on 32-bit Windows

Xavier Besseron
In reply to this post by David Cole
On Tue, Oct 2, 2012 at 1:09 PM, Arindam Mukherjee
<[hidden email]> wrote:

> On Tue, Oct 2, 2012 at 4:22 PM, David Cole <[hidden email]> wrote:
>>
>>
>> cmake -G "Visual Studio 9 2008 Win32" src_dir
>>
>> will not work. There is no such generator. Leave out the " Win32" for this
>> case... it is implied.
>>
>>
>
> How would it be on a Windows x64 box? I don't have access to one.
> Would "Visual Studio 9 2008" still mean 32-bit on it?
>

Yes. VS9 Win32 generator is still called "Visual Studio 9 2008" on a
64-bit Windows.

Xavier
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Loading...