undefined reference to `tbb::internal::NFS_Free(void*)'

undefined reference to `tbb::internal::NFS_Free(void*)'

Hi everyone, I wrote a simple program to use a concurrent_priority_queue. I followed the sample code. Here's all I have right now.#include "/tbb/concurrent_priority_queue.h"#include using namespace std;using namespace tbb;typedef std::pair vertex_rec;class compare_f {public: bool operator()(const vertex_rec& u, const vertex_rec& v) const { return u.second>v.second; }};concurrent_priority_queue open_set;Compiling this gives me an error./tmp/ccIzLsvO.o: In function `tbb::cache_aligned_allocator >::deallocate(std::pair*, unsigned long)'\\:tbb.C:(.text._ZN3tbb23cache_aligned_allocatorISt4pairImdEE10deallocateEPS2_m[tbb::cache_aligned_allocator >::deallocate(std\\::pair*, unsigned long)]+0x19): undefined reference to `tbb::internal::NFS_Free(void*)'collect2: ld returned 1 exit statusSo the linker cannot find a reference to NFS_Free? Can anyone help me compile this? Many thanks.

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Best Reply

hello spervez,Did you added tbb library (-ltbb) to linker command line?--Vladimir

That seems to be the source of the problem./usr/bin/ld: cannot find -ltbbI did a source build of tbb. There is no libs folder and I couldnt find a file name tbb.so, or similar. Would I have to download this file from somewhere?Update: thanks for your help. I realized I needed to run the tbbvars.sh script and everything seems ok now. Thanks again.

Leave a Comment

Please sign in to add a comment. Not a member? Join today