Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2002-04

How to use the math unit.

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Sigurd Stordal

I have a program were I use the math unit, but I get a "access violation", and an "unhandled exeption" errors. It's an unit, but when I used the float type, it gives an "identifier not found: Float". Shouldn't it find it when i have a uses math?

I suppose there are some compiler switches I have to use, but I don't know which.

Jonas Maebe
to Sigurd Stordal
Sigurd Stordal wrote
I have a program were I use the math unit, but I get a "access violation", and an "unhandled exeption" errors.

Try compiling your program with the -ghl command line options, then you will get info about where in your program the crash occurs.

It's an unit, but when I used the float type, it gives an "identifier not found: Float". Shouldn't it find it when i have a uses math?

Yes, it should. I've just checked and the float type is indeed declared in the math unit, so I'm not sure why you are getting this error.

I suppose there are some compiler switches I have to use, but I don't know which.

Since the math unit is a Delphi-style unit and uses exceptions, you should use either -Sd (Delphi compatible) or -S2 (ObjPas = FPC-style) and add the "sysutils" unit to your uses clause. Can you maybe post a small example that causes problems? (this always helps if you have a problem and increases the likelyhood of getting (useful) answers)

Jonas