Installation problem

Anders F Björklund afb at algonet.se
Sun Dec 26 07:00:04 PST 2010


Iain Buclaw wrote:
> == Quote from Andrei Alexandrescu (SeeWebsiteForEmail at erdani.org)'s article
>> Anyone has had a similar issue?
>> http://forums.codeblocks.org/index.php?topic=13923.0
>> Andrei
>
> Shouldn't codeblocks be using -lphobos2?

Code::Blocks uses gcc to do the linking, and uses -lphobos (on Unix):

void CompilerDMD::Reset()
{
         m_Programs.C = _T("dmd");
         m_Programs.CPP = _T("dmd");
         m_Programs.LD = _T("gcc");
...
     if (platform::windows)
         libName = _T("phobos.lib");
     else
       libName = _T("phobos");
     AddLinkLib(libName);
...
     if (!platform::windows)
     {
       m_LinkLibs.Add(_("pthread"));
       m_LinkLibs.Add(_("m"));
     }

It should allow a setting like -defaultlib, so that one can override
that to something like "tango-dmd" or "phobos2" instead of "phobos".

Alternatively it could call dmd to do the linking too, just like it
currently does for gdc and for ldc. And have dmd call gcc instead...

void CompilerGDC::Reset()
{
         m_Programs.C = _T("gdc");
         m_Programs.CPP = _T("gdc");
         m_Programs.LD = _T("gdc");

void CompilerLDC::Reset()
{
     m_Programs.C = _T("ldc");
     m_Programs.CPP = _T("ldc");
     m_Programs.LD = _T("ldc");

But the long-term solution would probably be to introduce a "D"
field to the SDK, rather than reusing C/C++ like currently done.


More short-term workaround is just do a symlink from libphobos.a ?

sudo ln -s libphobos2.a /usr/lib/libphobos.a

The same goes for installs in a location other than /usr/lib/phobos.

sudo ln -s ../include/d/dmd/phobos /usr/lib/phobos

--anders


More information about the Digitalmars-d mailing list