什么是&QUOT的含义;警告:对链接的静态库共享库是不可移植的"? [英] What is the meaning of "Warning: Linking the shared library against static library is not portable"?

查看:558
本文介绍了什么是&QUOT的含义;警告:对链接的静态库共享库是不可移植的"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想提出一个动态库,通过使用libmxml.a库的某些功能,但我得到这样的警告:

I am making one dynamic library by using some function of libmxml.a library but I get this warning:

*Warning: Linking the shared library libgstmatroskademux.la against the _
*static library /home/Mr32/gst-template4_final/gst-plugin/src/libmxml.a _
is not portable!

我也得到这样的警告:

I also get this warning:

gcc: /home/Mr32/gst-template4_final/gst-plugin/src/libmxml.a: linker _
input file unused because linking not done

那么,这个警告的含义,我怎么能解决呢?

So what's the meaning of this warning and how could I solve it?

编辑:

有是用于编译的GStreamer插件1已经自动生成make文件。现在使用libmxml.a的一些功能在该插件我在 GST_CFLAGS $(PATH)/libmxml.a C>在make文件变量。现在,当我做制作制作安装,插件工作正常,但我还是得到这样的警告。

There is one already autogenerated make file for compiling the gstreamer plugin. Now to use some function of libmxml.a in that plugin I have added $(PATH)/libmxml.a in the GST_CFLAGS variable in the make file. Now, when I do make and make install, the plugin works fine, but I still get this warning.

推荐答案

链接共享库静态库是不可能的(除非你真的很清楚自己在做什么)。不这样做。

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

第一个警告是libtool的。它告诉你,你要的操作将做不同的系统不同的事情和一些这些东西可能不是你想要的。通常,它只是将各种壮观的方式失败,因为需要用不同的编译器标志进行编译code,它在云共享和静态库。

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.

第二个警告是来自海湾合作委员会。它告诉你,提供静态库时的编译的是毫无意义的。那是因为你有 $(PATH)/libmxml.a C 的旗标,其中它没有被企业。事实上,大多数的时候你应该的的有 $(PATH)/libmxml.a ,但 -L $ (PATH)-lmxml 来代替。这应该还是走在 LD 的旗标,但GCC不会,如果这使它对编译器的命令行太抱怨。

The second warning is from gcc. It is telling you that providing static library when compiling is pointless. That's because you have $(PATH)/libmxml.a in CFLAGS, where it has no business of being. In fact, most of the time you should not have $(PATH)/libmxml.a, but -L$(PATH) -lmxml instead. That should still go in LDFLAGS, but gcc won't complain if this makes it to the compiler command-line too.

这篇关于什么是&QUOT的含义;警告:对链接的静态库共享库是不可移植的"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