How to fix 'undeclared identifier' error in Indy? - delphi

I have downloaded Indy 10.4587 and I get 'undeclared identifier' error when I try to compile it and install it in Delphi 7.
type
ADDRINFO = record
ai_flags : Integer; // AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST
ai_family : Integer; // PF_xxx
ai_socktype : Integer; // SOCK_xxx
ai_protocol : Integer; // 0 or IPPROTO_xxx for IPv4 and IPv6
ai_addrlen : size_t; <---------------------------------------------HERE
...
end;
The error is in this file:
LIB\SYSTEM\IdWship6.pas(49) Fatal: Could not compile used unit 'IdWinsock2.pas'
How can I fix this bug?
Does anybody have the direct download link to a stable version?
It looks like the latest pseudo-stable version of Indy you can download may be 10.4587, which actually may be 10.4.587. There is no ReadMe or About file inside the archive to explain the version and release date. It can be downloaded from a 3rd party web site here: http://indy.fulgan.com
However, people are talking about a possible version 10.5.8. Please let me know if you have a real download link for this 'magic' version.
Edit:
I just downloaded v10.4587 and it doesn't compile.

A quick google on "delphi 7 size_t" offers up a link wherein there is a workaround to define size_t as well as a note that an earlier revision of the indy lib than what you mention is the last one which can be built using delphi 7
see: https://forums.embarcadero.com/thread.jspa?threadID=48622

size_t is an undefined type.
put
size_t = integer;
at the top

Related

How to get S.M.A.R.T. info from disks?

I tried code found in Google but nothing works and in most cases it doesn't even compile (missing units, undeclared data types etc).
I finally found something that looks complete but shows "The handle is invalid" error:
http://rsdn.org/article/delphi/SMART.xml
You can download the file from here:
http://rsdn.org/article/delphi/smart/smart.zip
The problem is with function function OpenSMART(DrvNum:Byte): THandle;
hSMARTIOCTL:=CreateFile(PChar('\\.\PhysicalDrive'+inttostr(DrvNum)),GENERIC_READ or GENERIC_WRITE,FILE_SHARE_READ or FILE_SHARE_WRITE,nil,OPEN_EXISTING,0,0);
result:= hSMARTIOCTL;
How can I fix it or where can I find working example?
I use Delphi 7 Pro and Delphi 10.3.
OK, it needs to be run as admin. Then it just works.

Missing procedure entry point for VariantInit during run of C++Builder application

When starting a compiled C++Builder application, it says it cannot find the procedure entry point for VariantInit, and the program does not start. After recompiling, the missing procedure varies (_wopen, VariantCopyInd, _time, _write). Using static linking of the run-time environment (Link with dynamic RTL = false, Link with run-time packages = false).
In the project options, disable incremental link. Doing a full rebuild also works.

How to debug inno-setup exceptions

I compiled inno-setup with XE6 myself. (I know, the document suggested older delphi versions, but I only have new IDE)
I want to use pascal script to customize setup. But even I added a simplest [Code] section, the created installation crash.
[Code]
function InitializeSetup(): Boolean;
begin
end;
The created setup.exe failed while being installed:
[22:10:29.945] *** Setup started
[22:10:36.182] Setup version: Inno Setup version 5.5.4 (u)
[22:10:36.186] Original Setup EXE: D:\Classics\Save\Installer\Win_Platform\Inno Setup\test\Output\setup.exe
[22:10:36.190] Setup command line: /SL5="$911152,176640,176640,D:\Classics\Save\Installer\Win_Platform\Inno Setup\test\Output\setup.exe" /SPAWNWND=$7B05B8 /NOTIFYWND=$1150B10 /DEBUGWND=$74002E
[22:10:36.200] Windows version: 6.2.9200 (NT platform: Yes)
[22:10:36.203] 64-bit Windows: Yes
[22:10:36.209] Processor architecture: x64
[22:10:36.212] User privileges: Administrative
[22:10:37.660] 64-bit install mode: No
[22:10:37.674] Created temporary directory: C:\Users\CAOSHU~1\AppData\Local\Temp\is-5AOTJ.tmp
[22:10:37.717] InitializeSetup raised an exception (fatal).
[22:10:37.725] Exception message:
[22:10:37.734] Message box (OK):
Access violation at address 006043C0 in module 'setup.tmp'. Read of address 00000014.
[22:11:03.501] User chose OK.
[22:11:03.515] Deinitializing Setup.
[22:11:04.424] *** Setup exit code: 1
Perhaps the way I compiled inno setup has some problems. I need not use XE6? But how to debug and figure out where the problem is?
It is not some code which crashes when it runs. It is a setup.exe which created by inno setup.
The value returned by InitializeSetup() is undefined.
function InitializeSetup(): Boolean;
begin
result := true;
end;
You get an undefined behaviour because of this. If most of the time the result will be false (last 8 bits of RAX == 0), this is not always the case and you'll get a seriously "hard to understand" issue, particularly when, for no reason, it'll work.

