Hey Y'All,
So, in my quest to suss out why my
ncurses programs, when compiled under Lazarus, were misbehaving I
FINALLY got it down to one thing:
The
-Cg or
Generate PIC code is hardcoded in the options and cannot be removed!!!

I then had a nose around the project options and I found quite the issue!!!
This is what I get when I press the "Show Options" button under Project Options->Compiler Options->Custom Options:
/home/gcarreno/FreePascal/fpc/bin/x86_64-linux/fpc.sh
-MObjFPC
-Scghi
-Cg
-O1
-gw3
-gl
-l
-vewnhibq
-Fi../../bin/lib/x86_64-linux
-Fu../../src/application
-Fu../../src/forms
-Fu../../src/base
-Fuforms
-Fu../../src/messages
-Fu../../src/components
-Fu.
-FU../../bin/lib/x86_64-linux
-FE../../bin
-o../../bin/oneform
-FcUTF8
Now, if I press the the "All Options" button on the same thing, a dialog with all the options is shown with appropriate check-boxes and drop-downs for all the options.
I scroll down to find the
-Cg option, and to my utmost confusion, it's check-box is
NOT SELECTED.
I then select that check-box to add the
-Cg option.
Now the contents of the "Show Options" button, looks like this:
/home/gcarreno/FreePascal/fpc/bin/x86_64-linux/fpc.sh
-MObjFPC
-Scghi
-Cg
-O1
-gw3
-gl
-l
-vewnhibq
-Fi../../bin/lib/x86_64-linux
-Fu../../src/application
-Fu../../src/forms
-Fu../../src/base
-Fuforms
-Fu../../src/messages
-Fu../../src/components
-Fu.
-FU../../bin/lib/x86_64-linux
-FE../../bin
-o../../bin/oneform
-FcUTF8
-Cg
Do you see my confusion?!?!? There are now 2,
TWO entries on that dialog that contain
-Cg.
And if I deselect the
-Cg check-box, we revert to the first example!!!
So... My question is:
Why is
-Cg being hardcoded ??
Especially when there's an entry on the "All Options" dialog that is
NOT SELECTED!!!
This makes no sense at all and it's giving a huge pain in the tuchus on my
ncurses projects!!!
Can someone please explain why this has been done this way?
I'm quite sorry if I'm coming out a bit unhinged, but this has been a thorn in my brain for the past 3 days, and now that I know what's the issue, it's even more frustrating !!!
I apologise in advance if my anger is coming through and I'm being a bit disrespectful!!

Cheers,
Gus