Domanda

I was trying to install DMD so precisely followed the advices available on this page: http://dlang.org/dmd-osx.html. However, when I have an error when I try to build a .d file:

Here is my hello.d

import std.stdio;

void main() {
    writeln("hello world!");
}

and then:

gcc hello.o -o hello -m64 -lphobos2 -lpthread -lm
ld: library not found for -lphobos2
clang: error: linker command failed with exit code 1 (use -v to see invocation)
--- errorlevel 1

Does anyone encountered the same issue?

Thanks,

Cédric

È stato utile?

Soluzione

It seems that I did not precisely followed the advices on the dlang website. After some debugging time, I've found out the solution:

The dmd.conf file was incorrect, thus the libphobos2.a was not found. Now my dmd.conf file is looking like:

[Environment]

DFLAGS=-I%@P%/../src/phobos -I%@P%/../src/druntime/import -L-L%@P%/../osx/lib
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top