Page 1 of 1

TeeSaveToPNG linker error in CodeGear2007

Posted: Thu Apr 02, 2009 12:02 pm
by 9244446
I tried to use the function TeeSaveToPng.
In BCB6 it works fine, but when I made a new project in CodeGear2007, with the same file I used in BCB6, the linker tells me he has an unresolved external on __fastcall TeePng::TeeSaveToPng.

And when I add the line #pragma link "TeePNG", the linker cannot find TeePng.obj. I am not sure I need this line.

I've included the file "TeePng.hpp" and all my packages are ok. Which file do I have to link to get this work ?

I am working with TeeChart 7.12.

Thanks in advance

Posted: Fri Apr 03, 2009 10:09 am
by narcis
Hi de_ouwej,

This works fine for me here using v7.12 in RAD Studio 2007. Most likely you need to set properly package search paths:

1. Run C++ Builder 2007.
2. Go to Tools -> Options -> Environment Options -> Environment Variables -> User Overrides and check that TEEINCPATH and TEELIBPATH are set to v7.12 Include and Lib folder respectively.
3. Go to Project -> Default Options -> C++ Builder -> Paths and Defines and check that Include path list has $(TEEINCPATH); on *top* of the list and that Library path list has $(TEELIBPATH) and $(TEELIBPATH)\obj on *top* of the list too.

Doing so should find necessary packages.

BTW: I didn't need to add pragma link, adding the include clause in the *.h file was enough for me.

Posted: Fri Apr 03, 2009 10:42 am
by 9244446
Hello Narcis,

Well first I thought: that's my answer! But unfortunately it isn't.
I did add both variables in my paths and defines, BTW there is no LibPath in C++ Builer->Paths and Defines, so I added them in my Project->Paths and Defines, and the linker still came with the same error.

It looks like he can't find the implementation of: extern PACKAGE void __fastcall TeeSaveToPNG(Teeprocs::TCustomTeePanel* APanel, const WideString AFileName, int AWidth = 0x0, int AHeight = 0x0), because that's the linker error in CodeGear.

Do You have any other options ?

Thanks.

Posted: Fri Apr 03, 2009 11:06 am
by narcis
Hi de_ouwej,

I have RAD Studio 2007 Architech here installed version being 11.0.2902.10471 and the C++ Builder version is 11.0.2987.10779.

That's how C++ Builder Options dialog looks like:

Image

Which is the version are you using? Are you looking at the very same dialog as in the image above?

Thanks in advance.

Posted: Mon Apr 06, 2009 6:07 am
by 9244446
Hello Narcís,

Yes I have got almost the same version of RAD Studio 2007 as you have. But here with me it is: CodeGear™ C++Builder® Version 11.0.2709.7128.
The options display is exactly the same.

The line where the linker is given his error is linenr 121 in the file TeePng.hpp in the map $(TEEINCPATH)

So probably he can't find the compiled code of that external function.

It's my hope that you can help me further.

Thank you.

[/img]

Posted: Mon Apr 06, 2009 8:35 am
by narcis
Hi de_ouwej,

Have you checked that TEEINCPATH points to TeeChart's Include folder as I described in earlier posts?

Thanks in advance.

Posted: Mon Apr 06, 2009 10:05 am
by 9244446
Hello Narcís,

Yes I checked that path. It's the path to the file TeePng.hpp and that is the file I am including and it's also the file from where the linkerror is.
I also checked the TEELIBPATH. Is it possible that I missed a file or something ?

Thanks for your reply

Posted: Thu Apr 09, 2009 10:57 am
by narcis
Hi de_ouwej,

This seems to indicate your C++ Builder is still referencing old TeeChart packages or new TeeChart packages paths are set up incorrectly.

I recommend creating a new application, checking paths again and try building it again. If you are building your old project you could choose "rebuild" option so that it is build with new settings.

You could also try copying new TeeChart packages to project's folder to make sure they are being used.

Hope this helps!

Solution to this problem !!

Posted: Tue Apr 14, 2009 10:27 am
by 9244446
Hello Narcís,

Well at last it's done. Not by making a new project file, but by testing with an compleet new program and only an TChart on a form.
Then I look for the differences and what was the solution eventualy??
Moving the line with #include <TeePNG.hpp> who was standing above #pragma hdrstp, to a line under #pragma hdrstp and replacing the <> with "".
Well it's an compleet ridle for me, but it works !

Thank you for all your replies and thinking.
Bye