-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libLLVM-3.6.so.1: error adding symbols: DSO missing from command line #25
Comments
Sorry, I never tried this on Ubuntu, I'm on OSX so I don't know why it doesn't work. Seems to be related to crystal-lang/crystal#1269 and will/crystal-pg#14 |
This is still an issue with the latest version of Crystal, any chance someone could take a look?
The output is:
|
Agreed, it's still an issue. Here is another example when using mongo.cr Environment: a Debian stable (jessie) up to date. > crystal --version
Crystal 0.22.0 [3c71228] (2017-04-20) LLVM 3.5.0
> llvm-config-3.5 --version
3.5.0
> cat /etc/{issue,debian_version}
Debian GNU/Linux 8 \n \l
8.8 Code: an attempt to connect to a local Mongo database. > crystal init app try_mongo
create try_mongo/.gitignore
create try_mongo/LICENSE
create try_mongo/README.md
create try_mongo/.travis.yml
create try_mongo/shard.yml
create try_mongo/src/try_mongo.cr
create try_mongo/src/try_mongo/version.cr
create try_mongo/spec/spec_helper.cr
create try_mongo/spec/try_mongo_spec.cr
Initialized empty Git repository in /path/to/try_mongo/.git/ Adding mongo.cr > cd try_mongo
try_mongo> cat >> shard.yml
dependencies:
mongo:
github: datanoise/mongo.cr
branch: master
^D try_mongo> shards install
Updating https://github.com/datanoise/mongo.cr.git
Installing mongo (master) Add basic code to try db connect try_mongo> cat > src/try_mongo.cr
require "mongo"
client = Mongo::Client.new "mongodb://localhost"
db = client["test"]
collection = db["mongo_try"]
puts collection.count
^D Attempt to build... try_mongo> crystal build src/try_mongo.cr
/usr/bin/ld: /opt/crystal/embedded/lib/../lib/libgc.a(os_dep.o): undefined reference to symbol '_end'
//usr/lib/x86_64-linux-gnu/libyajl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Error: execution of command failed with code: 1: `cc -o "/path/to/try_mongo/try_mongo" "${@}" -rdynamic -lmongoc-1.0 -lbson-1.0 -lpcre -lgc -lpthread /opt/crystal/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/lib -L/usr/local/lib` |
Looks like author doesn't provide ldflags to the library. Just for example: @[Link(ldflags: "#{__DIR__}/ext/libcrystal.a")] |
@akzhan How do you use this trick on the previous example ? |
|
@akzhan : seems ldflags are already provided. > grep -r Link .
./lib/mongo/src/mongo/lib_mongo.cr:@[Link("mongoc-1.0")]
./lib/mongo/src/bson/lib_bson.cr:@[Link("bson-1.0")] |
Still unable to try mongo.cr, even on Debian stretch (the next stable release), cf. datanoise/mongo.cr#22 |
Found a bug in |
caught again in Ubuntu 17.10:
|
I had the same issue yesterday with other DSO. It seems I have to install the dev library on Ubuntu. My bad I cannot recall what exactly been done :( |
I'm getting this error trying to generate the examples.
I have libllvm3.6v5 and libllvm3.6-dbg packages installed.
I also have llvm 3.8 installed.
I'm not sure how this linking works.
Some version info:
The text was updated successfully, but these errors were encountered: