Lazarus

Using the Lazarus IDE => Options => Topic started by: Charels on July 15, 2005, 04:03:17 am

Title: help:: what is the size of integer????
Post by: Charels on July 15, 2005, 04:03:17 am
I've installed the Lazarus 0.9.6 on a newly installed Red Hat.
I thought it was wrapped with fpc-1.9.8,
but I installed fpc-1.9.8 again.
I wrote a unit whose variables were all integers, and if I compiled
it under Emacs or shell while compiling another main
program, whose variables were also all declared integers,
 in Lazarus, I got an fatal error "Got 'Longint' but expected 'Smallint'".
If I changed all the integer into smallint in the main program
or click Build all, then I could get the 'successfully built' message.

I wonder why the sizeof integer in FPC and that in Lazarus integrated FPC
are different. How I can deal with them, I mean make them portable
Title: help:: what is the size of integer????
Post by: Marc on July 15, 2005, 10:59:01 am
If you use plain fpc, without specifying which mode it should use to compile a unit, it builds it in the fpc original mode. In that mode an integer is 16 bits. All Lazaus units define {$mode objfpc} in that mode integers are 32 bits (this also counts if you compile in delphi mode {$mode delphi})
TinyPortal © 2005-2018