[rrd-developers] API C (Win32) with DevC++

gabriel_takashi gabriel_takashi at hotmail.com
Fri Aug 7 03:28:28 CEST 2009


Hi,
I´m from Brazil. I´m studying about RRDTools API C with win32 (DevC++).

So,
1º) I got
http://www.cacti.net/downloads/rrdtool/win32/rrdtool-1.2.15-cygwin-1.5.20.zip
2º) I extracted it in C:\RRDTool
3º) I got all this files:

config.h
dummy.c
gdlucidab10.c
gdlucidab10.h
gdlucidab12.c
gdlucidab12.h
gdlucidab12l2.c
gdlucidab12l2.h
gdlucidab14.c
gdlucidab14.h
gdlucidan10.c
gdlucidan10.h
gdlucidan10l2.c
gdlucidan10l2.h
gdlucidan12.c
gdlucidan12.h
gdlucidan14.c
gdlucidan14.h
gdpng.c
gifsize.c
ntconfig.h
parsetime.c
parsetime.h
pngsize.c
rrd.h
rrd_create.c
rrd_diff.c
rrd_error.c
rrd_fetch.c
rrd_format.c
rrd_format.h
rrd_graph.c
rrd_graph.h
rrd_last.c
rrd_open.c
rrd_tool.h
rrd_update.c
gd-latest-win32.zip (headers)



4º) I started my code on C:\RRDTool\main.c

//=========main.c================

#include <stdio.h>
#include <stdlib.h>

#include "rrd.h"

#include "rrd_create.c"
#include "rrd_diff.c"
#include "rrd_error.c"
#include "rrd_fetch.c"
#include "rrd_format.c"
#include "rrd_last.c"
#include "rrd_open.c"
#include "rrd_update.c"
#include "parsetime.c"

int main(int argc, char *argv[])
{

  char *rrd_argv[7];
  int rrd_argc=6;
  
  rrd_argv[0]="create";
  rrd_argv[1]="C:\\RRDTool\\target.rrd";
  rrd_argv[2]="--start 1023654125";
  rrd_argv[3]="--step 300";
  rrd_argv[4]="DS:mem:GAUGE:600:0:671744";
  rrd_argv[5]="RRA:AVERAGE:0.5:12:24";
  rrd_argv[6]="RRA:AVERAGE:0.5:288:31";

  int rrd_ret=rrd_create(rrd_argc, rrd_argv);
  
  printf("Resultado: %d\n",rrd_ret);
  system("PAUSE");	
  return 0;
}

//=========main.c================

5º) It compile, but don´t create the file C:\RRDTool\target.rrd
    When I execute this program:

http://www.nabble.com/file/p24847392/imgrun.png 

Why this???????
==>> My program (test.exe) is in the same place (C:\RRDTool) as rrdtool.exe
(C:\RRDTool\rrdtool.exe)
==>> I don´t know where it (my program test.exe) will find rrdtool.exe,
because I didn´t install RRDTool, I only unzip this to a folder. So there
isn´t any PATH with RRDTools place...
-- 
View this message in context: http://www.nabble.com/API-C-%28Win32%29-with-DevC%2B%2B-tp24847392p24847392.html
Sent from the RRDTool - Dev mailing list archive at Nabble.com.



More information about the rrd-developers mailing list