Compile C program using dlopen and dlsym with -fPIC

前端 未结 3 925
-上瘾入骨i
-上瘾入骨i 2021-01-05 19:21

I am having a problem about a wrong symbol resolution. My main program loads a shared library with dlopen and a symbol from it with dlsym. Both the program and the library a

3条回答
  •  一个人的身影
    2021-01-05 20:17

    FWIW, I ran into a similar problem when compiling as C++ and forgetting about name mangling. A solution there is to use extern "C".

提交回复
热议问题