jcvl not working due to jcl requirements

I am trying to manually install JCL and jvcl for delphi xe2.
I have installed JCL as directed and it seems to have installed with no issues.
Now I try to load the JVCL package 16 , it opens delphi and starts to load libarys, When it gets to the Jedi code Library MPL1.1 i start to get errors like below
Error reading form frmJucolorProviderDesigner
-class tjvcontextprovider not found
Ingnore Cancel Ingnore all
this is not the only one i get quite a few ill post a few more in case it helps
Error reading form JvStandardActions
-tjvSendMailAction not found
-tjvwebaction not found
Error reading form jvCheckItemsEditor
-tjvCheckListBox not found
Error reading form JvControlActoinsDM
-tjvControlcollapseAction not found
-TjvControlexpandAction not found
-TjvControlExportAction not found
-tjvControlOptimizeColumnsAction not found
-TjvControlCustomizeColumnsAction not found
-TjvControlPrintAction not found
Error reading form jvSpeedBarEditorMain
-jvFormStorage not found
-AppRegistryStorage not found
ect... I can add rest if you need.
But each - is its own dialog box with [ignore][cancel][ignore all]
Now after I press Ignore 50 times it will finally load the project, when i try to build all the projects for JVCl package it says required package jcl not found.
in library path i have
..jcl\source\common
..jcl\source\windows
..jcl\source\include
in browsing path i have
..jcl\source\common
..jcl\source\vcl
..jcl\source\windows
and in DCU debug path i have
..jcl\lib\d16\win32\debug
after adding
..jcl\lib\d16\win32, which contains the 32 bit jcl.dcp
The solution is to change the uses to use a fully qualified name:
uses
TypInfo,
{$IFDEF JvInterpreter_OLEAUTO}
OleConst, ActiveX,
{$IFDEF VER230} system.win.ComObj, {$ELSE} ComObj, {$ENDIF}
Now it compiles without error.
Try to add the following to your Search Path(HKCU\Software\Embarcadero\BDS\x.x\Library\Win32), of course including the correct path prefix:
..jcl\source;
..jcl\source\common;
..jcl\source\include;
..jcl\source\vcl;
..jcl\source\windows;
..jvcl\common;
..jvcl\run;
You might also be interested in the following link:
http://andy.jgknet.de/blog/2013/05/how-to-install-jcl-and-jvcl-for-xe4/

How can I solve fatal compiler errors when installing GLScene into RAD Studio 2010?

