On Thursday, 12 September 2013 at 20:26:29 UTC, Craig Dillabaugh
wrote:
On Thursday, 12 September 2013 at 19:46:21 UTC, Craig Dillabaugh
wrote:
I just upgraded my Linux distro (openSuse) and now when trying to
compile a project with dub I am getting linking errors.

Compilation goes OK until the linking stage, when I get the
following:

Linking...
dmd -of/home/craig/cloud/vibe-tiles/vibe
/home/craig/cloud/vibe-tiles/temp.o -L-levent_pthreads -L-levent
-L-lssl -L-lcrypto -g

clip

Strangely, libdl.so.2 and libz.so.1 are both there and libcrypto
is linked to them.

clip

Craig

OK, so I solved my compilation problem by passing the following
as the linker command (added -L-ldl and -L-lz):

dmd -of/home/craig/cloud/vibe-tiles/vibe
/home/craig/cloud/vibe-tiles/temp.o -L-levent_pthreads -L-levent
-L-lssl -L-ldl -L-lz -L-lcrypto -g

How the GCC linker decides which libraries I need to explicitly
specify is indeed a mystery to me.

Craig

For anyone who runs into a similar problem using DUB the
following package.json files solves the problem:

{
        "name": "vibe",
        "description": "My first vibe project.",
        "homepage": "http://example.org";,
        "copyright": "Me",
        "authors": [
                "Craig Dillabaugh"
        ],
        "dependencies": {
                "vibe-d": "~master"
        },
        "libs": ["dl", "z"]
}

Reply via email to