Page 1 of 1

Unresolved external with Teetools::TTextShape::DrawTextW

Posted: Tue Aug 28, 2012 3:21 pm
by 16562168
Hi,

I have TeeChart Pro v2012.05.120327 32bit VCL and BCB XE 2 running on Windows 7.

I created the following class:

// .h file

Code: Select all

class TMyRectangleTool : public TRectangleTool
{
protected:
	
public:

	__fastcall TMyRectangleTool(TComponent * Owner);
};
// .cpp file

Code: Select all

//---------------------------------------------------------------------------
__fastcall TMyRectangleTool::TMyRectangleTool(TComponent * Owner)
	: TRectangleTool(Owner)
{

}
There's no issue when compiled, but I'm getting the following link error. I was getting the same link error when using Windows XP as well.
[ILINK32 Error] Error: Unresolved external '__fastcall Vcltee::Teetools::TTextShape::DrawTextW(Vcltee::Teengine::TCustomAxisPanel *, System::Types::TRect&, int, int, int)' referenced from C:\MY PROJECTS BCB XE2\MY CPP\CHART TOOLS\WIN32\DEBUG\UNIT1.OBJ
Where does DrawTextW come from? How do I go around this link error?

Thanks

-Bill

Re: Unresolved external with Teetools::TTextShape::DrawTextW

Posted: Wed Aug 29, 2012 2:12 pm
by yeray
Hi Bill,

I've just tried it with the actual version (v2012.06) in a Win7 x64 machine and the attached application seems to compile and run without problems for me here with RAD XE. Could you please give it a try?
testRectangle.zip
(85.74 KiB) Downloaded 1008 times

Re: Unresolved external with Teetools::TTextShape::DrawTextW

Posted: Wed Aug 29, 2012 2:24 pm
by yeray
Hi Bill,

Just tried it with XE2 in the same machine and the attached project seems to build an run without problems either.
Maybe you forgot to add the "#include <VclTee.TeeTools.hpp>" in the .h?
testRectangleXE2.zip
(4.76 KiB) Downloaded 1069 times

Re: Unresolved external with Teetools::TTextShape::DrawTextW

Posted: Wed Aug 29, 2012 3:03 pm
by 16562168
Yes, it will link with no issues if it is not called. Add the line as shown below and the link error will show up.

Code: Select all

__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
	new TMyRectangleTool(this);
}

Re: Unresolved external with Teetools::TTextShape::DrawTextW

Posted: Thu Aug 30, 2012 9:06 am
by yeray
Hi Bill,

Right. But making it virtual solves the problem for me here.

Code: Select all

class TMyRectangleTool : public TRectangleTool
{
protected:
public:
	__fastcall virtual TMyRectangleTool(TComponent * Owner);
};

Re: Unresolved external with Teetools::TTextShape::DrawTextW

Posted: Thu Aug 30, 2012 12:31 pm
by 16562168
Hi,

For some reason make it virtual did not solve the link issue over here. I tried the file you sent over.

// .h file

Code: Select all

class TMyRectangleTool : public TRectangleTool
{
protected:
public:
	__fastcall virtual TMyRectangleTool(TComponent * Owner);
};
// .cpp file

Code: Select all

//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
	new TMyRectangleTool(this);
}
I'm still getting the same link error msg.
[ILINK32 Error] Error: Unresolved external '__fastcall Vcltee::Teetools::TAnnotationTool::DrawTextW()' referenced from C:\MY PROJECTS BCB XE2\MY CPP\TESTRECTANGLE\DEBUG\WIN32\UNIT1.OBJ
In your earlier post, you said that you are using TChart v2012.06, is that a newer version?

Re: Unresolved external with Teetools::TTextShape::DrawTextW

Posted: Thu Aug 30, 2012 1:56 pm
by yeray
Hi Bill,
Bill wrote:In your earlier post, you said that you are using TChart v2012.06, is that a newer version?
Yes. v2012.05 dates from March 2012, while v2012.06 dates from June. Give it a try if possible.

