I have created a library that compiles well and everything. The library file is "libTextSearch.so"
Inside the library, it creates a thread
. I am using C++11 threads for this:
TextSearch::TextSearch(){
std::thread t(&TextSearch::ThreadProc, this);
t.detach();
}
As I said, the library compiles and I have the libTextSearch.so
file.
I am trying to load the library in a different application:
void* handle = dlopen("libTextSearch.so", RTLD_LAZY);
if(!handle){
//std::cout << "\n Failed to load libTextSearch.so\n\n";
fprintf(stderr, "dlopen failed: %s\n", dlerror());
return 1;
}
I have the package copied to /usr/lib
already. This is the output I get:
dlopen failed: /usr/lib/libTextSearch.so: undefined symbol: pthread_create
RUN FINISHED; exit value 1; real time: 0ms; user: 0ms; system: 0ms
I have looked up this question. I think it is related, but I have no idea of applying that to my situation.
Any ideas?