Compiling GMP with Free Pascal

Ben Aguayo info at
Wed Jul 21 20:35:12 CEST 2004

> > I'm trying to import the GMP.PAS unit, having installed and set the
> > paths to the library, but the compiler shows this error message:
> Where did you get GMP.PAS from? AFAIK all that is available is a unit  
> written for gpc, which is not compatible with fpc.
> > module/unit interface `gmp' could not be imported
> If I can take a look at the source perhaps I can help. If you can  
> provide a pointer (URL) to the GMP.PAS unit I can download and examine  
> it and help with troubleshooting.
> > I'm new both to GMP and Free Pascal (I'm used to work with Delphi)  
> > and
> > I woul really appreciate if some of you can give me some tip about  
> > how
> > to set GMP to work with
> > FreePascal.
> FreePascal comes with an automated h2pas program for converting *.h  
> files into *.pp or *.pas files. Maybe it's handy in this case. I wonder  
> how well it will cope with gmp.h subtleties.

Thank you for taking the time to read and answer my post.

I tried h2pas  but without good results, may be the haders are too complex for the program or I did a mistake.

I'm using Dev+GNU Pascal from Bloodshed software.
They include a gmp.pas unit, you can see it at:

What is not clear to me is how to compile the program (under Windows) including such library.
I also just found a program from the GMP.PAS author at:

Still searching and testing. If I find some way to do what I need (use GMP from Free Pascal or Delphi) I will let all you know.

Ben Aguayo

More information about the gmp-discuss mailing list