简体   繁体   English

导入没有.dll或.lib文件的C++库

[英]Import C++ library that hasn't .dll or .lib files inside

So I have two examples of these libraries for printing nice tables.所以我有两个这些库的例子,用于打印漂亮的表格。 First and second .第一第二

I've watched MANY videos on "How to install/include/import a library into your C++ project" and each one talks about changing Visual Studio solution properties like C/C++ -> General -> Additional Include Directories , Linker -> General -> Additional Library Directories and finally Linker -> Input -> Additional Dependencies , which should contain paths to .h/.hpp or .dll/.lib files respectively.我看过很多关于“如何将库安装/包含/导入到您的 C++ 项目”的视频,每个视频都谈到更改 Visual Studio 解决方案属性,例如C/C++ -> General -> Additional Include DirectoriesLinker -> General -> Additional Library Directories最后Linker -> Input -> Additional Dependencies ,其中应该分别包含.h/.hpp.dll/.lib文件的路径。

So as we can see we don't have any of these files in the two libraries above.因此,正如我们所见,上面的两个库中没有任何这些文件。 Hence the question.因此问题。 How do I work with such libraries in my cpp project?我如何在我的 cpp 项目中使用这些库? I just need direct instructions or something because I don't think I'll ever understand otherwise.我只需要直接指示或其他东西,因为我认为否则我永远不会理解。 I am trying to install some c++ library for the first time.我第一次尝试安装一些 c++ 库。

Addition: I don't want to use any package managers .另外:我不想使用任何 package managers

libfort has a README.md that describes how to integrate it with your project (a step that does not actually require prior compilation, as it is not a "lib" but merely some additional source files to be added to your project directly). libfort有一个 README.md,描述了如何将它与您的项目集成(这个步骤实际上不需要事先编译,因为它不是“lib”,而只是一些额外的源文件,可以直接添加到您的项目中)。

bprinter requires prior compilation / installation, and comes with a CMakeLists.txt configuration to do this. bprinter需要预先编译/安装,并带有CMakeLists.txt配置来执行此操作。 You'll need CMake to do it, but it makes things really simple for you.您需要拨打 CMake才能完成此操作,但这对您来说非常简单。 Check its documentation.检查它的文档。


*.dll and *.lib are binary files compiled from the source you check out from a source repository. *.dll*.lib是从您从源存储库检出的源编译二进制文件。 They are not supposed to be provided from a GitHub repo.它们不应从GitHub回购协议中提供。 Prior to using a compiled library in the way you described (by making the necessary adjustments in your project's VS configuration), you need to compile and install the library according to that project's documentation (as with bprinter ).在以您描述的方式使用已编译的库之前(通过对项目的VS 配置进行必要的调整),您需要根据该项目的文档(与bprinter编译和安装该库。

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

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