Sign in Join

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

Mailing lists / lazarus / 2003-12

Libc.ErrNo and TControl.DoMouseWheel

9 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Unknown author
to Den Jean: I am porting code from Kylix to Lazarus and I have a few questions: 1) ErrNo from Libc…
Den Jean wrote 11 lines
Hi, Libc.ErrNo: thanks alot for the very quick response. I see the change in the new fpc cvs. 1) But lazarus won't run anymore if compiled with this fpc. It stalls at startup. If however I compile it with fpc-1.9.1-031129.i386.rpm, it works fine.

Strange, the version of FPC should not matter in this ?

Show quoted text 10 lines
2) I also tried compiling fpc with a {$define LIBC_OLDERRNO} added at the top of unit libc. But then fpc does not compile : ppc386 -XX -CX -Xs -OG2p3 -n -Fu/other/storage/rpms/lazarus/cvs/fpc/rtl/linux -Fl/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.1 -Fl/usr/X11R6/lib -Fl/usr/lib/qt3/lib -di386 -dRELEASE libc.pp errno.inc(4,16) Error: overloaded identifier "errno" isn't a function libc.pp(255) Fatal: There were 1 errors compiling module, stopping

Fixed, an omission on my part.

Michael.

Reply by email

Marc Weustink
to Den Jean: I am porting code from Kylix to Lazarus and I have a few questions: 1) ErrNo from Libc…
Den Jean wrote 16 lines
Hi, I am porting code from Kylix to Lazarus and I have a few questions: 1) ErrNo from Libc does not compile eg uses Libc; writeln(Libc.ErrNo) gives error messages: undefined reference to `errno' Error:Error while linking But if you click on ErrNo it shows its definition in Libc I use it after call to setsockopt

If it is defined in the libc unit it doesn't mean that it can linked (it has to be in the libc library aswell)
But that's probably not the case here. IIRC, erno is a var and there was something with exported vars and libraries

Show quoted text 9 lines
2) I use the mousewheel for zoom, but I cannot find the corresponding procedure function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; const MousePos: TPoint): Boolean; dynamic; How do you add MouseWheel support to a TPaintBox ?

There is no mousewheel support yet.

Marc

Reply by email

Den Jean

Hi,

I am porting code from Kylix to Lazarus
and I have a few questions:

1) ErrNo from Libc does not compile

    eg uses Libc;
         writeln(Libc.ErrNo)
    gives error messages:
    undefined reference to `errno'
    Error:Error while linking
   But if you click on ErrNo it shows its definition in Libc
   I use it after call to setsockopt

2) I use the mousewheel for zoom, but I cannot
find the corresponding procedure

    function DoMouseWheel(Shift: TShiftState;
                                            WheelDelta: Integer;
                                            const         MousePos: TPoint):
                                             Boolean; dynamic;
     How do you add MouseWheel support to a TPaintBox ?

Ps : I use fpc-1.9.1-031129.i386.rpm, Lazarus CVS (today) on Mandrake 9.2

regards
thx already and All the best for 2004.

Den Jean

Reply by email

