I try to copy the lib and header files to gcc and write a simple test program, shown as below:
//############################
#include "tbb/task_scheduler_init.h"
using namespace tbb;
static const size_t N = 23;
int main() {
task_scheduler_init init;
return 0;
}
//############################
when I compiled it, with "gcc xxx.cpp", such errors were reported, shown as below:
//#############################
/tmp/ccWKfzHj.o: In function `tbb::task_scheduler_init::task_scheduler_init(int)':
compute_pi.cpp:(.text._ZN3tbb19task_scheduler_initC1Ei[tbb::task_scheduler_init::task_scheduler_init(int)]+0x28): undefined reference to `tbb::task_scheduler_init::initialize(int)'
/tmp/ccWKfzHj.o: In function `tbb::task_scheduler_init::~task_scheduler_init()':
compute_pi.cpp:(.text._ZN3tbb19task_scheduler_initD1Ev[tbb::task_scheduler_init::~task_scheduler_init()]+0x16): undefined reference to `tbb::task_scheduler_init::terminate()'
/tmp/ccWKfzHj.o:(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
//#############################
Anybody can tell me how to deal with it?
Thanks in advance.
How to use tbb with gcc ?
For more complete information about compiler optimizations, see our Optimization Notice.




