freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] [Doubt] Error with STREAM_FILE function.


From: Werner LEMBERG
Subject: Re: [ft-devel] [Doubt] Error with STREAM_FILE function.
Date: Wed, 13 Jun 2018 09:02:36 +0200 (CEST)

> Actually I want to extract the file pointer from the input stream.
> For this I initially used (FILE*)stream->descriptor.pointer to get
> the pointer but it did not allocate the pointer and gave a
> segmentation fault with fseek.

Don't use FreeType internals outside of the library.  Look into the
FreeType demo file `src/ftcommon.c' for an example of file handling.

> I then did an explicit fopen on the filename later and my code ran
> properly.

This sounds like the right solution.

> Now the problem is that I cannot extract file pointer from the
> stream.

Why do you need it?  What problem do you want to solve?

> Also, if STREAM_FILE is already defined to be used to ease the
> process, then why is it showing undefined symbol?

Again: It is a macro, only *locally* defined (in `ftsystem.c').  If
you use it in another file, the compiler treats it as an undefined
symbol.


    Werner



reply via email to

[Prev in Thread] Current Thread [Next in Thread]