Unknown author
to Den Jean
Marc Weustink wrote 22 lines
At 08:29 31-12-2003, Den Jean wrote: >Hi, > >I am porting code from Kylix to Lazarus >and I have a few questions: > >1) ErrNo from Libc does not compile > > eg uses Libc; > writeln(Libc.ErrNo) > > gives error messages: > undefined reference to `errno' > Error:Error while linking > > But if you click on ErrNo it shows its definition in Libc > I use it after call to setsockopt If it is defined in the libc unit it doesn't mean that it can linked (it has to be in the libc library aswell) But that's probably not the case here. IIRC, erno is a var and there was something with exported vars and libraries

The point is that glibc no longer exports the libc 'errno' variable on newer systems. This has broken many C programs, and is also completely incompatible with the libc units. I have fixed the units (see cvs) but this means that those units can no longer be used by default on old systems.

Here is the explanation I put in the README file that accompagnies the Libc unit:

----------------------------------------------------------------------- Note on the Libc errno variable. On recent systems the errno symbol is no longer published in libc. It has been replaced by a __errno_location pointer, with a macro in the C header files to mask this. The pascal Libc files assume this by default. This also means you cannot set the errno value directly, you must use the 'seterrno' procedure for that. (see errno.inc)

The old mechanism of a published errno libc variable is still available by setting the LIBC_OLDERRNO define when compiling the libc units. -----------------------------------------------------------------------

At a later stage we can maybe try to detect .

Reply by email

Den Jean
to Den Jean: I am porting code from Kylix to Lazarus and I have a few questions: 1) ErrNo from Libc…

Hi,

Libc.ErrNo:

thanks alot for the very quick response.
I see the change in the new fpc cvs.

1) But lazarus won't run anymore if compiled
with this fpc. It however I compile it with
fpc-1.9.1-031129.i386.rpm, it works fine.

2) I also tried compiling fpc with a
{$define LIBC_OLDERRNO} added at the top of
unit libc.
But then fpc does not compile :
ppc386 -XX -CX -Xs -OG2p3 -n -Fu/other/storage/rpms/lazarus/cvs/fpc/rtl/linux -Fl/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.1 -Fl/usr/X11R6/lib -Fl/usr/lib/qt3/lib -di386 -dRELEASE libc.pp
errno.inc(4,16) Error: overloaded identifier "errno" isn't a function libc.pp(255) Fatal: There were 1 errors compiling module, stopping

kind regards and CU next year

Den Jean

Show quoted text 52 lines
On Wed, 31 Dec 2003, Marc Weustink wrote: > At 08:29 31-12-2003, Den Jean wrote: > >Hi, > > > >I am porting code from Kylix to Lazarus > >and I have a few questions: > > > >1) ErrNo from Libc does not compile > > > > eg uses Libc; > > writeln(Libc.ErrNo) > > > > gives error messages: > > undefined reference to `errno' > > Error:Error while linking > > > > But if you click on ErrNo it shows its definition in Libc > > I use it after call to setsockopt > > If it is defined in the libc unit it doesn't mean that it can linked (it > has to be in the libc library aswell) > But that's probably not the case here. IIRC, erno is a var and there was > something with exported vars and libraries The point is that glibc no longer exports the libc 'errno' variable on newer systems. This has broken many C programs, and is also completely incompatible with the libc units. I have fixed the units (see cvs) but this means that those units can no longer be used by default on old systems. Here is the explanation I put in the README file that accompagnies the Libc unit: ----------------------------------------------------------------------- Note on the Libc errno variable. On recent systems the errno symbol is no longer published in libc. It has been replaced by a __errno_location pointer, with a macro in the C header files to mask this. The pascal Libc files assume this by default. This also means you cannot set the errno value directly, you must use the 'seterrno' procedure for that. (see errno.inc) The old mechanism of a published errno libc variable is still available by setting the LIBC_OLDERRNO define when compiling the libc units. ----------------------------------------------------------------------- At a later stage we can maybe try to detect it at run-time. Michael. _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email

Den Jean
to Den Jean: I am porting code from Kylix to Lazarus and I have a few questions: 1) ErrNo from Libc…
Marc Weustink wrote
Yep, this was a bug in fpc/rtl/linux/unixsysc.inc it is fixed an hour ago.

great, lazarus works now (thx for the fix faster than light)

but my program does not compile now with CVS fpc
it does with fpc-1.9.1-031129.i386.rpm
I get the message : foo.pas(2248,26) Fatal:Internal error 200212141

A grep reveal that this error is raised in ./compiler/ncal.pas

I will try make a small program that still reproduces the problem and provide that.

kind regards,

Den Jean

Reply by email

Marc Weustink
to Den Jean: I am porting code from Kylix to Lazarus and I have a few questions: 1) ErrNo from Libc…
Den Jean wrote 5 lines
Hi, since a couple of days Lazarus stalls at startup if compiled with CVS FPC (it does not stall if compiled with fpc-1.9.1-031129.i386.rpm) (I use Lazarus on Mandrake 9.2)

