Any help with a gcc command line?

Fergus Daly fergusd84@outlook.com
Sun Jul 13 08:10:26 GMT 2025


Sorry - this is very person- rather than Cygwin-specific, but any insight would be greatly appreciated.
In Cygwin and for many years I have compiled an executable myx.exe from source and then re-compiled it
as the need arises when revised or new {source}/*.c occur.
After creating the archive myx0.a the key gcc command line is
$ gcc -w -static -o myx -O3 ./myx0.a -lreadline -lncurses -lm
This worked flawlessly up to and including readline-8.1.2 but failed with 8.2.2 and this week's latest update to 8.3.1.
To get the compilation to work it is (thank Goodness) not necessary to revert entirely to 8.1.2. I simply
temporarily utilise the single previous file /lib/libreadline.a and then recover the current version. So the key
command now reads (3 lines not 1)
$ cp -v /lib/libreadline.8.1.2.a /lib/libreadline.a            # grab the old working file                  
$ gcc -w -static -o sc -O3 ./clib.a -lreadline -lncurses -lm  # i.e. UNCHANGED
$ cp -v /lib/libreadline.8.3.1.a /lib/libreadline.a            # recover the current file
But I don't much like messing about within /lib/ and would like to avoid this intrusion if I can.
I realise the switch -lreadline at line 2 is shorthand for a multitude of activity that presumably
incorporates much of 8.3.1 as well as the altered libreadline.a.
Is there an edit to -lreadline in line 2 (e.g. -Lsomething - u.c.L??) that would omit the need for lines 1
and 3 but achieve the temporary (and invisible) utilisation of libreadline.8.1.2.a as libreadline.a without messing with /lib/?
Thank you for any assistance and I acknowledge this request might be boomerang-ed.
Fergus


More information about the Cygwin mailing list

AltStyle によって変換されたページ (->オリジナル) /