English 中文(简体)
我的方案是否实际取决于与图书馆有联系的图书馆,但没有使用图书馆的功能?
原标题:Does my program actually depends on library that is linked against, but no function from library is used?
  • 时间:2011-10-04 11:22:29
  •  标签:
  • c++
  • qt

如果我及时汇编资料,说明实际上没有使用的图书馆,会发生什么情况? 我的方案是否仍然取决于它?

我知道,这个问题可能会被拖延(如果他不使用图书馆,那么他会联系图书馆吗?),但这里的情况是:

我正在从源头建设QT,我希望包括MySQL司机。 但是,由于自上版本以来有一些变化,通常有文件记载的方式是行不通的。 我可以具体指明图书馆的唯一方式是使用集束。 整个QT。 这意味着,QtCore或QtNetwork等其他图书馆将编成g++ ——lmysql,尽管它们没有利用该图书馆的任何功能。 问题是,这些图书馆现在是否实际上取决于我的面纱? 如果我不使用我的车司机,没有我的餐厅,我是否能够管理节目?

EDIT: I am using MinGW on Windows 7.

问题回答

Usually, yes, the executable depends on the libraries it s linked against.

If you re using gcc, you can use the linker flag --as-needed, this will make the linker omit references to libraries whose symbols are not used.

指出它能够发挥作用,因为仅仅装设图书馆就会产生可观的效果(其内库可能运行,等等)。

这完全取决于联系人,即所涉汇编者。 由于pkg-shlibs能够确定哪些可起诉人与共用图书馆毫无用处地联系在一起,我认为,对于电梯来说,答案是“是,他们实际上将依赖相关的图书馆”。





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签