Undefined reference to pthread_atfork`

∥☆過路亽.° 提交于 2019-12-11 14:53:52

问题


Using g++ version 4.9 in Ubuntu, when compiling a C++ source file named test.cpp that needs a shared library named libUtils.so (which in its turn needs Open MPI shared library, hence the parameter -Wl,-rpath-link,/home/dummy/openmpi/build/lib ) as follows:

g++ test.cpp -lUtils -Wl,-rpath-link,/home/dummy/openmpi/build/lib

An error is thrown /home/dummy/openmpi/build/lib/libopen-pal.so.20: undefined reference to pthread_atfork.

I passed -pthread and -lpthread to g++ but none of these solved the error.

来源:https://stackoverflow.com/questions/50987587/undefined-reference-to-pthread-atfork

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!