[fpc-devel] re: using generated obj files with vs or gcc in fpc?

Evgeniy Ivanov lolkaantimat at gmail.com
Sun Mar 11 18:24:22 CET 2007


On Sun, 11 Mar 2007 20:17:49 +0300, Roozbeh GHolizadeh  
<roozbehid at yahoo.com> wrote:

>>> 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=EBl
>
> Well actually my problem is c object files use toupper
> function and i want to declare it in my pascal file.
> (i know it is very easy to being implemented in c..but
> now just for curusity.)
>
> so declaring external is reverse of what i want to do.
> I also tried with _toupper.didnt work,although i
> turned off underscoring of exporting function in c
> compiler.
>
> also tobjdump says unknown file.i cant dump c compiler
> generated .obj files.
>

I didn't read any mails before this, but I have some experience with C  
obj. files (.o generated with gcc --> fpc).
I don't remember what I've been doing a half year ago (the way is not like  
today), but smth was with _NAME. I think it is gpc style.
About "true method" you may read in  
ftp://ftp.freepascal.org/pub/fpc/docs-pdf/CinFreePascal.pdf
And I saw some information in fpc docs.



-- 
Best regards
E.I.



More information about the fpc-devel mailing list