gpt4 book ai didi

c++ - 无法编译 rrd

转载 作者:行者123 更新时间:2023-11-28 07:34:50 24 4
gpt4 key购买 nike

我在使用 Visual Studio 2008 编译 rrdtool 时遇到问题。

我已经添加和提取了所有 zip 文件。

我打开 rrd.sln 并尝试为 3 个项目中的每一个构建解决方案; rrdlib、rrdtool 和 rrdupdate,但我在所有这些方面都失败了。

我使用的是 Windows 2003 R2,但遇到如下严重故障:..\src\rrd_restore.c(235): fatal error C1189:#error:“不知道如何处理 TIME_T,而不是 4 或 8 个字节”rrd_resize.c

..\src\rrd_create.c(15): fatal error C1083:无法打开包含文件:'../rrd_config.h':没有这样的文件或目录pngsize.c

这些是我遵循的安装说明:以下是构建 rrdlib.lib 和 rrdtool.exe 的分步说明Microsoft Visual Studio 2008 (9.0.x) 1.3.5 及更新版本。

(1) 在这个文本文件所在的目录下创建一个名为“contrib”的文件夹。

(2)将rrdtool依赖的以下库下载到该文件夹​​中:

- cairo:    http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/cairo_1.8.10-3_win32.zip 
and http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/cairo-dev_1.8.10-3_win32.zip

- glib: http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.24/glib_2.24.1-1_win32.zip
and http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.24/glib-dev_2.24.1-1_win32.zip

- libpng: http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/libpng_1.4.0-1_win32.zip
and http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/libpng-dev_1.4.0-1_win32.zip

- libxml2: http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/libxml2_2.7.7-1_win32.zip
and http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/libxml2-dev_2.7.7-1_win32.zip

- pango: http://ftp.gnome.org/pub/gnome/binaries/win32/pango/1.28/pango_1.28.0-1_win32.zip
and http://ftp.gnome.org/pub/gnome/binaries/win32/pango/1.28/pango-dev_1.28.0-1_win32.zip

- zlib: http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/zlib_1.2.4-2_win32.zip
and http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/zlib-dev_1.2.4-2_win32.zip

- fontconfig: http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/fontconfig_2.8.0-2_win32.zip

- freetype: http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/freetype_2.3.12-1_win32.zip

- expat: http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/expat_2.0.1-1_win32.zip

(3) 将所有 .zip 文件解压缩到 contrib 文件夹中。不要将每个库提取到它自己的库中 目录。我们希望将所有文件合并到一个由“bin、include、lib...”组成的结构中 等文件夹。

(4)打开win32文件夹下的Visual Studio 2008 Solution“rrd.sln” 您的 rrdtool-folder 并构建项目 rrdlib(对于 rrdtool-library)、rrdtool(用于 rrdtool-executable,具体取决于 库)或完整的解决方案。构建后事件自动复制 rrdtool 所需的所有 dll,在 .exe 旁边,当您构建 可执行。这些 DLL 必须在 rrdtool 将要运行的所有主机上可用 跑。

有什么建议吗?

最佳答案

这是因为Win32构建缺少rrd_config.h文件。在 Linux 中,该文件可以通过配置过程创建。我通过手动修改源代码摆脱了这个问题。只需替换 rrd_restore.c 中的代码块:

#if SIZEOF_TIME_T == 4
temp = strtol((char *)text,NULL, 0);
#elif SIZEOF_TIME_T == 8
temp = strtoll((char *)text,NULL, 0);
#else
#error "Don't know how to deal with TIME_T other than 4 or 8 bytes"
#endif

与:

temp = strtoll((char *)text,NULL, 0);

并删除rrd_create.c中的include语句:

#include "../rrd_config.h"

然后构建过程可以没有错误地完成。

另一种选择,将 url 浏览为 follow .

关于c++ - 无法编译 rrd,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16962257/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com