windows - 在 Windows 10 上使用 OMNETPP shell 将 libxml 与 MinGW 链接
问题描述
使用 omnetpp shell 时,如何在 MinGW 上链接 libxml?
我在 Windows 10 机器上使用 omnetpp。
当我尝试从这里安装第 3 方包时发生了
我的
问题错误(I/mingw64/include/libxml2
对于undefined reference to 'xmlFunctionName'
许多函数名称)
我试图隔离问题并从 libxml2 编译代码示例
遵循编译指南:
使用gcc `xml2-config --cflags --libs` -o tree2 tree2.c
I got a fatal error: 'libxml/parser.h' file not found
When I replace xml2-config --cflags --libs
with -I/mingw64/include/libxml2
I got the same error as beforeundefined reference to 'xmlFunctionName'
我能做些什么来解决这个问题?
解决方案
针对这个特定问题:libxml2 实际上已经存在,因为 OMNET 5.x 也使用它。目录中提供了所有依赖项和工具tools/win64/mingw64
。问题是(出于未知原因)文件include/libxml2/libxml
夹的包含文件。配置脚本正确检测到这一点,并使其在Makefile.inc
asXML_CFLAGS= = -I/mingw64/include/libxml2
这必须添加到要使用 XML 解析器的每个文件的编译器标志中。(库文件在/mingw64/lib
文件夹中)因此可以检测到这些文件,无需额外配置即可使用。
通常,第三方库应该在/mingw64/include
和/mingw64/lib
文件夹中可用。您可以在那里手动复制它们或尝试使用 mingw 包管理器安装它(但是这很可能会破坏您的 omnet 安装,因为 mingw64 不是特别一致并且它是一个滚动版本 - 即强烈不推荐这样做)。
推荐阅读
- r - 如何从 url 读取 IMF xls- 或 sdmx-data?
- javascript - 滚动锁定在移动设备上
- python - 取决于 Pandas Dataframe 列的值数组
- angular - 无法绑定到“dividerColor”,因为它不是“mat-form-field”的已知属性
- c++ - 在 unordered_map 的键上实现“你的意思是”
- reactjs - Ant-Design React-Native 搜索栏取消按钮在按下时无法隐藏
- node.js - 如何解决“TypeError: Cannot read property 'recordset' of undefined”的问题?
- python - 如何使用 jupyter notebook 在桌面上读取文件?
- php - PHP Imagick ReadImage WriteImage 质量不同
- javascript - 在 vuejs 中过滤 const 数据