如何强制 qtcreator 创建非通用二进制文件
当我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在项目文件中使用“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
if you only need x86 you use