strange -fPIC compilation error
Charles Hixson via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Nov 1 12:44:00 PDT 2016
On 11/01/2016 10:34 AM, bachmeier via Digitalmars-d-learn wrote:
> On Tuesday, 1 November 2016 at 17:23:54 UTC, Charles Hixson wrote:
>> On 11/01/2016 12:52 AM, Nordlöw via Digitalmars-d-learn wrote:
>>> On Tuesday, 1 November 2016 at 07:15:19 UTC, Mike Parker wrote:
>>>>> but
>>>>> dmd -defaultlib=libphobos2.so -fPIC test.d
>>>>> works. It shouldn't be required (as in the default /etc/dmd.conf
>>>>> should handle it correctly, but I can deal with it now.
>>>
>>> Can this be fed as parameters to the DMD call (programmatically)
>>> instead of manual editing of dmd.conf?
>>>
>> I did feed it into the dmd call programmatically. Thus:
>> dmd -defaultlib=libphobos2.so -fPIC test.d
>>
>> I'm reluctant to edit the dmd.conf file as I don't really understand
>> the syntax...and I have to be root to do the editing.
>
> https://dlang.org/dmd-linux.html#dmd-conf
>
> You can copy dmd.conf to the current working directory and try out
> changes there. That will only affect the current program. Then you can
> move it to your home directory.
>
I'll probably do that eventually...but for now I'm just pasting a
comment at the start of each file that tells how to compile it, e.g.:
//ldc2 -Dddocs -c msg.d <<-- no documentation generated
//dmd -Dddocs -c msg.d
//rdmd -main -Dddocs -unittest -defaultlib=libphobos2.so -fPIC msg.d
More information about the Digitalmars-d-learn
mailing list