具有Code :: Blocks的64位和32位C ++可执行文件 [英] 64-bit and 32-bit C++ executables with Code::Blocks

查看:409
本文介绍了具有Code :: Blocks的64位和32位C ++可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Code :: Blocks和GCC编译器在64位计算机上编译的可执行文件。我还在32位计算机上有人无法运行可执行文件。我需要制作可执行文件的两个单独版本,还是可以编译它在32位和64位系统上运行?

I have an executable compiled on a 64-bit machine using Code::Blocks and GCC compiler. I also have someone on a 32-bit machine that can't run the executable. Do I need to make two separate versions of the executable, or is there a way that I can compile it to run on both 32-bit and 64-bit systems?

推荐答案

您可以在gcc命令行中使用-m32来构建32位版本。请确保您的代码可以从64位移植到32位。

You could use -m32 in gcc command line to build a 32-bit version. Please make sure your code is portable from 64-bit to 32-bit.

这篇关于具有Code :: Blocks的64位和32位C ++可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