Built .NET 2005 VC++ RRD program not working - crashes

View: New views
6 Messages — Rating Filter:   Alert me  

Built .NET 2005 VC++ RRD program not working - crashes

by Mark Easton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I built \rrdtool-1.2.19 to produce rrd.lib.

In my new project I linked in libpng.lib, zlib.lib, art_lgpl_2.lib, freetype.lib, and rrd.lib.

Here is my very basic code:

// gopher_test.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "rrd.h"


int _tmain(int argc, _TCHAR* argv[])
{
       

  char *opts[] = { "net.rrd", "–step", "300", "–start", 0,
           "DS:input:COUNTER:600:U:U",
           "DS:output:COUNTER:600:U:U",
           "RRA:AVERAGE:0.5:1:600",
           "RRA:AVERAGE:0.5:6:700",
           "RRA:AVERAGE:0.5:24:775",
           "RRA:AVERAGE:0.5:288:797",
           "RRA:MAX:0.5:1:600",
           "RRA:MAX:0.5:6:700",
           "RRA:MAX:0.5:24:775",
           "RRA:MAX:0.5:288:797"
        };

  int ret = rrd_create(14, opts );

  if( ret == 0 )
  {
    printf("RRD error creating net.rrd: %s\n", rrd_get_error());
  }

}


It results in:

1>------ Rebuild All started: Project: gopher_test, Configuration: Debug Win32 ------
1>Deleting intermediate and output files for project 'gopher_test', configuration 'Debug|Win32'
1>Compiling...
1>stdafx.cpp
1>Compiling...
1>gopher_test.cpp
1>Compiling manifest to resources...
1>Linking...
1>LINK : E:\Projects\gopher_test\Debug\gopher_test.exe not found or not built by the last incremental link; performing full link
1>Embedding manifest...
1>Build log was saved at "file://e:\Projects\gopher_test\gopher_test\Debug\BuildLog.htm"
1>gopher_test - 0 error(s), 0 warning(s)
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========


But when I run gopher_test.exe it just craps out.

Any ideas,
Mark


Re: Built .NET 2005 VC++ RRD program not working - crashes

by Mark Easton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

More detail - I am getting a R6034 error - and found this:

"Visual C++ libraries cannot be used by a C/C++ application without a manifest binding the application to these libraries. If a C/C++ application that depends on a Visual C++ library does not use a manifest, then an attempt to load the Visual C++ library as a dependent DLL from the application-local folder will result in an error message indicating that this is an unsupported way of loading a Visual C++ library."



Mark Easton wrote:
I built \rrdtool-1.2.19 to produce rrd.lib.

In my new project I linked in libpng.lib, zlib.lib, art_lgpl_2.lib, freetype.lib, and rrd.lib.

Here is my very basic code:

// gopher_test.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "rrd.h"


int _tmain(int argc, _TCHAR* argv[])
{
       

  char *opts[] = { "net.rrd", "–step", "300", "–start", 0,
           "DS:input:COUNTER:600:U:U",
           "DS:output:COUNTER:600:U:U",
           "RRA:AVERAGE:0.5:1:600",
           "RRA:AVERAGE:0.5:6:700",
           "RRA:AVERAGE:0.5:24:775",
           "RRA:AVERAGE:0.5:288:797",
           "RRA:MAX:0.5:1:600",
           "RRA:MAX:0.5:6:700",
           "RRA:MAX:0.5:24:775",
           "RRA:MAX:0.5:288:797"
        };

  int ret = rrd_create(14, opts );

  if( ret == 0 )
  {
    printf("RRD error creating net.rrd: %s\n", rrd_get_error());
  }

}


It results in:

1>------ Rebuild All started: Project: gopher_test, Configuration: Debug Win32 ------
1>Deleting intermediate and output files for project 'gopher_test', configuration 'Debug|Win32'
1>Compiling...
1>stdafx.cpp
1>Compiling...
1>gopher_test.cpp
1>Compiling manifest to resources...
1>Linking...
1>LINK : E:\Projects\gopher_test\Debug\gopher_test.exe not found or not built by the last incremental link; performing full link
1>Embedding manifest...
1>Build log was saved at "file://e:\Projects\gopher_test\gopher_test\Debug\BuildLog.htm"
1>gopher_test - 0 error(s), 0 warning(s)
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========


But when I run gopher_test.exe it just craps out.

Any ideas,
Mark

Re: Built .NET 2005 VC++ RRD program not working - crashes

by Mark Easton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

For what it is worth - I have it all working now.

Re: Built .NET 2005 VC++ RRD program not working - crashes

by Travis Spencer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 2/8/07, Mark Easton <mark.easton@...> wrote:
>
> For what it is worth - I have it all working now.

What was the fix?

--

Regards,

Travis Spencer

_______________________________________________
rrd-users mailing list
rrd-users@...
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users

Re: Built .NET 2005 VC++ RRD program not working - crashes

by Mark Easton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I dont know. I already was able to build rrd.lib and rrdtool.exe, so I just added my files in to the project and took advantage of whatever build settings were alrready there. Not a scientific approach but an effective one. Happy to share my complete solution if anyone wants it.

Basically it is a vs.net 2005 c++ build of rrd, rrdwrap and some test code. Also I have the various GnuWin32 libs that need to be linked in.


Travis Spencer wrote:
On 2/8/07, Mark Easton <mark.easton@azurebell.co.nz> wrote:
>
> For what it is worth - I have it all working now.

What was the fix?

--

Regards,

Travis Spencer

_______________________________________________
rrd-users mailing list
rrd-users@lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users

Re: Built .NET 2005 VC++ RRD program not working - crashes

by Mark Easton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes my build works partially. The only things I need to fix and am doing at the moment is that some of the wrapper c code which I used from the rrdtool website is outdated and so the parameter counts of some methods have changed, but the main methods work.

You can download my VS.NET 2005 solution (..\rrdtool-1.2.19\win32\rrdtool.sln) which builds and saves the exe to ..\rrdtool-1.2.19\win32\tooldebug. Download from :

www.agile4.co.nz/downloads/rrdtool-1.2.19.rar, and
www.agile4.co.nz/downloads/GnuWin32.rar (... to get the gnuwin32.rar files included in the build. This is installed on my machine in C:\Program Files\GnuWin32.)

Good luck,
Mark