如何强制 qtcreator 创建非通用二进制文件

发布于 2024-09-16 06:23:16 字数 898 浏览 1 评论 0原文

当我在 Mac 上使用 qtcreator 时,它会创建通用二进制文件。

有谁知道如何设置它,以便它只创建一个“本机”二进制文件? (所以在我的例子中是 i386?)

Qtcreator 使用 qmake 作为构建系统。

到目前为止,Google 还不是我的朋友,我希望 stackoverflow 能成为我的朋友。

编辑: 到目前为止我的配置文件:

TARGET = mongowriter
CONFIG   += console
CONFIG   -= app_bundle
CONFIG += x86
#CONFIG -= ppc 

TEMPLATE = app

INCLUDEPATH += /opt/local/include/.
INCLUDEPATH += ../mongodb/.

SOURCES += main.cpp

LIBS += /usr/local/lib/libmongoclient.a
LIBS += /opt/local/lib/libboost_thread-mt.a
LIBS += /opt/local/lib/libboost_filesystem.a
LIBS += /opt/local/lib/libboost_program_options.a

它仍然在 libmongoclient.a 上给出错误
libboost 库都可以,但这是因为我使用 +universal 选项从 macports 获取它们。

由于 mongoclient 不支持通用,我目前正在删除所有通用的东西。我希望在 boost 库中出现 3 个错误,并且至少 east mongoclient 会链接。 那时我可以再次重做整个 macport 故事,但这次删除了通用。

不幸的是,它似乎仍然构建了一个通用二进制文件,因为我仍然有相同的链接器错误。

谢谢你的帮助

When I use qtcreator on mac, it creates universal binaries.

Does anyone know how to set it so it just creates a 'native' binary? (So i386' in my case?)

Qtcreator uses qmake as a buildsystem.

Google hasn't been my friend so far, I hope stackoverflow will.

EDIT:
my config file so far:

TARGET = mongowriter
CONFIG   += console
CONFIG   -= app_bundle
CONFIG += x86
#CONFIG -= ppc 

TEMPLATE = app

INCLUDEPATH += /opt/local/include/.
INCLUDEPATH += ../mongodb/.

SOURCES += main.cpp

LIBS += /usr/local/lib/libmongoclient.a
LIBS += /opt/local/lib/libboost_thread-mt.a
LIBS += /opt/local/lib/libboost_filesystem.a
LIBS += /opt/local/lib/libboost_program_options.a

It still gives the error on the libmongoclient.a
The libboost libraries are all ok, but this is because I got them from macports with the +universal option.

Since mongoclient doesn't support universal I'm currently removing all the universal stuff. I was hoping to get 3 errors for the boost libs and that at l;east mongoclient would link.
At that point I could redo the whole macport story again but this time with universal removed.

Unfortunately it seems it still builds a universal binary since I still have the same linker errors.

thanks for the help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半仙 2024-09-23 06:23:16

您可以在项目文件中使用“CONFIG”变量来指定应支持哪些平台来创建您使用的通用二进制文件

 CONFIG += x86 ppc

如果您只需要使用 x86,

 CONFIG += x86

you can use the 'CONFIG' variable in your project file to specify which plattforms shall be supported to create a universial binary you use

 CONFIG += x86 ppc

if you only need x86 you use

 CONFIG += x86
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文