X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com Date: Mon, 29 Mar 2010 20:38:07 +0300 From: Eli Zaretskii Subject: Re: djgpp/libreadline bug? (cannot use backspace) In-reply-to: <81255c92-b71b-4d8b-871c-fe057d72ddb7@u22g2000yqf.googlegroups.com> X-012-Sender: halo1 AT inter DOT net DOT il To: djgpp AT delorie DOT com Message-id: <834ojz111c.fsf@gnu.org> References: <013d25d6-f34d-4686-9c68-0de775d5bf59 AT t20g2000yqe DOT googlegroups DOT com> <7705c9031003082118y4a617ce4p8e70fcc4e6949c8b AT mail DOT gmail DOT com> <7705c9031003122205u29f3d86dkb94e472d76b6d553 AT mail DOT gmail DOT com> <9dd368da-7195-43ac-ac5b-6560a6a93bed AT k17g2000yqb DOT googlegroups DOT com> <7705c9031003141648k4de53b9cs1bfdc8e709f2f19 AT mail DOT gmail DOT com> <33944e03-8325-4651-9f73-202b4f1202e2 AT z11g2000yqz DOT googlegroups DOT com> <87zl1riozn DOT fsf AT turtle DOT gmx DOT de> <7705c9031003290422w7015bbd6y5e8647aec1ba3f36 AT mail DOT gmail DOT com> <109418c8-c160-4b9f-8e6c-a842da1b7a98 AT k13g2000yqe DOT googlegroups DOT com> <83oci71dhr DOT fsf AT gnu DOT org> <11fa369b-5fab-42ac-805f-1e7e74051411 AT l36g2000yqb DOT googlegroups DOT com> <83fx3j1874 DOT fsf AT gnu DOT org> <81255c92-b71b-4d8b-871c-fe057d72ddb7 AT u22g2000yqf DOT googlegroups DOT com> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: RayeR > Date: Mon, 29 Mar 2010 09:53:30 -0700 (PDT) > Bytes: 2494 > > > You can _use_, i.e., _call_ the same function from many places. But > > ncurses does not _call_ getch etc., it _implements_ them. > > OK understand. And why ncurses cannot use this functions from conio > (libc.a) Probably because they need to use the same infrastructure as other ncurses functions, e.g. so that the cursor position could be tracked. > or name them differently? The names are expected by programs that link against ncurses. > I tried to play with linking order and found that if I link libc first > I got any error and it compiles OK. > [object files] -lc -lreadline -lncurses > And it seems to work for both parts using getch and readline. > Which implementation of getch was used? The one from ncurses, I think. GNU ld is a one-pass linker, so it will not load the functions from libc until it sees some other function that calls them.