Yep, this was a bug in fpc/rtl/linux/unixsysc.inc
it is fixed an hour ago.

Marc

Show quoted text 5 lines
BTW 'l' (list) doesn't work there for some reason, in main.pp it still worked could someone tell me what to say to gdb so gdb always knows the sourcefiles for debugging a typical lazarus cvs dir lay-out

Compile the fpc sources with OPT=-g

then it has debuginfo

Reply by email

Marc Weustink
to Den Jean: I am porting code from Kylix to Lazarus and I have a few questions: 1) ErrNo from Libc…
Den Jean wrote 6 lines
On Friday 02 January 2004 07:27 pm, Marc Weustink wrote: > Yep, this was a bug in fpc/rtl/linux/unixsysc.inc > it is fixed an hour ago. > great, lazarus works now (thx for the fix faster than light)

To be honest, it wasn't me who fixed it. I ran into it yesterday. When you wrote it, Marco V had just fixed it.

Show quoted text 8 lines
but my program does not compile now with CVS fpc it does with fpc-1.9.1-031129.i386.rpm I get the message : foo.pas(2248,26) Fatal:Internal error 200212141 A grep reveal that this error is raised in ./compiler/ncal.pas I will try make a small program that still reproduces the problem and provide that.

I'm runnig a CVS version from yesterday with only the file updated I mentioned.

Marc

Reply by email

Den Jean
to Den Jean: I am porting code from Kylix to Lazarus and I have a few questions: 1) ErrNo from Libc…

Hi,

since a couple of days Lazarus stalls at startup if compiled with CVS FPC (it does not stall if compiled with fpc-1.9.1-031129.i386.rpm) (I use Lazarus on Mandrake 9.2)

gdb learned me that Lazarus stalls at
line 2758 of definetemplates.pas (TheProcess.WaitOnExit;)

if I compile Lazarus with fpc-1.9.1-031129.i386.rpm it just runs fine

fpc CVS was compiled/installed this way:
cd cvs/fpc
make clean
make all
make install

fpc-1.9.1-031129 was installed this way:
urpme fpc-1.9.1-031129.i386
urpmi fpc-1.9.1-031129.i386.rpm

and debugging with gdb:
//new for me, so give me a break,
//long live integrated debugging since TP 3 :-)

gdb
set args --no-splash-screen
b TMAINIDE__INITCODETOOLBOSS
r
... did 'n' till ...
the line ADefTempl:=CreateFPCTemplate(EnvironmentOptions.CompilerFilename,'',

then step into ('s')
and 's' till line 2758, there it stops (TheProcess.WaitOnExit)

BTW 'l' (list) doesn't work there for some reason, in main.pp it still worked
could someone tell me what to say to gdb
so gdb always knows the sourcefiles for debugging a typical lazarus cvs dir lay-out

kind regards,

Den Jean

Show quoted text 34 lines
On Wed, 31 Dec 2003, Den Jean wrote: > Hi, > > Libc.ErrNo: > > thanks alot for the very quick response. > I see the change in the new fpc cvs. > > 1) But lazarus won't run anymore if compiled > with this fpc. It stalls at startup. > If however I compile it with > fpc-1.9.1-031129.i386.rpm, it works fine. Strange, the version of FPC should not matter in this ? > 2) I also tried compiling fpc with a > {$define LIBC_OLDERRNO} added at the top of > unit libc. > But then fpc does not compile : > ppc386 -XX -CX -Xs -OG2p3 -n > -Fu/other/storage/rpms/lazarus/cvs/fpc/rtl/linux > -Fl/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.1 -Fl/usr/X11R6/lib > -Fl/usr/lib/qt3/lib -di386 -dRELEASE libc.pp > errno.inc(4,16) Error: overloaded identifier "errno" isn't a function > libc.pp(255) Fatal: There were 1 errors compiling module, stopping Fixed, an omission on my part. Michael. _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email