Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
152 Views

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

Jump to solution
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<:PAIR> >::deallocate(std::pair*, unsigned long)'\\
:
tbb.C:(.text._ZN3tbb23cache_aligned_allocatorISt4pairImdEE10deallocateEPS2_m[tbb::cache_aligned_allocator<:PAIR> >::deallocate(std\\
::pair*, unsigned long)]+0x19): undefined reference to `tbb::internal::NFS_Free(void*)'
collect2: ld returned 1 exit status
So the linker cannot find a reference to NFS_Free? Can anyone help me compile this? Many thanks.
0 Kudos

Accepted Solutions
Highlighted
152 Views
hello spervez,
Did you added tbb library (-ltbb) to linker command line?
--Vladimir

View solution in original post

0 Kudos
2 Replies
Highlighted
153 Views
hello spervez,
Did you added tbb library (-ltbb) to linker command line?
--Vladimir

View solution in original post

0 Kudos
Highlighted
Beginner
152 Views
That seems to be the source of the problem.
/usr/bin/ld: cannot find -ltbb
I 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.
0 Kudos