﻿# Can I port code to a 64\-bit platform under a 32\-bit platform?

Yes, you can do this if you use a cross\-compiler that creates a native code for a platform different from that on which your code is executed\.

For Visual C\+\+, for example, you can use X86\_amd64 and X86\_IA64 cross\-compilers included into the Windows SDK pack to create 64\-bit binary files in a 32\-bit Windows\.

Remember that mere recompilation \(even if you checked all the compiler warnings\) is usually not enough for correct port of a real project to another platform\. A code that has been working correctly on the initial platform may become [incorrect](https://pvs-studio.com/en/blog/posts/cpp/a0004/) after being recompiled for another platform\.

Detection of porting errors should be started at the stage of code editing/recompilation already \- it is possible if you use the [static analysis](https://pvs-studio.com/en/blog/terms/0046/) methodology, for example\. It will allow you to carry out the initial project migration stage using the cross\-compiler without launching the program on the target platform\.

## References

1. Wikipedia\. [Cross compiler\.](https://en.wikipedia.org/wiki/Cross_compiler)
1. Andrey Karpov\. [Seven Steps of Migrating a Program to a 64\-bit System\.](https://pvs-studio.com/en/blog/posts/cpp/a0042/)
1. Andrey Karpov, Evgeniy Ryzhkov\. [Lessons on development of 64\-bit C/C\+\+ applications\.](https://pvs-studio.com/en/blog/lessons/)