I have a module for plotting curves (plot.bas) and a demo program (plotfunc.bas). The module uses only calls to GfxLib.
If I compile with "fbc plotfunc.bas plot.bas" I obtain the executable (plotfunc.exe) and it runs very well.
If I try to convert the module to a library with "fbc plot.bas -lib" I obtain the library file (libplot.a) without any error.
But when I try to link this library with my demo program with "fbc plotfunc.bas -l plot" I get a whole list of "undefined reference to fb_Gfx..." in libplot.a
Adding #inclib "fbgfx" in plot.bas or plotfunc.bas does not help.
What can I do?
How to build a library on top of GfxLib?
Add this to your local copy of inc/fbgfx.bi:
#include it and you're done, from both Win32 and Linux.
Code: Select all
#inclib "fbgfx"
#ifdef __FB_WIN32__
#inclib "user32"
#inclib "gdi32"
#inclib "winmm"
#elseif defined(__FB_LINUX__)
#libpath "/usr/X11R6/lib"
#inclib "X11"
#inclib "Xext"
#inclib "Xpm"
#inclib "Xrandr"
#inclib "Xrender"
#inclib "pthread"
#endif
Antoni: the change is already in CVS :)
About JPG, I'd suggest you have a look at my JPGalleg codec; it supports almost any JPG you throw at it, including progressive ones. From my experience, if you code a JPG loader, progressive support is a must.
Anyway, I may decide to port JPGalleg to FB one day...
About JPG, I'd suggest you have a look at my JPGalleg codec; it supports almost any JPG you throw at it, including progressive ones. From my experience, if you code a JPG loader, progressive support is a must.
Anyway, I may decide to port JPGalleg to FB one day...
I have the source of JpgAlleg, i will look at it for lib organisation progressive support.
I'm patching the old code I started in QB back in 1999 (i I started then optimizing Dmitry Brant's viewer), but it requires a lot of adaptation to FB features to be useful.
According to the profiler it spends a 75% of its time doing Huffman decoding, bit manipulation is slow...and it spends in IDCT (LLM fixed point) only an 1% of the time, so perhaps I will revert it to floating point for more accuracy..
I'm at 2 seconds to load a 10Mpixel image in a P4 1,4. Don't believe I can go below this...
I'm patching the old code I started in QB back in 1999 (i I started then optimizing Dmitry Brant's viewer), but it requires a lot of adaptation to FB features to be useful.
According to the profiler it spends a 75% of its time doing Huffman decoding, bit manipulation is slow...and it spends in IDCT (LLM fixed point) only an 1% of the time, so perhaps I will revert it to floating point for more accuracy..
I'm at 2 seconds to load a 10Mpixel image in a P4 1,4. Don't believe I can go below this...