如何用gcc / cmake的编译一个32位二进制64位Linux机器上 [英] How to compile a 32-bit binary on a 64-bit linux machine with gcc/cmake

查看:949
本文介绍了如何用gcc / cmake的编译一个32位二进制64位Linux机器上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能在64位系统上编译32位与cmake并GCC项目?它可能是,但我怎么办呢?

当我尝试它的无知的方式,无需设置任何参数/标志/等,只设置LD_LIBRARY_PATH找到在〜/工具链接库/ lib下似乎忽略它,只能看在名为lib64的子目录。

解决方案

 导出CFLAGS = -m32
 

Is it possible to compile a project in 32-bit with cmake and gcc on a 64-bit system? It probably is, but how do I do it?

When I tried it the "ignorant" way, without setting any parameters/flags/etc, just setting LD_LIBRARY_PATH to find the linked libraries in ~/tools/lib it seems to ignore it and only look in subdirectories named lib64.

解决方案

export CFLAGS=-m32

这篇关于如何用gcc / cmake的编译一个32位二进制64位Linux机器上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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