E2065 Unsatisfied forward or external Declaration - delphi

I am working on 64 bit migration of 32 bit Delphi project.
While using C obj file I was getting errors which are solved by answer provided in the question link:
Bad object file formate
But after using the answers provided by David and Rudy.
I have resolved the issue but now I am getting some other errors:
[dcc64 Error] xxx.dpr(936): E2065 Unsatisfied forward or external declaration: '__GSHandlerCheck'
[dcc64 Error] xxx.dpr(936): E2065 Unsatisfied forward or external declaration: '__security_cookie'
[dcc64 Error] xxx.dpr(936): E2065 Unsatisfied forward or external declaration: '__security_check_cookie'
[dcc64 Error] xxx.dpr(936): E2065 Unsatisfied forward or external declaration: '__imp_free'
[dcc64 Error] xxx.dpr(936): E2065 Unsatisfied forward or external declaration: '__imp_malloc'
I am not able to see any traces of these functions.
Can anyone help me on this?

Related

E2250 There is no overloaded version of 'GetProcAddress' that can be called with these arguments

I created dynamic Dll and i was using a method of this DLL in my Delphi Appliction.
Iam getting these errors, can't really figure out whats the reason.
I declared the method like this
TWithdrawMoney = function(currentBalance,withdrawBalance:double):double;stdcall;
and used it as
Handle := LoadLibrary('C:\Projects\WithdrawMoneyDLL.dll'); //Line 83
if (currentBalance > 0) and (strtofloat(money.Text) <= currentBalance) then
begin
if Handle <> 0 then //Line 96
begin
#withdrawMoney := GetProcAddress(Handle, 'withdrawMoney'); //line 98
currentBalance := withdrawMoney(currentBalance,strtofloat(money.Text));
end;
ShowMessage('Widraw successful');
end
these are the errors that I am are getting.
[dcc32 Error] widrawMoneyPanel.pas(83): E2129 Cannot assign to a read-only property
[dcc32 Error] widrawMoneyPanel.pas(96): E2015 Operator not applicable to this operand type
[dcc32 Error] widrawMoneyPanel.pas(98): E2250 There is no overloaded version of 'GetProcAddress' that can be called with these arguments
[dcc32 Fatal Error] F2063 Could not compile used unit 'widrawMoneyPanel.pas'

How to fix the "Incompatible types: 'PPointer' and 'Pointer'" Delphi compiler error?

