Unresolved external with Teetools::TTextShape::DrawTextW

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Bill
Newbie
Newbie
Posts: 13
Joined: Wed Apr 11, 2012 12:00 am

Unresolved external with Teetools::TTextShape::DrawTextW

Post by Bill » Tue Aug 28, 2012 3:21 pm

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

Yeray
Site Admin
Site Admin
Posts: 9617
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

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

Post by Yeray » Wed Aug 29, 2012 2:12 pm

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 1031 times
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Yeray
Site Admin
Site Admin
Posts: 9617
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

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

Post by Yeray » Wed Aug 29, 2012 2:24 pm

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 1100 times
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Bill
Newbie
Newbie
Posts: 13
Joined: Wed Apr 11, 2012 12:00 am

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

Post by Bill » Wed Aug 29, 2012 3:03 pm

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);
}

Yeray
Site Admin
Site Admin
Posts: 9617
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

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

Post by Yeray » Thu Aug 30, 2012 9:06 am

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);
};
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Bill
Newbie
Newbie
Posts: 13
Joined: Wed Apr 11, 2012 12:00 am

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

Post by Bill » Thu Aug 30, 2012 12:31 pm

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?

Yeray
Site Admin
Site Admin
Posts: 9617
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

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

Post by Yeray » Thu Aug 30, 2012 1:56 pm

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Bill
Newbie
Newbie
Posts: 13
Joined: Wed Apr 11, 2012 12:00 am

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

Post by Bill » Thu Aug 30, 2012 2:46 pm

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

Yeray
Site Admin
Site Admin
Posts: 9617
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

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

Post by Yeray » Mon Sep 03, 2012 1:15 pm

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Bill
Newbie
Newbie
Posts: 13
Joined: Wed Apr 11, 2012 12:00 am

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

Post by Bill » Thu Nov 15, 2012 2:48 pm

This issue still not resolved in the latest version: TeeChart Pro v2012.07.121105 32 bit VCL !

Yeray
Site Admin
Site Admin
Posts: 9617
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

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

Post by Yeray » Fri Nov 16, 2012 9:47 am

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

beetle
Newbie
Newbie
Posts: 59
Joined: Fri Dec 12, 2003 5:00 am

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

Post by beetle » Fri Oct 10, 2014 11:33 am

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 .

Yeray
Site Admin
Site Admin
Posts: 9617
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

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

Post by Yeray » Fri Oct 10, 2014 3:37 pm

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

beetle
Newbie
Newbie
Posts: 59
Joined: Fri Dec 12, 2003 5:00 am

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

Post by beetle » Tue Oct 14, 2014 10:08 am

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.

Yeray
Site Admin
Site Admin
Posts: 9617
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

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

Post by Yeray » Wed Oct 15, 2014 9:31 am

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply