Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
2412 Discussions

Error with the executable linked both with TBB and Qt

Hamlet_A_
Beginner
93 Views

Hi guys,

Here's the simple code I'm compiling:

// simple.cpp

int main() { return 0; }

And here are the compiler options:

g++ -O2 -I$(INCLUDES) -DNDEBUG  simple.cpp -L$(QT_PATH) -lQtCore -L$(TBB_PATH) -ltbb -o simple

Then, once I run the ./simple, I get the following:

terminate called after throwing an instance of 'std::runtime_error'   what():  TBB failed to destroy task scheduler TLS: Invalid argument

It's interesting that, if I change the order I link to these two libraries, I get no error. I mean:

g++ -O2 -I$(INCLUDES) -DNDEBUG  simple.cpp -L$(TBB_PATH) -ltbb  -L$(QT_PATH) -lQtCore  -o simple

In this case, everything works just fine.

I'm using g++ (GCC) 4.5.2, Qt 4.7.2, TBB 4.1 2013.03.14, RedHat Enterprise Linux 4.0 U8, x86_64, Linux 2.6.9-89

Has anyone else experienced a similar thing or it's just me? Any comments are appreciated.

Thanks in advance,

Hamlet

0 Kudos
0 Replies
Reply