• 6505阅读
  • 3回复

请问qt中QLibrary的LoadHints属性是做什么的阿。E文没有看到。 [复制链接]

上一主题 下一主题
离线culgi
 
只看楼主 倒序阅读 楼主  发表于: 2008-01-10
— 本帖被 XChinux 执行加亮操作(2008-07-17) —
oadHints : LoadHints
This property holds give the load() function some hints on how it should behave.
You can give some hints on how the symbols are resolved. Usually, the symbols are not resolved at load time, but resolved lazily, (that is, when resolve() is called). If you set the loadHint to ResolveAllSymbolsHint, then all symbols will be resolved at load time if the platform supports it.
Setting ExportExternalSymbolsHint will make the external symbols in the library available for resolution in subsequent loaded libraries.
If LoadArchiveMemberHint is set, the file name is composed of two components: A path which is a reference to an archive file followed by the second component which is the reference to the archive member. For instance, the fileName libGL.a(shr_64.o) will refer to the library shr_64.o in the archive file named libGL.a. This is only supported on the AIX platform.
The interpretation of the load hints is platform dependent, and if you use it you are probably making some assumptions on which platform you are compiling for, so use them only if you understand the consequences of them.
By default, none of these flags are set, so libraries will be loaded with lazy symbol resolution, and will not export external symbols for resolution in other dynamically-loaded libraries.
Access functions:
LoadHints loadHints () const
void setLoadHints ( LoadHints hints )
------------------------------------------------------------------------------------------------------
enum QLibrary::LoadHint
flags QLibrary::LoadHints
This enum describes the possible hints that can be used to change the way libraries are handled when they are loaded.

Constant  Value  Description
QLibrary::ResolveAllSymbolsHint  0x01  Try to resolve all symbols in a library as soon as it is loaded.
QLibrary::ExportExternalSymbolsHint  0x02  Export unresolved symbols in the library so that they can be resolved in other dynamically-loaded libraries.
QLibrary::LoadArchiveMemberHint  0x04  Allow the file name of the library to specify a particular object file within an archive file.

The LoadHints type is a typedef for QFlags<LoadHint>. It stores an OR combination of LoadHint values.
See also loadHints.
离线foxyz

只看该作者 1楼 发表于: 2008-01-10
唉,E文的都说这么详细了。不知道你还想知道什么
离线foxyz

只看该作者 2楼 发表于: 2008-01-10
我再贴一点:
loadHints : LoadHints
This property holds give the load() function some hints on how it should behave.

You can give some hints on how the symbols are resolved. Usually, the symbols are not resolved at load time, but resolved lazily, (that is, when resolve() is called). If you set the loadHint to ResolveAllSymbolsHint, then all symbols will be resolved at load time if the platform supports it.

Setting ExportExternalSymbolsHint will make the external symbols in the library available for resolution in subsequent loaded libraries.

If LoadArchiveMemberHint is set, the file name is composed of two components: A path which is a reference to an archive file followed by the second component which is the reference to the archive member. For instance, the fileName libGL.a(shr_64.o) will refer to the library shr_64.o in the archive file named libGL.a. This is only supported on the AIX platform.

The interpretation of the load hints is platform dependent, and if you use it you are probably making some assumptions on which platform you are compiling for, so use them only if you understand the consequences of them.

By default, none of these flags are set, so libraries will be loaded with lazy symbol resolution, and will not export external symbols for resolution in other dynamically-loaded libraries.

Access functions:

LoadHints loadHints () const
void setLoadHints ( LoadHints hints )
离线foxyz

只看该作者 3楼 发表于: 2008-01-10
如果你了解library的工作原理,那么你就能理解里边的symbols是什么,resolved lazily是什么!
快速回复
限100 字节
 
上一个 下一个