Chinaunix首页 | 论坛 | 博客
  • 博客访问: 236071
  • 博文数量: 52
  • 博客积分: 1355
  • 博客等级: 中尉
  • 技术积分: 485
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-06 12:23
文章分类

全部博文(52)

文章存档

2013年(5)

2012年(16)

2011年(26)

2010年(2)

2009年(1)

2008年(2)

我的朋友

分类: LINUX

2012-07-19 09:12:37

I had to compile a 32-bit application using GNU gcc on the 64-bit version Linux.

Luckily gcc man page directed me to -m32 and -m64 option. These options generate code for a 32-bit or 64-bit environments.

=> The 32-bit environment sets int, long and pointer to 32 bits and generates code that runs on any i386 system.

=> The 64-bit environment sets int to 32 bits and long and pointer to 64 bits and generates code for AMD's x86-64 architecture.

You can pass -m64 or -m32 as follows
For 32 bit version:
$ gcc -m32 -o output32 hello.c
For 64 bit version :
$ gcc -m64 -o output64 hello.c

阅读(1086) | 评论(0) | 转发(0) |
0

上一篇:C#与c++参数传递

下一篇:Oracle权限管理

给主人留下些什么吧!~~