[fpc-devel] re: using generated obj files with vs or gcc in fpc?
    Daniël Mantione 
    daniel.mantione at freepascal.org
       
    Sun Mar 11 09:16:48 CET 2007
    
    
  
Op Sun, 11 Mar 2007, schreef Roozbeh GHolizadeh:
> Well everything is now ok,but in my .c source i've
> used 'toupper' function,
> now when i try to declare it in my pascal file like
> 
> function toupper(ch : integer):integer;cdecl;
> 
> still i get undefined symbol toupper error from
> compiler.
> i guess there is a problem in linker,ie you cant use
> external pascal functions in c sources.
The problem is the name mangling. Try to declare it like:
function toupper(ch : integer):integer;cdecl;external name 'toupper';
... if the external name is 'toupper'. It might also be '_toupper'. You 
can check this with objdump.
Daniël
    
    
More information about the fpc-devel
mailing list