Using GFL SDK with Borland C++ Builder

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: XnTriq, xnview

Post Reply
lechoo
Posts: 5
Joined: Tue Feb 22, 2005 2:20 pm
Contact:

Using GFL SDK with Borland C++ Builder

Post by lechoo » Tue Feb 22, 2005 2:34 pm

Hi,
in want to use GFL SDK with Borland C++ Builder 6 however I have a problem. When I compile my project I get these linker errors:

[Linker Error] Unresolved external 'GFLW_FILE_INFORMATION::~GFLW_FILE_INFORMATION()' referenced from C:\TEMP\GFL\UNIT1.OBJ
[Linker Error] Unresolved external 'GFLW_FILE_INFORMATION::GFLW_FILE_INFORMATION()' referenced from C:\TEMP\GFL\UNIT1.OBJ

I have read this post: http://newsgroup.xnview.com/viewtopic.php?t=967 and performed all actions described there and still no luck. Maybe I'm not doing this right.

All I have in my code (that is GFL related) is:
GFLW_FILE_INFORMATION info;
When this is commented everything compiles and works.

Can someone help me with this or point me to some solution?
Thanks.

User avatar
xnview
Author of XnView
Posts: 33666
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Using GFL SDK with Borland C++ Builder

Post by xnview » Tue Feb 22, 2005 3:25 pm

lechoo wrote:Hi,
in want to use GFL SDK with Borland C++ Builder 6 however I have a problem. When I compile my project I get these linker errors:

[Linker Error] Unresolved external 'GFLW_FILE_INFORMATION::~GFLW_FILE_INFORMATION()' referenced from C:\TEMP\GFL\UNIT1.OBJ
[Linker Error] Unresolved external 'GFLW_FILE_INFORMATION::GFLW_FILE_INFORMATION()' referenced from C:\TEMP\GFL\UNIT1.OBJ

I have read this post: http://newsgroup.xnview.com/viewtopic.php?t=967 and performed all actions described there and still no luck. Maybe I'm not doing this right.

All I have in my code (that is GFL related) is:
GFLW_FILE_INFORMATION info;
When this is commented everything compiles and works.

Can someone help me with this or point me to some solution?
Thanks.
Do you include the C++ wrapper?
Pierre.

User avatar
MaierMan
Posts: 78
Joined: Wed Aug 04, 2004 8:32 pm
Contact:

Post by MaierMan » Tue Feb 22, 2005 7:20 pm

When using the c++ wrapper (in gflsdk\c++) you'll need to add the corresponding .cpp files as well, eg. using "Project > Add to Project"

The reason is:
The wrapper code itself is not precompiled and linked into the library (dll).
Thus the linker throws those error since the code you're using is simply not there ;)

(code linked into the dll properly wouldn't anyway since visualc++ and BCB (just to name the common Win32 compilers) mangle class names in a different style).

lechoo
Posts: 5
Joined: Tue Feb 22, 2005 2:20 pm
Contact:

Post by lechoo » Tue Feb 22, 2005 9:01 pm

Thanks guys, that was the problem. Including .cpp files from gflsdk\c++ helped.
However now I have another problem. I have completly new project with this code executed with button pressed:

Code: Select all

GFLW_LIBRARY::Initialise();
AnsiString ver = gflGetVersion();

if (OpenDialog1->Execute())
        {
        GFLW_FILE_INFORMATION info;
        info.GetFromFile(OpenDialog1->FileName.c_str(),-1);
        }
GFLW_LIBRARY::Exit();
It gives me access violation "Read of address FFFFFFFF" on GetFromFile line. Initialisation is OK, it returns 0. gflGetVersion returns correct version (2.20).

I have created libraries with implib using parameters -a -c (b_libgfl220.lib and b_libgfle220.lib) and added them to project.
I also have included gflw.h and added gflsdk\c++ and gflsdk\include to include paths. gflsdk\lib is added to library path.

Any idea what's wrong this time?
thanks in advance

User avatar
MaierMan
Posts: 78
Joined: Wed Aug 04, 2004 8:32 pm
Contact:

Post by MaierMan » Tue Feb 22, 2005 9:50 pm

D'OH

I almost forgot what I did.
(What reminds me that I wanted to talk to Pierre about that)

I got my own libs with -c switch.
But I also modified the headers in order to get them working perfectly with Borland CBuilder who seem to ignore some defines.
(In this case WIN32 define)....
Furthermore Borland "adjusted" Win PSDK for use with Compiler.
And they did a really bad job here IMO ROFL
I usually stumble over a lot of error when I directly program API without using the Delphi-implemented VCL wrappers.

Just in the case you're interested in "my versions":
Here is a download http://celebnamer.celebworld.ws/xnview/ ... orland.rar

Using them usually works fine.

lechoo
Posts: 5
Joined: Tue Feb 22, 2005 2:20 pm
Contact:

Post by lechoo » Wed Feb 23, 2005 10:48 pm

Switching your libs with mine solved the problem. Later I tried again to use implib but this time only with -c option and looks like this is the solution because this also worked fine.

Many, many thanks for your help.

I didn't do much testing yet but i think i have found possible bug. When I read resolution of CRW from my Canon EOS 300D i get 2048x1360 when this image is 3088x2056.

User avatar
MaierMan
Posts: 78
Joined: Wed Aug 04, 2004 8:32 pm
Contact:

Post by MaierMan » Thu Feb 24, 2005 9:30 am

lechoo wrote:...
I didn't do much testing yet but i think i have found possible bug. When I read resolution of CRW from my Canon EOS 300D i get 2048x1360 when this image is 3088x2056.
Then I would recommend you test a little deeper and report the bug (if you find it is indeed one) in another thread outlining the problem so that Pierre may look into it ;)

Post Reply