Jump to page: 1 2
Thread overview
gdc phobos and druntime automatic import
Mar 14, 2013
Benjamin Thaut
Mar 15, 2013
Iain Buclaw
Mar 15, 2013
Iain Buclaw
Mar 15, 2013
Benjamin Thaut
Mar 15, 2013
Iain Buclaw
Mar 15, 2013
Benjamin Thaut
Mar 15, 2013
Iain Buclaw
Mar 15, 2013
Iain Buclaw
Mar 15, 2013
Benjamin Thaut
Mar 15, 2013
Iain Buclaw
Mar 15, 2013
Benjamin Thaut
Mar 15, 2013
Iain Buclaw
Mar 15, 2013
Benjamin Thaut
Mar 15, 2013
Daniel Green
Mar 15, 2013
Benjamin Thaut
Mar 15, 2013
Johannes Pfau
March 14, 2013
I want to use a different version of druntime and phobos with GDC but I don't want to overwrite the default ones. Instead I want to specifiy a different include directory during compile time. I first thought that -nostdinc is the option I want, but -nostdinc seems to do something different. How does GDC know where to import druntime and phobos from, and how do I overwrite it?

Kind Regards
Benjamin Thaut
March 15, 2013
On 14 March 2013 19:05, Benjamin Thaut <code@benjamin-thaut.de> wrote:

> I want to use a different version of druntime and phobos with GDC but I don't want to overwrite the default ones. Instead I want to specifiy a different include directory during compile time. I first thought that -nostdinc is the option I want, but -nostdinc seems to do something different. How does GDC know where to import druntime and phobos from, and how do I overwrite it?
>
> Kind Regards
> Benjamin Thaut
>


The library is installed in /usr/lib,  which is part of the LIBRARY_PATH. The static library itself is a combination of druntime and phobos together, not separate at the moment.  To specify a different standard library, use -defaultlib switch.


-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


March 15, 2013
On 15 March 2013 10:03, Iain Buclaw <ibuclaw@ubuntu.com> wrote:

> On 14 March 2013 19:05, Benjamin Thaut <code@benjamin-thaut.de> wrote:
>
>> I want to use a different version of druntime and phobos with GDC but I don't want to overwrite the default ones. Instead I want to specifiy a different include directory during compile time. I first thought that -nostdinc is the option I want, but -nostdinc seems to do something different. How does GDC know where to import druntime and phobos from, and how do I overwrite it?
>>
>> Kind Regards
>> Benjamin Thaut
>>
>
>
> The library is installed in /usr/lib,  which is part of the
> LIBRARY_PATH.   The static library itself is a combination of druntime and
> phobos together, not separate at the moment.  To specify a different
> standard library, use -defaultlib switch.
>
>

Will also make mention that druntime is installed in /usr/lib too (
-lgdruntime )



-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


March 15, 2013
Am 15.03.2013 11:05, schrieb Iain Buclaw:
> On 15 March 2013 10:03, Iain Buclaw <ibuclaw@ubuntu.com
> <mailto:ibuclaw@ubuntu.com>> wrote:
>
>     On 14 March 2013 19:05, Benjamin Thaut <code@benjamin-thaut.de
>     <mailto:code@benjamin-thaut.de>> wrote:
>
>         I want to use a different version of druntime and phobos with
>         GDC but I don't want to overwrite the default ones. Instead I
>         want to specifiy a different include directory during compile
>         time. I first thought that -nostdinc is the option I want, but
>         -nostdinc seems to do something different. How does GDC know
>         where to import druntime and phobos from, and how do I overwrite it?
>
>         Kind Regards
>         Benjamin Thaut
>
>
>
>     The library is installed in /usr/lib,  which is part of the
>     LIBRARY_PATH.   The static library itself is a combination of
>     druntime and phobos together, not separate at the moment.  To
>     specify a different standard library, use -defaultlib switch.
>
>
>
> Will also make mention that druntime is installed in /usr/lib too (
> -lgdruntime )
>
>
>
> --
> Iain Buclaw
>
> *(p < e ? p++ : p) = (c & 0x0f) + '0';

Well I don't want to overwrite the existing version of druntime and phobos. I want to be ablte to specifiy via a compiler option to use a different version of them. In some projects I use the original druntime + phobos and in other projects I use my custom version. With dmd this is possible via a custom sc.ini file. So is there a option to just remove druntime/phobos from LIBRARY_PATH? (and keep everything else)

