问题描述
我在Visual Studio项目中使用OpenMP,目前正在认真思考如何转换为QT创建者. (Visual Studio不会烂吗?,我希望微软能提供更多的帮助)
I am using OpenMP in my Visual Studio projects and currently thinking very seriously in changing to QT creator. (Doesn't Visual Studio suck?,I expect much more from Microsoft)
但是无论如何... QT创建者是否支持OpenMP?在这种情况下,我应该怎么做才能启用它?还是默认情况下启用?我需要做点特别的事情吗?
But anyway... Does QT creator support OpenMP?In case of that, what should I do to enable it? Or maybe is enabled by default? Do I need to do something special?
感谢您的建议.伊格纳西奥.
Thanks for your advices.Ignacio.
推荐答案
正如其他人所提到的,支持OpenMP的不是Qt本身,而是编译器.
As someone else mentioned, it's not Qt itself that support OpenMP but the compiler.
如果您已安装最新的Qt 4.6.x SDK (提示:最新的QtCreator 1.3包含在内),它随附具有内置OpenMP支持的MinGW 4.4.
If you have installed a recent Qt 4.6.x SDK (hint: latest QtCreator 1.3 is included), it comes with MinGW 4.4 which has OpenMP support built-in.
编辑您的项目.pro文件,并添加以下行以将OpenMP标志传递给编译器:
Edit your project .pro file and add the following lines to pass the OpenMP flags to the compiler :
QMAKE_CXXFLAGS += -fopenmp
LIBS += -fopenmp
享受!
这篇关于Qt是否支持OpenMP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!