Page 1 of 1

Problem with compilation of latest VCL version in XE2

Posted: Tue Jul 03, 2012 8:29 am
by 16561419
Hello,

I have a big project using lots of differrent components.
The whole project is built totally from sources on a build PC using the Delphi command line compiler.
Lately with XE2 and the latest TChart version I run into trouble when compiling from sources even in the IDE.
First if you add the source path of the TChart sources to the project it will not compile.

The first error message is:
[DCC Fatal Error] VCLTee.TeeComma.pas(44): F1026 File not found: 'TeCanvas.dcu'

So what I did is I went to the Project Options => Unit scope names and added "VCLTee"
Then the project compiles fine. BUT the resulting executable crashes immediately on startup for example when a
TGDIPlus component is active

Message : Access violation at address 00000000. Read of address 00000000.

Call Stack Information:
-----------------------------------------------------------------------------------------------
|Address |Module |Unit |Class |Procedure/Method |Line |
-----------------------------------------------------------------------------------------------
|Running Thread: ID=6960; Priority=0; Class=; [Main] |
|---------------------------------------------------------------------------------------------|
|773C25C9|ntdll.dll | | |RtlReleaseSRWLockShared | |
|773A012E|ntdll.dll | | |KiUserExceptionDispatcher| |
|00707542|Project1.exe|VCLTee.GDIPAPI.pas |TGdiplusBase |NewInstance |6683[1] |
|0071A711|Project1.exe|VCLTee.GDIPOBJ.pas |TGPPen |Create |2999[0] |
|005DFD99|Project1.exe|VCLTee.TeCanvas.pas |TCanvas3D |Create |5222[1] |
|005DFD7C|Project1.exe|VCLTee.TeCanvas.pas |TCanvas3D |Create |5221[0] |
|005E1329|Project1.exe|VCLTee.TeCanvas.pas |TTeeCanvas3D |Create |5965[1] |
|0071A704|Project1.exe|VCLTee.GDIPOBJ.pas |TGPPen |Create |2999[0] |
|007263E6|Project1.exe|VCLTee.TeeGDIPlus.pas|TGDIPlusCanvas|Create |337[24] |
|00726398|Project1.exe|VCLTee.TeeGDIPlus.pas|TGDIPlusCanvas|Create |313[0] |
|0072B2A6|Project1.exe|VCLTee.TeeGDIPlus.pas|TTeeGDIPlus |Activate |2489[4] |
|0072B280|Project1.exe|VCLTee.TeeGDIPlus.pas|TTeeGDIPlus |Activate |2485[0] |
|0072B4FA|Project1.exe|VCLTee.TeeGDIPlus.pas|TTeeGDIPlus |SetTeePanel |2575[20]|
|00861B59|Project1.exe|Project1.dpr | | |13[3] |

This is just a very simple example project containing 4 items:

TForm1 = class(TForm)
TeeCommander1: TTeeCommander;
Chart1: TChart;
Series1: TPieSeries;
TeeGDIPlus1: TTeeGDIPlus;
private.

Do I miss a certain compiler directive or setting when I compile the TChart sources with the XE2 compiler?
Unfortunately I can't follow/see what you are doing in the TeeRecompile tool.

best regards,

X-Ray

Re: Problem with compilation of latest VCL version in XE2

Posted: Tue Jul 03, 2012 2:56 pm
by yeray
Hi,
TeeCommander1: TTeeCommander;
Chart1: TChart;
Series1: TPieSeries;
TeeGDIPlus1: TTeeGDIPlus;
So, a new project with just the components above in the form does already show the error message indicating the compiler can't find TeCanvas.dcu, right?
It would indicate there's a reference to the Lib path missing in the IDE Library path list. Please, check it.

Re: Problem with compilation of latest VCL version in XE2

Posted: Tue Jul 03, 2012 3:02 pm
by 16561419
Hello Yeray,

this is not about missing libraries!
I compile (this simple project) completely from sources and the resulting executable crashes, that is the problem.
The executable that is built from libraries works fine.
Please read my post carefully.

best regards,

X-Ray

Re: Problem with compilation of latest VCL version in XE2

Posted: Thu Jul 05, 2012 8:03 am
by yeray
Hi,

You were right, excuse me.
In theory, we'd say in XE2, with the unit scopes, you must reference the "Sources/VCL" path (generated through TeeRecompile) so the units with the prefixes can be found. And, having also the "Sources" path referenced, and "VclTee" defined in the unit scopes, can make a unit to be found two times, making a compilable project but unstable since it includes references to two "equal but different" units.
However, having only the "Sources/VCL" path referenced (so, I thought avoiding the confusion explained above) still reproduces the problem you detailed.
Then, I'm afraid the only I can suggest you is to always use TeeRecompile to generate the dcu(s), etc... and use the Lib path "\Compiled\Delphi16.win32\Lib" instead of the Sources or Sources/VCL path.

If you still have problems with this, don't hesitate to let us know.

Re: Problem with compilation of latest VCL version in XE2

Posted: Thu Jul 05, 2012 9:12 am
by 16561419
Hello Yeray,

to make sure that no any confusion can happen I deleted the un-dotted TChart source files completely.
Still the excuatble build from sources crashes.
There have to be some "magical" compiler settings in the TeeRecompile tool that make the compiled libs work.
Please supply these settings because we have a rule here that our whole build procedure must be transparent and
that everything has to be build from sources.

