问题
I'm trying to build some tests for threading building blocks. Unfortunately, I'm unable to configure the tbb library. The linker cannot find the library tbb. I've tried running the scripts in bin directory which has not helped. I've even tried moving the library files to /usr/local/lib/ which was again a flop. Any suggestions would be helpful.
回答1:
Determine where you have put the tbb/lib folder, and then add the path to the library to the LD_LIBRARY_PATH environment variable, either manually or in ~/.bashrc.
Example:
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib/tbb/lib/intel64/gcc4.4
Then, compile the program using g++
- with the
-I
flag pointing at the header files directory - the
-L
flag pointing at the library directory - and
-ltbb
Example:
g++ program.cpp -o program -I/usr/local/lib/tbb/include -L/usr/local/lib/tbb/lib/intel64/gcc4.4 -ltbb
- with the
回答2:
After building/installing and making sure that /etc/ld.so.conf has the proper listing for the directories pointing to where your libraries are stored, you might want to try and run sudo ldconfig
on the command-line and see if that changes anything.
Hope this helps,
Jason
来源:https://stackoverflow.com/questions/5586396/getting-thread-building-blocks-intel-tbb-running-on-linux-with-gcc