- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hello spervez,
Did you added tbb library (-ltbb) to linker command line?
--Vladimir
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hello spervez,
Did you added tbb library (-ltbb) to linker command line?
--Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
![](/skins/images/45C6C2D737ED71F4C51F0145C8CB1E9C/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page