Kind Regards
Benjamin Thaut
March 15, 2013
On 15 March 2013 12:01, Benjamin Thaut <code@benjamin-thaut.de> wrote:

>
> Well I don't want to overwrite the existing version of druntime and phobos. I want to be ablte to specifiy via a compiler option to use a different version of them. In some projects I use the original druntime + phobos and in other projects I use my custom version. With dmd this is possible via a custom sc.ini file. So is there a option to just remove druntime/phobos from LIBRARY_PATH? (and keep everything else)
>
> Kind Regards
> Benjamin Thaut
>

You didn't seem to read my first message. :)

On 15 March 2013 10:03, Iain Buclaw <ibuclaw@ubuntu.com <mailto:ibuclaw@ubuntu.com>> wrote:

    The library is installed in /usr/lib,  which is part of the
    LIBRARY_PATH.   The static library itself is a combination of
    druntime and phobos together, not separate at the moment.  To
    specify a different standard library, use -defaultlib switch.



-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


March 15, 2013
Am 15.03.2013 13:26, schrieb Iain Buclaw:
> On 15 March 2013 12:01, Benjamin Thaut <code@benjamin-thaut.de
> <mailto:code@benjamin-thaut.de>> wrote:
>
>
>     Well I don't want to overwrite the existing version of druntime and
>     phobos. I want to be ablte to specifiy via a compiler option to use
>     a different version of them. In some projects I use the original
>     druntime + phobos and in other projects I use my custom version.
>     With dmd this is possible via a custom sc.ini file. So is there a
>     option to just remove druntime/phobos from LIBRARY_PATH? (and keep
>     everything else)
>
>     Kind Regards
>     Benjamin Thaut
>
>
> You didn't seem to read my first message. :)
>
> On 15 March 2013 10:03, Iain Buclaw <ibuclaw@ubuntu.com
> <mailto:ibuclaw@ubuntu.com>
> <mailto:ibuclaw@ubuntu.com <mailto:ibuclaw@ubuntu.com>>> wrote:
>
>      The library is installed in /usr/lib,  which is part of the
>      LIBRARY_PATH.   The static library itself is a combination of
>      druntime and phobos together, not separate at the moment.  To
>      specify a different standard library, use -defaultlib switch.
>
>
>
> --
> Iain Buclaw
>
> *(p < e ? p++ : p) = (c & 0x0f) + '0';

I don't fully understand that statement.
So the -defaultlib switch gives the location for the import files .di/.d and not for the actual library (.a) ?

Kind Regards
Benjamin Thaut
March 15, 2013
On 15 March 2013 13:05, Benjamin Thaut <code@benjamin-thaut.de> wrote:

> Am 15.03.2013 13:26, schrieb Iain Buclaw:
>
>> On 15 March 2013 12:01, Benjamin Thaut <code@benjamin-thaut.de
>>
>> <mailto:code@benjamin-thaut.de**>> wrote:
>>
>>
>>     Well I don't want to overwrite the existing version of druntime and
>>     phobos. I want to be ablte to specifiy via a compiler option to use
>>     a different version of them. In some projects I use the original
>>     druntime + phobos and in other projects I use my custom version.
>>     With dmd this is possible via a custom sc.ini file. So is there a
>>     option to just remove druntime/phobos from LIBRARY_PATH? (and keep
>>     everything else)
>>
>>     Kind Regards
>>     Benjamin Thaut
>>
>>
>> You didn't seem to read my first message. :)
>>
>> On 15 March 2013 10:03, Iain Buclaw <ibuclaw@ubuntu.com
>> <mailto:ibuclaw@ubuntu.com>
>> <mailto:ibuclaw@ubuntu.com <mailto:ibuclaw@ubuntu.com>>> wrote:
>>
>>      The library is installed in /usr/lib,  which is part of the
>>      LIBRARY_PATH.   The static library itself is a combination of
>>      druntime and phobos together, not separate at the moment.  To
>>      specify a different standard library, use -defaultlib switch.
>>
>>
>>
>> --
>> Iain Buclaw
>>
>> *(p < e ? p++ : p) = (c & 0x0f) + '0';
>>
>
> I don't fully understand that statement.
> So the -defaultlib switch gives the location for the import files .di/.d
> and not for the actual library (.a) ?
>
>
No,  that's -I and -J


