dlang-community / drepl

A REPL for D
Boost Software License 1.0
78 stars 20 forks source link

Linking error: ld: symbol(s) not found for architecture x86_64 #77

Closed jkleiser closed 5 years ago

jkleiser commented 5 years ago

After having done dub fetch drepl successfully, I do dub run drepl. That job ends like this:

drepl 0.2.1: building configuration "console"...
Running pre-build commands...
Linking...
Undefined symbols for architecture x86_64:
  "__D6object__T10RTInfoImplVAmA2i48i60Z4datayG2m", referenced from:
      __D42TypeInfo_S3std7variant__T8VariantNVmi32ZQp6__initZ in libstdx-allocator.a(concurrency_103_72a.o)
  "__D6object__T10RTInfoImplVAmA2i80i961Z4datayG2m", referenced from:
      __D59TypeInfo_S3std11concurrency__T4ListTSQBbQBa7MessageZQw4Node6__initZ in libstdx-allocator.a(atomic_ef_466.o)
  "_rt_loadLibrary", referenced from:
      __D4core7runtime7Runtime__T11loadLibraryZQoFxAaZPv in drepl.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: linker exited with status 1
/Library/D/dmd/bin/dmd failed with exit code 1.

I have tried with both DMD64 D Compiler v2.085.0 and v2.085.1. I'm running macOS 10.14.4 (the latest).

I first reported this problem here https://issues.dlang.org/show_bug.cgi?id=19801, but then I was advised to report it here instead.

jkleiser commented 5 years ago

I now uninstalled dmd and dub by running the uninstall.command. Then I installed dmd (v2.085.0) and dub, by "brew install dmd" and "brew install dub". I can now "dub build" several vibe.d examples (http_server, http_static_server, websocket) without problems. I conclude that there are problems with the dmd.2.085.0.dmg and dmd.2.085.1.dmg macOS installers.

I still have some linking problems with drepl, however:

drepl 0.2.1: building configuration "console"...
Running pre-build commands...
Linking...
Undefined symbols for architecture x86_64:
  "_rt_loadLibrary", referenced from:
      __D4core7runtime7Runtime__T11loadLibraryZQoFxAaZPv in drepl.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error: linker exited with status 1
dmd failed with exit code 1.
jkleiser commented 5 years ago

This seems to be a duplicate of #39 and #70. (drepl won't work on OS X until OS X has shared library support.)

wilzbach commented 5 years ago

Closing as duplicate then.

wilzbach commented 5 years ago

Btw using the docker image might work for you in the meantime: docker run -ti dlanguage/drepl