best regards,

X-Ray

Re: Problem with compilation of latest VCL version in XE2

Posted: Thu Jul 05, 2012 2:30 pm
by yeray
Hi,

TeeRecompile tool is quite complex, but the final command it creates to compile the VCL and FMX packages for Win32 is (this is to compile the Tee916.dpk package):
'"C:\Program Files (x86)\Embarcadero\RAD Studio\9.0\bin\dcc32.exe" -B -$D- -$L- -$W- -$O+ -$C- -$Y- -$C- -$R- -$Q- -Q -W+ -H -$A8 --no-config -u"C:\Program Files (x86)\Embarcadero\RAD Studio\9.0\Lib\win32\Release" --inline:on -nsSystem;WinAPI;VCL;System.Win;VCL.Imaging;Data;BDE;Datasnap;VCLTee -LN"C:\Program Files (x86)\Steema Software\TeeChart Pro 2012 Full Source Code\Sources\Compiled\Delphi16.win32\Lib" -E"C:\Program Files (x86)\Steema Software\TeeChart Pro 2012 Full Source Code\Sources\Compiled\Delphi16.win32\bin" -N0"C:\Program Files (x86)\Steema Software\TeeChart Pro 2012 Full Source Code\Sources\Compiled\Delphi16.win32\Lib" -U"C:\Program Files (x86)\Steema Software\TeeChart Pro 2012 Full Source Code\Sources\Compiled\Delphi16.win32\Lib";"C:\Program Files (x86)\Embarcadero\RAD Studio\9.0\Lib\win32\Release";"C:\Program Files (x86)\Steema Software\TeeChart Pro 2012 Full Source Code\Sources\VCL";"C:\Program Files (x86)\Embarcadero\RAD Studio\9.0\Projects\Bpl" -I"C:\Program Files (x86)\Steema Software\TeeChart Pro 2012 Full Source Code\Sources\VCL" -R"C:\Program Files (x86)\Steema Software\TeeChart Pro 2012 Full Source Code\Sources\VCL" -DBCB --BCB -CG -JPHNE -JL -NO"C:\Program Files (x86)\Steema Software\TeeChart Pro 2012 Full Source Code\Sources\Compiled\Delphi16.win32\Lib\Obj" -NH"C:\Program Files (x86)\Steema Software\TeeChart Pro 2012 Full Source Code\Sources\Compiled\Delphi16.win32\Include" -NB"C:\Program Files (x86)\Steema Software\TeeChart Pro 2012 Full Source Code\Sources\Compiled\Delphi16.win32\Lib\Obj" "C:\Program Files (x86)\Steema Software\TeeChart Pro 2012 Full Source Code\Sources\VCL\Tee916.dpk" -LE"C:\Program Files (x86)\Steema Software\TeeChart Pro 2012 Full Source Code\Sources\Compiled\Delphi16.win32\System" '
I hope it helps!

Re: Problem with compilation of latest VCL version in XE2

Posted: Fri Jul 06, 2012 1:32 pm
by 16561419
Hello Yeray,

After some inspection of the source code things got a bit clearer.
Successfull compilation of TeeChart from source files depends on the order of search paths.

When compiled in Delphi XE2 (D16), the file VCLTee.TeeGDIPlus.pas uses the units GDIPAPI and GDIPOBJ using the following code:

{$IFDEF D16}
GDIPAPI,
GDIPOBJ,
{$ELSE}

These units are included without unit scope qualifiers. The intended units are Winapi.GDIPAPI.pas and Winapi.GDIPOBJ.pas, which are shipped with Delphi XE2. Because the unit scope qualifiers are missing, it is possible that VCLTee.GDIPAPI.pas and VCLTee.GDIPOBJ.pas are included resulting in uninitilialized GDI+ function pointers which cause access violations.

My suggestion is to add unit scope qualifiers:

{$IFDEF D16}
Winapi.GDIPAPI,
Winapi.GDIPOBJ,
{$ELSE}

This way there is no ambiguity that depends on the order of search paths only.

best regards,

X-Ray

Re: Problem with compilation of latest VCL version in XE2

Posted: Tue Jul 10, 2012 10:51 am
by yeray
Hi,

We renamed GDIPAPI GDIPOBJ to TeeGDIPAPI i TeeGDIPOBJ to avoid this. What version are you using?

Re: Problem with compilation of latest VCL version in XE2

Posted: Tue Jul 10, 2012 11:23 am
by 16561419
Hello Yeray,

I am using version: TeeChart 2012.06.120613.
Not compeletely since this version did not compile under FPC/iOS.
Finally I got a new version from Sandra that now compiles fine for iOS.
Concerning the files you mention, I think the problm is that the old (non-Tee) files
(GDIPAPI.pas and GDIPOBJ.pas) are still present in the sources directory which causes confusion.
I think if you simply delete the files GDIPAPI.pas and GDIPOBJ.pas everything should be fine.

best regards,

X-Ray

Re: Problem with compilation of latest VCL version in XE2

Posted: Tue Jul 10, 2012 11:30 am
by yeray
Hi X-Ray,

Ooops you're right! The "non-tee" GDIPAPI.pas and GDIPOBJ.pas files shouldn't be included. You can remove them, and we won't include them in the next version.
Sorry for the inconvenience.