When building a program that uses the Graphics32 library (the old 1.9.1 version) with Delphi XE4 (targeting Win32, if it matters), I got the following compiler error:
[dcc32 Error] GR32_LowLevel.pas(1240): E2010 Incompatible >types: 'PPointer' and 'Pointer'
Which is produced by this line:
Registry.RegisterBinding(FID_FILLLONGWORD, ##FillLongWord);
Where RegisterBinding is defined as:
procedure RegisterBinding(FunctionID: Integer; BindVariable: PPointer);
And FillLongword is defined as:
var
FillLongword: procedure(var X; Count: Cardinal; Value: Longword);
How to resolve the compiler error? To my eyes it seems that the syntax is correct, isn't ## means 'pointer of pointer', which is PPointer?
Thanks.

Unresolved external errors while using TList in C++

I have the following linker errors when compiling a project using bcc32c (Embarcadero):
It looks like he is not finding the library VCL.
[ilink32 Error] Error: Unresolved external 'System::__linkproc__
__fastcall LStrAsg(System::AnsiStringT&, System::AnsiStringT)
referenced from ...DEBUG\VCLE.LIB|System_t_win32
[ilink32 Error] Error: Unresolved external System::__linkproc__
__fastcall LStrCat(System::AnsiStringT&, System::AnsiStringT)
[ilink32 Error] Error: Unresolved external System::__linkproc__
__fastcall LStrCat3(System::AnsiStringT&, System::AnsiStringT)
[ilink32 Error] Error: Unresolved external System::__linkproc__
__fastcall LStrClr(void *) referenced from ...
[ilink32 Error] Error: Unresolved external System::__linkproc__
__fastcall LStrCmp()
[ilink32 Error] Error: Unresolved external System::__linkproc__
__fastcall LStrDelete(System::AnsiStringT&, int, int) referenced
from ...
[ilink32 Error] Error: Unresolved external System::__linkproc__
__fastcall LStrFromArray(System::AnsiStringT&, char *, int,
unsigned short) referenced from
[ilink32 Error] Error: Unresolved external System::__linkproc__
__fastcall LStrFromPChar(System::AnsiStringT&, char *, unsigned
short) referenced from...
[ilink32 Error] Error: Unresolved external System::__linkproc__
__fastcall StrFromUStr(System::AnsiStringT&,System::UnicodeString,
unsigned short) referenced from...
The problem is that the linker can not resolve the VCL class references.
Insert in your project a VCL C++ Form.
Right click on the project and Add New->VCL Form C++ Builder
It is not necessary to save the unit.h/.cpp.
You can in sequence delete the form from your project. This is only necessary for the link to be created
Embarcadero put in your .cbproj the code FrameworkType = VCL.
<PropertyGroup>
<ProjectGuid>{xxxx}/ProjectGuid>
<ProjectVersion>XX.Y</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
The problem must be solved.

Indy 10 compilation fails with FASTMM compiler directive enabled

I'm using Delphi 7. I downloaded the latest version of Indy (10.5462) from Fulgan's page yesterday.
There is a batch file (Full_d7.bat) which normally compiles Indy successfully.
Now if I DEFINE USE_FASTMM4 in IdCompilerDefines.inc in Core, Protocols and System directory, the following error is given back on compilation:
IdGlobal.pas(2229) Error: Declaration of 'GetBytes' differs from declaration in
interface 'IIdTextEncoding'
IdGlobal.pas(2229) Error: Declaration of 'GetCharCount' differs from declaration
in interface 'IIdTextEncoding'
IdGlobal.pas(2229) Error: Declaration of 'GetChars' differs from declaration in
interface 'IIdTextEncoding'
IdGlobal.pas(2229) Error: Declaration of 'GetChars' differs from declaration in
interface 'IIdTextEncoding'
IdGlobal.pas(2229) Error: Declaration of 'GetChars' differs from declaration in
interface 'IIdTextEncoding'
IdGlobal.pas(2229) Error: Declaration of 'GetString' differs from declaration in
interface 'IIdTextEncoding'
IdGlobal.pas(3500) Error: Incompatible types: 'Char' and 'Integer'
IdGlobal.pas(3502) Error: Incompatible types: 'Char' and 'Integer'
IdGlobal.pas(3527) Error: Incompatible types: 'Byte' and 'Char'
IdGlobal.pas(3592) Error: Incompatible types: 'Char' and 'Byte'
IdGlobal.pas(3594) Error: Incompatible types: 'Char' and 'Byte'
IdGlobal.pas(3617) Error: Incompatible types
IdGlobal.pas(3620) Error: Incompatible types: 'Word' and 'Char'
IdGlobal.pas(3663) Error: Incompatible types: 'Char' and 'Byte'
IdGlobal.pas(3665) Error: Incompatible types: 'Char' and 'Byte'
IdGlobal.pas(3687) Error: Incompatible types: 'Word' and 'Char'
Is this a bug in the D7 edition or I'm missing something? Is there something maybe that needs to be defined as well in the config file when using FastMM?
FastMM declares its own version of several Delphi native data types (Native(U)Int, (U)IntPtr, etc) when supporting older compilers that do not have those types available.
However, it is also declaring PByte in all Delphi versions prior to D2009, which it should NOT be doing (since PByte is available in the RTL's System unit going all the way back to at least Delphi 5). That redeclaration of PByte is interfering with Indy's use of PByte in the IdGlobal unit - but only in Delphi versions prior to D2006 (as Indy does not use FastMM directly in later Delphi versions).
I have checked in a patch for Indy to address this (SVN rev 5463), and filed a bug report with FastMM.

Delphi - disable controls not working EMS Advanced Export 4

I tried to disable ABSQuery1 controls before exporting data :
procedure TForm1.QExport4Dialog1BeforeExportRow(Sender: TQExport4;
Row: TQExportRow; var Accept: Boolean);
begin
ABSQuery1.DisableControls;
end;
But I get :
> [dcc32 Error] Unit1.pas(75): E2003 Undeclared identifier: 'TQExport4'
> [dcc32 Error] Unit1.pas(76): E2003 Undeclared identifier:
> 'TQExportRow' [dcc32 Error] Unit1.pas(204): E2005 'TQExport4' is not a
> type identifier [dcc32 Error] Unit1.pas(205): E2005 'TQExportRow' is
> not a type identifier [dcc32 Fatal Error] Project1.dpr(15): F2063
> Could not compile used unit 'Unit1.pas'
What am I doing wrong ?
Your error messages all indicate that you have not used the units in which the named symbols are declared. Add those units, those that declare TQExport4 and TQExportRow, to the uses clause of your Unit1.
It's usually worth consulting the documentation when you encounter a compiler error that you do not understand. Search for the error code, for example E2003. The documentation says:
The compiler could not find the given identifier - most likely it has been misspelled either at the point of declaration or the point of use. It might be from another unit that has not mentioned a uses clause.
The final sentence covers your scenario, although the author got in a tangle when writing that text and the words don't make a lot of sense. Sigh.
Incidentally, the example at the bottom of that documentation page made me sad. The author indicates a preference, when correcting mis-named variables, for the option requiring the fewest key strokes. Never mind getting the name right, just make it compile with the fewest key strokes and who cares about the next person to read the code. Pah!

Resources