Can an executable programs run on both 64-bit and 32-bit machines?

4 ビュー (過去 30 日間)
Julius
Julius 2013 年 7 月 8 日
コメント済み: Brian Sanner 2017 年 8 月 10 日
Hello all,
I currently use a 64-bit Windows machine to compile my GUI into executable programs. Can the EXE program run on both 64-bit and 32-bit machines, or do I need to use a 32-bit machine to produce EXE programs for the 32-bit users?
It is assumed that all users have installed MCR of the correct version and the correct processor bit (e.g., 32 and 64).

採用された回答

Matt J
Matt J 2013 年 7 月 8 日
編集済み: Matt J 2013 年 7 月 8 日
It's the bitness of the MATLAB version that matters, not the bitness of the Windows OS. If you compile in a 32-bit version of MATLAB, the executable will run as a 32-bit application on any OS that can run 32 bit applications. Since both 32-bit and 64-bit Windows OS can run 32-bit applications, an executable created under 32-bit MATLAB can be deployed pretty much to any Windows OS.
Conversely, if you compile in a 64-bit MATLAB version, the executable will run as a 64-bit application. I believe only 64-bit Windows can run 64-bit applications. Therefore, you must deploy to a 64-bit Windows machine in this case.
Note however that 32-bit MATLAB can be installed under either a 32-bit or 64-bit Windows OS. So, even if you are working on a machine with a 64-bit Windows OS, if you have a 32-bit MATLAB version installed there, you can use it to create 32-bit executables for deployment to a 32-bit (or 64-bit) target OS if you want to .
  4 件のコメント
Julius
Julius 2013 年 7 月 8 日
Thank you!
Brian Sanner
Brian Sanner 2017 年 8 月 10 日
I wouldn't recommend it without checking if your uses are supported. For example, if you need to run xPC Target in 32 bit 2010b and have a 64 bit version of any kind installed it will error. As will the data acquisition toolbox when trying to connect to a DAQ. Here is another answer that explains it. I'm currently having this issue, which is why I am looking for answers.
https://www.mathworks.com/matlabcentral/answers/106138-is-it-possible-to-install-both-32-bit-and-64-bit-versions-of-matlab-on-64-bit-windows-7

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by