Re: Unresolved external with Teetools::TTextShape::DrawTextW

Posted: Thu Aug 30, 2012 2:46 pm
by 16562168
I've just installed the latest version of TeeChart and I still get the same link error. Would you please send me your project that compiles and links again?

Thanks

Re: Unresolved external with Teetools::TTextShape::DrawTextW

Posted: Mon Sep 03, 2012 1:15 pm
by yeray
Hi Bill,

I'm getting confused because what I suggested you before (virtual) doesn't seem to work now in the same machine where worked before :?
We are studying it and we'll be back to you as soon as possible.

Re: Unresolved external with Teetools::TTextShape::DrawTextW

Posted: Thu Nov 15, 2012 2:48 pm
by 16562168
This issue still not resolved in the latest version: TeeChart Pro v2012.07.121105 32 bit VCL !

Re: Unresolved external with Teetools::TTextShape::DrawTextW

Posted: Fri Nov 16, 2012 9:47 am
by yeray
Hi Bill,

This seems to come from a bug in C++ XE, XE2 and probably XE3 too:
http://stackoverflow.com/questions/6205 ... link-error

We're investigating if we can find a workaround.

Re: Unresolved external with Teetools::TTextShape::DrawTextW

Posted: Fri Oct 10, 2014 11:33 am
by 9335230
Hi,

I need to reopen this thread because the problem is still alive. I've been working the last few days importing from C++ Builder 2007 to Builder XE7. After struggling a lot of compile and link problems, I'm halted on this one. Here's again:
[ilink32 Error] Error: Unresolved external '__fastcall Vcltee::Teetools::TAnnotationTool::DrawTextW()' referenced from D:\......\TESTRECTANGLEXE2\WIN32\DEBUG\UNIT1.OBJ
I've downloaded the testRectangleXE2.zip and create an instance of the class derived from TAnnotationTool but it still happens. I believe it is an TeeChart issue.

Any solution or workaround???

I'm working with Builder XE 7 and TeeChart v2014 32-bit VCL (both trials).
I'm afraid I'm standing on Builder 2007 and TeeChart 7 if I can't use my own TeeTools .

Re: Unresolved external with Teetools::TTextShape::DrawTextW

Posted: Fri Oct 10, 2014 3:37 pm
by yeray
Hello,

Found another answer at StackOverflow that seems to workaround this.
If I open VCLTee.TeeTools.hpp I go to the definition of DrawText for the TAnnotationTool:

Code: Select all

class PASCALIMPLEMENTATION TAnnotationTool : public Vcltee::Teengine::TTeeCustomTool
//...
    void __fastcall DrawText(Vcltee::Teengine::TCustomAxisPanel* const AParent)/* overload */;
And I undefine DrawText before it, having this:

Code: Select all

class PASCALIMPLEMENTATION TAnnotationTool : public Vcltee::Teengine::TTeeCustomTool
//...
#ifdef DrawText
#undef DrawText
#endif
    void __fastcall DrawText(Vcltee::Teengine::TCustomAxisPanel* const AParent)/* overload */;
It seems to work fine for me here with TeeChart v2014.12 and RAD XE7.

Re: Unresolved external with Teetools::TTextShape::DrawTextW

Posted: Tue Oct 14, 2014 10:08 am
by 9335230
Thank you Yeray,

It works fine for me too. At least, compiling and running the simple testRectangleXE2.zip. Now, I can also compile my own Tee Tools but I can't assure that it works or crashes at running time because I'm still correcting other running time errors starting the big application using those tools.

Re: Unresolved external with Teetools::TTextShape::DrawTextW

Posted: Wed Oct 15, 2014 9:31 am
by yeray
Hello,

I'm afraid this is the only workaround I can think on.
As a final solution, we've renamed DrawText to DoDrawText in TeeTools.pas to avoid that conflict with Windows API in C++ in the next maintenance release.