-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


March 15, 2013
On 15 March 2013 13:18, Iain Buclaw <ibuclaw@ubuntu.com> wrote:

> On 15 March 2013 13:05, Benjamin Thaut <code@benjamin-thaut.de> wrote:
>
>> Am 15.03.2013 13:26, schrieb Iain Buclaw:
>>
>>> On 15 March 2013 12:01, Benjamin Thaut <code@benjamin-thaut.de
>>>
>>> <mailto:code@benjamin-thaut.de**>> wrote:
>>>
>>>
>>>     Well I don't want to overwrite the existing version of druntime and
>>>     phobos. I want to be ablte to specifiy via a compiler option to use
>>>     a different version of them. In some projects I use the original
>>>     druntime + phobos and in other projects I use my custom version.
>>>     With dmd this is possible via a custom sc.ini file. So is there a
>>>     option to just remove druntime/phobos from LIBRARY_PATH? (and keep
>>>     everything else)
>>>
>>>     Kind Regards
>>>     Benjamin Thaut
>>>
>>>
>>> You didn't seem to read my first message. :)
>>>
>>> On 15 March 2013 10:03, Iain Buclaw <ibuclaw@ubuntu.com
>>> <mailto:ibuclaw@ubuntu.com>
>>> <mailto:ibuclaw@ubuntu.com <mailto:ibuclaw@ubuntu.com>>> wrote:
>>>
>>>      The library is installed in /usr/lib,  which is part of the
>>>      LIBRARY_PATH.   The static library itself is a combination of
>>>      druntime and phobos together, not separate at the moment.  To
>>>      specify a different standard library, use -defaultlib switch.
>>>
>>>
>>>
>>> --
>>> Iain Buclaw
>>>
>>> *(p < e ? p++ : p) = (c & 0x0f) + '0';
>>>
>>
>> I don't fully understand that statement.
>> So the -defaultlib switch gives the location for the import files .di/.d
>> and not for the actual library (.a) ?
>>
>>
> No,  that's -I and -J
>
>

Use case:

gdc foo.d -defaultlib tango2


This will invoke the driver to add -ltango2 to the linker options, instead of -lgphobos2

Regards
-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


March 15, 2013
Am 15.03.2013 14:20, schrieb Iain Buclaw:
> On 15 March 2013 13:18, Iain Buclaw <ibuclaw@ubuntu.com
> <mailto:ibuclaw@ubuntu.com>> wrote:
>
>     On 15 March 2013 13:05, Benjamin Thaut <code@benjamin-thaut.de
>     <mailto:code@benjamin-thaut.de>> wrote:
>
>         Am 15.03.2013 13:26, schrieb Iain Buclaw:
>
>             On 15 March 2013 12:01, Benjamin Thaut
>             <code@benjamin-thaut.de <mailto:code@benjamin-thaut.de>
>
>             <mailto:code@benjamin-thaut.de
>             <mailto:code@benjamin-thaut.de>__>> wrote:
>
>
>                  Well I don't want to overwrite the existing version of
>             druntime and
>                  phobos. I want to be ablte to specifiy via a compiler
>             option to use
>                  a different version of them. In some projects I use the
>             original
>                  druntime + phobos and in other projects I use my custom
>             version.
>                  With dmd this is possible via a custom sc.ini file. So
>             is there a
>                  option to just remove druntime/phobos from
>             LIBRARY_PATH? (and keep
>                  everything else)
>
>                  Kind Regards
>                  Benjamin Thaut
>
>
>             You didn't seem to read my first message. :)
>
>             On 15 March 2013 10:03, Iain Buclaw <ibuclaw@ubuntu.com
>             <mailto:ibuclaw@ubuntu.com>
>             <mailto:ibuclaw@ubuntu.com <mailto:ibuclaw@ubuntu.com>>
>             <mailto:ibuclaw@ubuntu.com <mailto:ibuclaw@ubuntu.com>
>             <mailto:ibuclaw@ubuntu.com <mailto:ibuclaw@ubuntu.com>>>> wrote:
>
>                   The library is installed in /usr/lib,  which is part
>             of the
>                   LIBRARY_PATH.   The static library itself is a
>             combination of
>                   druntime and phobos together, not separate at the
>             moment.  To
>                   specify a different standard library, use -defaultlib
>             switch.
>
>
>
>             --
>             Iain Buclaw
>
>             *(p < e ? p++ : p) = (c & 0x0f) + '0';
>
>
>         I don't fully understand that statement.
>         So the -defaultlib switch gives the location for the import
>         files .di/.d and not for the actual library (.a) ?
>
>
>     No,  that's -I and -J
>
>
>
> Use case:
>
> gdc foo.d -defaultlib tango2
>
>
> This will invoke the driver to add -ltango2 to the linker options,
> instead of -lgphobos2
>
> Regards
> --
> Iain Buclaw
>
> *(p < e ? p++ : p) = (c & 0x0f) + '0';

