Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
Announcements
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.

Adding new function into class task

irisshinra308
Beginner
196 Views
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

0 Kudos
2 Replies
RafSchietekat
Black Belt
196 Views
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.

irisshinra308
Beginner
196 Views
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

Reply