daithi_dearg
daithi_dearg

Reputation: 57

Failing to compile rrd

I'm having problems compiling the rrdtool with Visual Studio 2008.

I have all the zip files added and extracted.

I opened rrd.sln and tried a build solution for each of the 3 projects; rrdlib, rrdtool and rrdupdate but I'm getting failures on all of these.

I'm using Windows 2003 R2 and I get critical failures as below: ..\src\rrd_restore.c(235) : fatal error C1189: #error : "Don't know how to deal with TIME_T other than 4 or 8 bytes" rrd_resize.c

..\src\rrd_create.c(15) : fatal error C1083: Cannot open include file: '../rrd_config.h': No such file or directory pngsize.c

These are the install instructions I am following: Here are step by step instructions for building rrdlib.lib and rrdtool.exe version 1.3.5 and newer with Microsoft Visual Studio 2008 (9.0.x).

(1) Create a folder named "contrib" in the directory where this text file is located.

(2) Download the following libraries that rrdtool depends on into this folder:

- 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) Extract all of the .zip files into the contrib folder. Do not extract each library into it's own directory. We want all of the files merged into a structure consisting of "bin, include, lib..." etc folders.

(4) Open the Visual Studio 2008 Solution "rrd.sln" in the win32 folder of your rrdtool-folder and build either the project rrdlib (for the rrdtool-library), rrdtool (for the rrdtool-executable depending on the libraray) or the complete solution. A post-build event automatically copies all the dlls, needed by rrdtool, next to the .exe, when you build the executable. These DLLs must be available on all hosts where rrdtool will run.

Any suggestions?

Upvotes: 0

Views: 1462

Answers (1)

Charlie
Charlie

Reputation: 11

There's because the rrd_config.h file is lack for Win32 building. In Linux, that file can be created by configure process. I get rid of this problem by manually modifying the source code. Just replace the block of code in 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

with:

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

and delete the include statement in rrd_create.c:

#include "../rrd_config.h"

Then the building proccess can be completed with no error.

Another choise, browse the url as follow.

Upvotes: 1

Related Questions