I'm trying to install GLScene into RAD Studio 2010, with the aim of using it from a mostly C++ project. I downloaded the latest snapshot (5991, November 2011) and have been trying to compile and install the two main packages: GLScene_DesignTime and GLScene_RunTime. I haven't even tried some of the other libraries (CUDA, etc), I just want to get the base packages running.
I've encountered a number of problems, one of which I can't solve, and I'm seeking the help of anyone on SO who has successfully installed GLScene, or might know how to solve these Delphi compiler errors.
First problem (solved?)
When compiling, a number of files gave the following error:
[DCC Warning] GLSelection.pas(297): W1025 Unsupported language feature: 'abstract class method'
This is caused by a method declaration something like:
TGLBaseSelectTechnique = class
public
class function IsSupported: Boolean; virtual; abstract;
It seems that a virtual abstract class method is not supported in Delphi 2010, and I have solved it by removing 'abstract' and providing a dummy implementation, e.g. just returning false.
The second problem (not solved) - Delphi compiler fatal errors
I am now encountering two more serious errors. When compiling, the compiler fails like so:
[DCC Fatal Error] Exception EAccessViolation: Access violation at address 05AE8ED9 in module 'dcc140.dll'. Read of address 00000003
[DCC Error] Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
It doesn't say what file caused this, but I think it's caused by Spline.pas. Occasionally and not as often, I get this:
[DCC Fatal Error] Spline.pas(1): F2084 Internal Error: AV062D8ED9-R00000003-0
This indicates Spline.pas, and I think the first error is probably related to the file too, because after getting the first one if I then clean the project, cleaning will fail saying it could not delete Spline.hpp. (I have to close and reopen the IDE.) Spline.hpp just contains the following:
// CodeGear C++Builder
// Copyright (c) 1995, 2009 by Embarcadero Technologies, Inc.
// All rights reserved
// (DO NOT EDIT: machine generated header) 'Spline.pas' rev: 21.00
#ifndef SplineHPP
#define SplineHPP
#pragma delphiheader begin
#pragma option push
#pragma option -w- // All warnings off
#pragma option -Vx // Zero-length empty class member functions
#pragma pack(push,8)
#include <System.hpp> // Pascal unit
#include <Sysinit.hpp> // Pascal unit
and there it stops. It looks to me like it failed when trying to generate the HPP file.
I always get one of these two failures. The second is the only one I can tie to a specific file; the first fails halfway through the project, but I can't see where it got up to when it failed. I am compiling from inside the IDE.
I've looked in Spline.pas, and it seems pretty basic code - I can't see anything unusual at all. You can find it here, and apparently the file hasn't been touched for seven years... so I think it should compile :)
If I change the project settings so it does not generate headers, it compiles fine. (Generating just obj files, and any other of the settings that does not include "headers", all work fine.) But this isn't a good workaround for me - after all, I need to use it from C++ Builder, so my normal setting would be "Generate all C++ Builder files". At a bare minimum, I need HPP and OBJ files.
Has anyone here used GLScene in a recent version of C++ Builder? Have you encountered similar problems? Any idea how to solve this one?
I am using:
RAD Studio 2010 (fully patched and up to date; DDevExtensions and IDEFixPack installed.)
The November 2011 snapshot; I tried the March 2011 snapshot too, and got the same problems. Link to snapshots here.
The Delphi 2010 packages modified only by changing the linker output to generate C++ Builder files; and also the BCB 6 packages. Both give the same errors.
Edit: GLScene now has compatibility with RAD Studio XE3 (including C++ Builder.)
Now there is full compatibility of GLScene with Embarcadero RAD Studio
C++Builder XE3 as in design and runtime mode.
You can download it from http://yadi.sk/d/o1QGI2KA10MK1 (95Mb)
-- from Pal Wassail's post on the Embarcadero forum thread.
{quote:title=David M wrote:}{quote}
Hi,
I'm trying to install GLScene into RAD Studio...
David
And here is more simple Test for EMB developers of Delphi XE3 header generator -
1.Create a VCL Form Application
2.Add in Unit1.pas interface section
type
TVector3f = array[0..2] of single;
TVector4f = array[0..3] of single;
function VectorAdd(const v : TVector3f; const f : Single) : TVector3f; overload;
function VectorAdd(const v : TVector4f; const f : Single) : TVector4f; overload;
3.Add in implementation section
function VectorAdd(const v : TVector3f; const f : Single) : TVector3f;
begin
Result[0]:=v[0]+f;
Result[1]:=v[1]+f;
Result[2]:=v[2]+f;
end;
function VectorAdd(const v : TVector4f; const f : Single) : TVector4f;
begin
Result[0]:=v[0]+f;
Result[1]:=v[1]+f;
Result[2]:=v[2]+f;
Result[3]:=v[3]+f;
end;
Set Delphi Compiler option “Generate C++ .objs, headers, namespaces, export”
Build the project
Then Delphi XE3 compiler generates wrong header file Unit1.hpp with lines:
extern PACKAGE TVector3f __fastcall VectorAdd
(float const v, const float f)/ overload */;
extern PACKAGE TVector4f __fastcall VectorAdd
(float const v, const float f)/ overload */;
If now you are trying to use this header file Unit1.hpp in my.cbproj you get fatal error:
“E2238 Multiple declarations in …”
Yes, if you change vector array types to records:
TVector3f = record
case boolean of
true : (Coord: array[0..2] of single);
false : (X,Y,Z: single);
end;
then the problem could be solved, because in this case Delphi compiler generates
extern PACKAGE Vectortypes::TVector3f __fastcall VectorAdd
(const Vectortypes::TVector3f &v, const float f)/* overload */;
extern PACKAGE Vectortypes::TVector4f __fastcall VectorAdd
(const Vectortypes::TVector4f &v, const float f)/* overload */;
and you could build your C++Builder VCL application without "Multiple declaration " error. It was done for old GLScene version in 2007, but now you need to rewrite some part of code in new library, starting from VectorGeometry.pas module.
There are second way to fix such automatic header's errors - improvement of Delphi compiler in Generating C/C++ headers, namespaces and packages option. But it's in hands of EMB developers.
Here's how I do it:
Download and extract this ZIP file (directly into the root folder of GLScene, allowing it to overwrite as necessary)
Load up the appropriate RAD Studio version (2007 to XE2) and open the file *GLScene_Group.groupproj* (where = your RAD Studio version)
Build/Install each Package in group order
I have carefully assembled these fixed packages to ensure they all install and function properly from 2007 to XE2. Some packages (at the bottom of each group) require additional dependencies to function (such as the Python package) so be mindful of these.
I have tested and confirmed that these work on RAD Studio 2007 to XE2 only.
Don't forget to add the \Source folder (and all subfolders) to the Search Paths (either for the IDE itself or an individual Project, as you desire) otherwise the projects using GLScene components will fail to compile complaining of missing units.
Enjoy!
Not for RAD Studio 2009 but for old GLScene installation in BCB6 she was running well. But current version after installation in RAD Studio XE/XE2/XE3 does not work at all. It seems that the main problem is hidden in overload mechanism of procedures in Vectorgeometry.pas, so Delphi compiler (with using an option for Output of all C++ files and packages) creates coincident strings in Vectorgeometry.hpp and others. Thus you have visual components in C++Builder panel, but your application fails with errors during building. It must be repaired in .pas files by GLScene developers.
When you trying to build an application with GLScene under C++Builder XE3 you will get over 50 BCC32 errors in glcrossplatform.hpp, vectorgeometry.hpp and so on. There is a way to repair the library on your own discretion. Make a new copy of GLScene directory. In GLCrossPlatform.pas rename the procedure RGB to GLRGB (it's work!). Then in VectorGeometry.pas and in many others files of source codes change all overload procedures with slightly different parameter names, so you should't encounter coincident procedures in .hpp files after Delphi option output C++ (last option that includes packages). Then rebuild all GLScene packages. At the end of the process I hope it should work for C++Builder XE3.
I have exact he same errors.
#The second problem
Go to "spline.pas" and change
TCubicSplineMatrix = array of array[0..3] of Single;
to
TCubicSplineMatrixEx = array[0..3] of Single;
TCubicSplineMatrix = array of TCubicSplineMatrixEx;
Now "Rad Studio 2009" can compile and install GLScene for C++Builder. I can start a new C++Builder VCL Application and select GLScene components from the toolbox and drop in my VCL form.
I think, this is the solution for your basic problem, but unfortunately I can not compile my VCL project successful. I get over 50 BCC32 errors in glcrossplatform.hpp and vectorgeometry.hpp. If anyone can help here, that would be great.
#Your First problem
I get this warnings too, but I have nothing changed for it. Just ignore it?!

Resources