[fpc-devel] external problem

rstar at mnet-online.de rstar at mnet-online.de
Fri Nov 26 14:32:51 CET 2004


You cannot declare procedures in the interface section.

Tomas Hajny wrote:

>On Thu, 25 Nov 2004 18:18:45 +0100, rstar wrote
>  
>
>>interface
>>
>>procedure dfCrap(setoperation: Tso); cdecl;
>>
>>implementation
>>
>>{$LINK dfc.ow}   //GCC object file style
>>
>>procedure dfCrap(setoperation: Tso); cdecl; external;
>>...
>>
>>The declaration does exist in the interface!
>>    
>>
>
>Yes, that's the problem. You either need to remove the declaration from interface altogether, or move the complete declaration including import specification from implementation to interface.
>
>
>  
>
>>BTW: I am working under Win32.
>>    
>>
>
>However, you don't import the procedure from a DLL - see Peter's e-mail below.
>
>Tomas
>
>
>  
>
>>Peter Vreman wrote:
>>
>>    
>>
>>>>-------------------------------------------------------------
>>>>...
>>>>implementation
>>>>
>>>>{$LINK dfc.ow}   //GCC object file style
>>>>
>>>>procedure dfCrap(setoperation: Tso); cdecl; external;
>>>>...
>>>>-------------------------------------------------------------
>>>>
>>>>Hi!
>>>>The lines above do compile and work fine under previous versions of FPC.
>>>>With the latest version of FPC I got the following error message:
>>>>
>>>>Free Pascal Compiler version 1.9.5 [2004/11/24] for i386
>>>>dfTools.pas(107,11) Error: Can't declare procedure as EXTERNAL
>>>>
>>>>Has there something changed?
>>>>   
>>>>
>>>>        
>>>>
>>>Yes, there is also a declaration in the interface. You can't declare a
>>>procedure external in the implementation anymore when the interface says
>>>that is needs to have a body. There is an exception for win32 and os/2
>>>regarding to DLL imports.
>>>      
>>>
>
>
>_______________________________________________
>fpc-devel maillist  -  fpc-devel at lists.freepascal.org
>http://lists.freepascal.org/mailman/listinfo/fpc-devel
>
>
>  
>




More information about the fpc-devel mailing list