Creating static libraries

后端 未结 2 1603
一生所求
一生所求 2021-02-10 17:37

I\'m trying to create a static library to use inside my PHP extension. To do that, I\'m compiling my .c files using gcc -c file.c -o file.o and obtaini

2条回答
  •  忘掉有多难
    2021-02-10 18:18

    Linking shared libraries to static libraries is not possible (unless you really know very well what you are doing). Don't do it.

    The first warning is from libtool. It tells you, that the operation you asked for will do different things on different systems and some of those things are probably not what you want. Often it's just going to fail in various spectacular ways, because code that goes in shared and static libraries needs to be compiled with different compiler flags.

    i have faced same problem once but i have solved it by corrcting some linking flag in make file you can see

    What is the meaning of “Warning: Linking the shared library against static library is not portable”?

提交回复
热议问题