简体   繁体   English

使用Qt在OS X / Mac上构建C ++库

[英]Build C++ library on OS X/Mac using Qt

I have created a C++ library on Windows using Qt and it works well. 我已经在Windows上使用Qt创建了一个C ++库,并且运行良好。 Now I want to build the same C++ library on OS X/Mac using Qt, and after running the same steps as how I made this C++ library on Windows, I'm not sure which generated files is the library I need on OS X. On Windows, I can use the library in other C++ project through the following files: .dll, object file library and the header file. 现在,我想使用Qt在OS X / Mac上构建相同的C ++库,在执行与在Windows上创建该C ++库的步骤相同的步骤后,我不确定哪个生成的文件是我在OS X上所需的库。在Windows上,我可以通过以下文件在其他C ++项目中使用该库:.dll,目标文件库和头文件。 I can find the first two files generated in the target folder: 我可以在目标文件夹中找到生成的前两个文件:

在此处输入图片说明

But on Mac, after checking the same folder I found the generated files as below: 但是在Mac上,检查相同的文件夹后,我发现生成的文件如下:

在此处输入图片说明

Which files are the library that I made? 我制作的库是哪些文件? And how to use the generated library in other C++ project on OS X? 以及如何在OS X上的其他C ++项目中使用生成的库? I try to find some step-by-step guide but with no luck so far, so if there's any useful link that will be of help. 我尝试找到一些分步指南,但到目前为止还算运气,因此,如果有任何有用的链接会有所帮助。 Thank you in advance! 先感谢您!

The library is 图书馆是

libsdk.1.0.0.dylib

all other libsdk*.dylib are links to the library (compatibility reasons, some applications look for libsdk.dylib). 所有其他libsdk * .dylib都是该库的链接(出于兼容性原因,某些应用程序会寻找libsdk.dylib)。 You use these library as you would use any other dynamic library. 您可以像使用其他任何动态库一样使用这些库。 Supply the library and the header files to the local path or install them system wide (DYLD_LIBRARY_PATH). 将库和头文件提供到本地路径或在系统范围内将它们安装(DYLD_LIBRARY_PATH)。

See How to use dylib in Mac OS X (C++) for more information. 有关更多信息,请参见如何在Mac OS X(C ++)中使用dylib

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM