Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

Linking pthread/dl errors when building netgen program

More
3 years 1 month ago #3588 by rick42
Hi, I have tried building the minimal netgen test program below

Code:
#include <cstddef> namespace nglib { #include <nglib.h> } int main() { nglib::Ng_Init(); nglib::Ng_Exit(); }

using the command
Code:
g++ src/main.cpp -L/opt/netgen/lib -I/opt/netgen/include -lnglib -ldl -lpthread -pthread

but linking always fails finding pthread_create and dladdr as
Code:
/opt/netgen/lib/libinterface.so: undefined reference to `pthread_create' /opt/netgen/lib/libngcore.so: undefined reference to `dladdr' collect2: error: ld returned 1 exit status
so I'm assuming there is some issue linking "dl" and "pthread" but no matter how or in which position I put the flags helps. Any ideas what could be the issue here? (Working in Ubuntu Linux 18.10 and gcc 7.5)
Time to create page: 0.142 seconds