简体   繁体   English

如何在Qt Creator中使用TBB

[英]How to use the TBB in Qt Creator

I am trying to use the TBB in the Qt Creator. 我正在尝试在Qt Creator中使用TBB。 I am using the Qt 4.7 and TBB 3.0, below is my setting in .pro. 我正在使用Qt 4.7和TBB 3.0,以下是我在.pro中的设置。

INCLUDEPATH += C:\tbb30\include
LIBS += C:\tbb30\lib\ia32\vc10\*.lib

My sample code is very simple: 我的示例代码非常简单:

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    tbb::concurrent_vector<int> v;
    v.push_back(1);
    v.push_back(2);
    v.push_back(3);
    v.push_back(4);

    std::cout<<v.size();

    return a.exec();
}

But the program exit with the code -1073741515 但是程序退出,代码为-1073741515

Anyone use the TBB in the Qt Creator before? 有人在Qt Creator中使用过TBB吗?

Best Regards, 最好的祝福,

in LIBS, I don't think you can use joker characters (*, ?). 在LIBS中,我认为您不能使用小丑字符(* 、?)。 You need to use the actual name of the lib. 您需要使用库的实际名称。 Note that you can specify a search path for libs, then the lib name in "short format". 请注意,您可以为libs指定一个搜索路径,然后以“短格式”指定lib名称。 If you aim at cross-compilation, it can be useful. 如果您打算交叉编译,那么它会很有用。

Here is an example to link Open Ssl (might be useful for you) 这是链接Open Ssl的示例(可能对您有用)

LIBS += -L$${OPEN_SSL}/lib
LIBS += -llibeay32
LIBS += -lssleay32

Concerning your error code, what compiler are you using (mingwin or visual?). 关于您的错误代码,您正在使用什么编译器(mingwin还是visual?)。 In any case, you can check the generated command to try to understand why it goes wrong (the linker command). 在任何情况下,您都可以检查生成的命令以尝试理解它为什么出错(链接器命令)。 Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM