Use both static and dynamically linked libraries in gcc

后端 未结 3 2063
时光说笑
时光说笑 2020-11-27 11:09

I need to distribute a binary that will run on as many x86 Linux distributions as possible. That means that I have to statically link some libraries, like glibc, because the

3条回答
  •  隐瞒了意图╮
    2020-11-27 11:33

    Try passing in the paths to the library files you're linking against on the linker command line (be they .a or .so libraries) and drop -static. That should do the trick.

提交回复
热议问题