How to compile and link simple application?

Julian julian.fondren at gmail.com
Mon Apr 8 18:45:46 UTC 2019


On Monday, 8 April 2019 at 18:38:58 UTC, 4544fa8d wrote:
> Hello,
>
> I have "hello world" application. I imported std.file, executed 
> thisExePath() and now I have this error:
>
> ----------------------------------------------------------------
> dmd -m64 -of=../../bin/manager -release ./src/manager.d
> /usr/include/dmd/phobos/std/file.d(3252): Error: readlink 
> cannot be interpreted at compile time, because it has no 
> available source code
> /usr/include/dmd/phobos/std/file.d(3253):        called from 
> here: delegate () => readlink(linkz.ptr(), & buffer, 2048LU)()
> /usr/include/dmd/phobos/std/file.d(3433):        called from 
> here: readLink("/proc/self/exe")
> ./src/manager.d(8):        called from here: thisExePath()
> ./src/manager.d(8):        called from here: 
> dirName(thisExePath())
> makefile:2: recipe for target 'all' failed
> ----------------------------------------------------------------
>
> Whats going on? Why I cant build my executable file?

The error message is telling you that dmd is trying to run 
readlink
at compile-time. But this is probably an extern (C) symbol that 
isn't
resolved except by the linker to some code in libc, which can only
happen after any compile-time computation's done.

Are you trying to get the /proc/self/exe of dmd itself?


More information about the Digitalmars-d-learn mailing list