- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 MathGL在我的项目中。当我浏览包内容时,我只能找到 .a 静态库文件,我如何使用这些文件将该库包含在我的 Visual Studio 项目中?
我试图通过转到项目属性->配置属性->链接器->输入来包含所有 .a 文件
并使用“附加依赖项”链接所有 .a 文件。但是当我包含 mgl.h 文件时,我仍然会遇到很多错误。
我想我的问题是:在程序中使用库的方法是包含所需的 .a 文件吗?如果是,正确的方法是什么?
最佳答案
根据MathGL的文档,库在mathgl/lib目录下,它们是动态链接库(dlls):
同样的文档说:
Use a precompiled binary. There are binaries for MinGW (platform Win32). For a precompiled variant one needs only to unpack the archive to the location of the Chapter 1: Overview 3 compiler (i.e. mathgl/lib in mingw/lib, mathgl/include in mingw/include and so on) or in arbitrary other folder and setup paths in compiler. By default, precompiled versions include the support of GSL (www.gsl.org) and PNG. So, one needs to have these libraries installed on system (it can be found, for example, at http://gnuwin32. sourceforge.net/packages.html).
因此,您需要链接 Dll 而不是静态库,检查这个 asnwer 以了解如何链接 dll:Linking dll in Visual Studio
关于c++ - 如何将 .a 类型的静态库添加到 Visual Studio 项目中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44917587/
我是一名优秀的程序员,十分优秀!