在OSX上使用Waf编译OpenGL/SDL应用程序时,如何抑制"-arch","x86_64"标志? [英] How do I suppress '-arch', 'x86_64' flags when compiling an OpenGL/SDL application with Waf on OSX?

查看:80
本文介绍了在OSX上使用Waf编译OpenGL/SDL应用程序时,如何抑制"-arch","x86_64"标志?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要隐藏Waf传递给GCC的"-arch x86_64 -arch i386"标志.

I need to suppress "-arch x86_64 -arch i386" flags Waf is passing to GCC.

我正在构建一个 SDL/Opengl 应用程序.如果我链接到32位SDL运行时,则会出现错误

I am building an SDL/Opengl application. If I link against 32 bit SDL runtime I get error

    Undefined symbols for architecture i386:
  "_SDL_Quit", referenced from:
      __del_video in SDL_functions.c.2.o
      __init_video in SDL_functions.c.2.o

如果我针对64位SDL运行时进行链接,则会收到错误消息体系结构x86_64的未定义符号"

If I link against 64 bit SDL runtime, I get error "Undefined symbols for architecture x86_64"

编译器显然使用了标记

-arch x86_64 -arch i386

我知道这会导致OSX上的GCC尝试针对两种架构进行编译.我想编译为64位,或编译为32位.如何抑制一种体系结构的标志?

I understand that this causes GCC on OSX to try to compile for both architectures. I want to either compile for 64 bit, or compile for 32 bit. How do I suppress the flags for one architecture?

推荐答案

我不知道发出命令/标志来抑制其他标志的方法.但是,要仅编译64位或32位,可以分别使用-m64或-m32.由于您要针对两种体系结构进行编译,因此-m32可能是您唯一的选择,因为-m64不适用于i386.

I don't know of a way to issue a command/flag to suppress other flags. However, to compile for only 64 or 32 bits, you can use -m64 or -m32, respectively. Since you're compiling for both architectures, -m32 might be your only option because -m64 won't work for i386.

这篇关于在OSX上使用Waf编译OpenGL/SDL应用程序时,如何抑制"-arch","x86_64"标志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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