Undefined reference to 'dlsym'

前端 未结 1 588
闹比i
闹比i 2020-12-25 15:05

I have seen a lot of similar posts, but tried every trick in the book and am still struggling. Everything was working fine, but after installing/removing wireshark with some

相关标签:
1条回答
  • 2020-12-25 15:06

    I have found the solution; setting the -Wl,--no-as-needed before -ldl The new compile command is

    gcc main.cpp -lsqlapi -lstdc++ -Wl,--no-as-needed -ldl

    Apparently it has something to do with recent versions of gcc/ld default to linking with --as-needed.

    0 讨论(0)
提交回复
热议问题