Boost 库名称缺少版本标签
我根据文档使用以下命令构建了 boost:
bjam.exe toolset=msvc-9.0variant=release link=shared stage
这为我提供了文件夹阶段中的所有库。我为每个 boost 包获取 3 个文件,例如:boost_regex-vc90-mt-1_45.dll
boost_regex-vc90-mt-1_45.lib
boost_regex-vc90-mt.lib
没有版本标签的lib文件是什么? boost_regex-vc90-mt-1_45.lib 和 boost_regex-vc90-mt.lib 有什么区别?
boost 文档说明如下:
“扩展名:根据操作系统的惯例确定。在大多数unix风格平台上,静态库(档案)和共享库的扩展名分别为.a和.so。在Windows上,.dll表示共享库.lib 表示静态或导入库。如果 Unix 变体上的工具集支持,则会添加完整版本扩展名(例如“.so.1.34”),并且将添加指向库文件的符号链接(命名时不带尾随版本号)。也被创建。”
http://www.boost.org/doc /libs/1_45_0/more/getting_started/windows.html#library-naming
没有版本标记的文件是库文件的符号链接? Windows 中的符号链接?我不明白。
I have built boost according to the documentation using:
bjam.exe toolset=msvc-9.0 variant=release link=shared stage
This gives me all libraries in the folder stage. I get 3 files for each boost package, for example:
boost_regex-vc90-mt-1_45.dll
boost_regex-vc90-mt-1_45.lib
boost_regex-vc90-mt.lib
What is the lib file without version tag? What is the difference between boost_regex-vc90-mt-1_45.lib and boost_regex-vc90-mt.lib ?
The boost documentation states the following:
"Extension: determined according to the operating system's usual convention. On most unix-style platforms the extensions are .a and .so for static libraries (archives) and shared libraries, respectively. On Windows, .dll indicates a shared library and .lib indicates a static or import library. Where supported by toolsets on unix variants, a full version extension is added (e.g. ".so.1.34") and a symbolic link to the library file, named without the trailing version number, will also be created."
http://www.boost.org/doc/libs/1_45_0/more/getting_started/windows.html#library-naming
The file without a version tag is a symbolic link to the library file? Symbolic links in windows? I do not understand.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想这是 Windows 上的副本。构建脚本尝试像在 UNIX 上一样执行符号链接,但由于 Windows 不支持它,因此将其定义为复制。
在 unix 上,您通常将
libboost_regex.so
作为libboost_regex.so.1.45.0
的符号链接。编译器查找libboost_regex.so
,读取链接并将全名存储在二进制文件中,因此动态链接器会为此加载libboost_regex.so.1.45.0
即使在libboost_regex.so.1.46.0
时也可以运行程序,但新程序会链接到最新版本。构建脚本似乎试图尽可能地模拟 Windows 上的行为。I suppose it's a copy on windows. The build script attempts to do symbolic link as it would on unix, but because it's not supported on windows, it's defined as copy.
On unix, you normally have
libboost_regex.so
as symlink tolibboost_regex.so.1.45.0
. The compiler looks for thelibboost_regex.so
, reads the link and stores the full name in the binary, so the dynamic linker than loadslibboost_regex.so.1.45.0
for that program even whenlibboost_regex.so.1.46.0
, but new programs are linked against the latest version. The build script seems to try to emulate that behaviour on windows as much as possible.