简体   繁体   English

如何在 Visual Studio 中安装 libxml++? nmake 会“看到”vcpkg 包吗?

[英]How to install libxml++ in Visual studio? Does nmake "see" vcpkg packages?

I am having troubles installing libxmlplusplus ( https://github.com/libxmlplusplus/libxmlplusplus ) in Visual studio.我在 Visual Studio 中安装 libxmlplusplus ( https://github.com/libxmlplusplus/libxmlplusplus ) 时遇到问题。

It is extremely annoying libxml2 wrapper that someone used to parse setup for project I am working and it has so many annoying little dependencies that I am tempted just to rewrite setup parsing with new code as I want to distribute this project as open source and I wish to no one to go through with installation of this library.这是非常烦人的 libxml2 包装器,有人用来解析我正在工作的项目的设置,它有很多烦人的小依赖项,我很想用新代码重写设置解析,因为我想将这个项目作为开源分发,我希望go 没有人通过安装这个库。

The README file in MSVC_NMake directory states that I only need to install libxml2 and include it in my VC directories. MSVC_NMake 目录中的 README 文件声明我只需要安装 libxml2 并将其包含在我的 VC 目录中。 Now I know that this hellish library also needs glib, and glibmm as few years back, this person http://hostagebrain.blogspot.com/2015/07/building-libxml-by-visual-studio.html went through horrible ways to build everything in VC when I am assuming glibmm and libxml2 were not easy to get.现在我知道这个地狱般的图书馆也需要 glib 和 glibmm 几年前,这个人http://hostagebrain.blogspot.com/2015/07/building-libxml-by-visual-studio.html经历了可怕的方式当我假设 glibmm 和 libxml2 不容易获得时,在 VC 中构建所有内容。

I installed glibmm and libxml2 via vcpkg.我通过 vcpkg 安装了 glibmm 和 libxml2。 I downloaded libxmlplusplus, went to MSVC_NMake directory and run:我下载了 libxmlplusplus,转到 MSVC_NMake 目录并运行:

nmake /f Makefile.vc CFG=release

I am getting error messages as:我收到如下错误消息:

..\libxml++\attribute.cc: fatal error C1083: Cannot open include file: 'msvc_recommended_pragmas.h': No such file or directory

So it seems some dependency is not linked, but have no idea which.所以似乎有些依赖关系没有链接,但不知道是哪个。 I checked..\libxml++\attribute.cc and went down the include labyrinth to find out that it includes libxml\tree.h and libxml is part of libxml2, so I am suspecting libxml2 was not linked properly.我检查了 ..\libxml++\attribute.cc 并进入包含迷宫,发现它包含 libxml\tree.h 并且 libxml 是 libxml2 的一部分,所以我怀疑 libxml2 没有正确链接。

I exited powershell and then went to manually set VC includes and library dirs to vcpkg/packages/xxx location where they are installed, but I am still getting the same error.我退出 powershell 然后去手动设置 VC includes 和 library dirs 到它们安装的 vcpkg/packages/xxx 位置,但我仍然得到同样的错误。

I added glibmm to VC dirs, I even installed gtk and linked to VC hoping it'll find the missing header.我将 glibmm 添加到 VC 目录,我什至安装了 gtk 并链接到 VC,希望它能找到丢失的 header。

Can someone please help?有人可以帮忙吗? Shouldn't vcpkg packages be in "path" when running nmake automatically?自动运行 nmake 时,vcpkg 包不应该在“路径”中吗? Am I missing completely different dependency?我错过了完全不同的依赖吗?

nmake won't magically see vcpkg installations. nmake 不会神奇地看到 vcpkg 安装。 You need to either setup the environment variables ( LIB/LIBPATH/PATH/INCLUDE/CL/LINK etc) for it or provide the paths to vcpkg in some other way.您需要为其设置环境变量( LIB/LIBPATH/PATH/INCLUDE/CL/LINK等)或以其他方式提供 vcpkg 的路径。

That being said libxml++ is a available port in vcpkg -> see libxmlpp也就是说 libxml++ 是 vcpkg 中的可用端口 -> 请参阅 libxmlpp

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

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