Menu

#212 Assertion when trying to use libgerbv

v1.0 (example)
open
nobody
None
5
2016-08-29
2016-08-29
No

Hi everybody,

I'm trying to use gerbv as a library, just to "parse" some gerber files (using libgerbv actually).
I'm working under Windows, with Visual Studio 2013.

So, I cross-compiled gerbv under a Fedora Virtual Box using this tuto : http://chitlesh.ch/wordpress/blog/2009/06/14/using-fedoras-windows-cross-compilers-2/

An so, it worked and I added the libgerv-1.dll and libgerbv.a to my Visual project, and also the other dependencies (gtk, cairo...). Then it compiled well.

To test it, I added the code contained in the "exemple1.c" provided file, in my "main".
The call of gerbv_create_project is OK, but the call of gerbv_open_layer_from_filename is not, and I get an assert that I can't understand and resolve, that's why I'm asking to you.

The error is :
Debug Assertion Failed!
Program: ... .exe
File : ... fstat.c
Line: 90
Expression: (_osfile(fildes) a FOPEN)

It seems to come from the call of gerb_fopen (in gerb_file.c), when it calls the fstat function (in the WIN32 part). A trace-debugging shows that the first parameter of fstat (fd->fileno) is equal to 3.

Notice that it's the first thing I do in my program so it can't be a memory leak problem.

Thanks you in advance because I'm really lost and google doesn't help me..,
By the way, congratulation for your software that seems great.

Alexis.

Discussion


Log in to post a comment.