Well but I'm not talking about the linker. If I do

import std.stdio;

I want to have a error message that std.stdio does not exist.

Kind Regards
Benjamin Thaut
March 15, 2013
On 15 March 2013 14:06, Benjamin Thaut <code@benjamin-thaut.de> wrote:

> Am 15.03.2013 14:20, schrieb Iain Buclaw:
>
>> On 15 March 2013 13:18, Iain Buclaw <ibuclaw@ubuntu.com
>>
>> <mailto:ibuclaw@ubuntu.com>> wrote:
>>
>>     On 15 March 2013 13:05, Benjamin Thaut <code@benjamin-thaut.de
>>     <mailto:code@benjamin-thaut.de**>> wrote:
>>
>>         Am 15.03.2013 13:26, schrieb Iain Buclaw:
>>
>>             On 15 March 2013 12:01, Benjamin Thaut
>>             <code@benjamin-thaut.de <mailto:code@benjamin-thaut.de**>
>>
>>             <mailto:code@benjamin-thaut.de
>>
>>             <mailto:code@benjamin-thaut.de**>__>> wrote:
>>
>>
>>                  Well I don't want to overwrite the existing version of
>>             druntime and
>>                  phobos. I want to be ablte to specifiy via a compiler
>>             option to use
>>                  a different version of them. In some projects I use the
>>             original
>>                  druntime + phobos and in other projects I use my custom
>>             version.
>>                  With dmd this is possible via a custom sc.ini file. So
>>             is there a
>>                  option to just remove druntime/phobos from
>>             LIBRARY_PATH? (and keep
>>                  everything else)
>>
>>                  Kind Regards
>>                  Benjamin Thaut
>>
>>
>>             You didn't seem to read my first message. :)
>>
>>             On 15 March 2013 10:03, Iain Buclaw <ibuclaw@ubuntu.com
>>             <mailto:ibuclaw@ubuntu.com>
>>             <mailto:ibuclaw@ubuntu.com <mailto:ibuclaw@ubuntu.com>>
>>             <mailto:ibuclaw@ubuntu.com <mailto:ibuclaw@ubuntu.com>
>>             <mailto:ibuclaw@ubuntu.com <mailto:ibuclaw@ubuntu.com>>>>
>> wrote:
>>
>>                   The library is installed in /usr/lib,  which is part
>>             of the
>>                   LIBRARY_PATH.   The static library itself is a
>>             combination of
>>                   druntime and phobos together, not separate at the
>>             moment.  To
>>                   specify a different standard library, use -defaultlib
>>             switch.
>>
>>
>>
>>             --
>>             Iain Buclaw
>>
>>             *(p < e ? p++ : p) = (c & 0x0f) + '0';
>>
>>
>>         I don't fully understand that statement.
>>         So the -defaultlib switch gives the location for the import
>>         files .di/.d and not for the actual library (.a) ?
>>
>>
>>     No,  that's -I and -J
>>
>>
>>
>> Use case:
>>
>> gdc foo.d -defaultlib tango2
>>
>>
>> This will invoke the driver to add -ltango2 to the linker options, instead of -lgphobos2
>>
>> Regards
>> --
>> Iain Buclaw
>>
>> *(p < e ? p++ : p) = (c & 0x0f) + '0';
>>
>
> Well but I'm not talking about the linker. If I do
>
> import std.stdio;
>
> I want to have a error message that std.stdio does not exist.
>
> Kind Regards
> Benjamin Thaut
>


-nostdinc should do that.  Though the first error thrown would be that object.di cannot be found, which is correct behaviour,  you need to specify where the new object.di is using -I


-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';


« First   ‹ Prev
1 2