Adding new function into class task

Adding new function into class task

Hi~

I am trying to add a new function into the class task.
I have add the following code right down the set_affinity() in the class task in task.h:

void set_affinity_priority(int id);

Then I add the following code in the task.cpp:

void task::set_affinity_priority(int id){
int i;
}

After that, I typed make to compile the tbb library succefully.
However, when I try to compile a small example which call the set_affinity_priority() function.
I got the following error message:

/tmp/cc6wmAFt.o: In function `StartTask::StartTask(int, int, int)':
main_v3.cpp:(.text._ZN9StartTaskC1Eiii[StartTask::StartTask(int, int, int)]+0x60): undefined reference to `tbb::task::set_affinity_priority(int)'
collect2: ld returned 1 exit status
make: *** [ALL] Error 1

Could anybody give me some help?

Dennis

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

Havea look at those src/tbb/*.def files... I found them very frightening myself (for manual editing, anyway), but you'll need to deal with them if you want to get something into a dynamic library.

Quoting - Raf Schietekat

Havea look at those src/tbb/*.def files... I found them very frightening myself (for manual editing, anyway), but you'll need to deal with them if you want to get something into a dynamic library.

Thanks for replying~

I found the def files already.
What should I add the corresponding entry into this file?
I have tried to google something useful about this stuff but finding nothing.
Could anyone give me a hint?

Dennis

Leave a Comment

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