I got this error on an Ubuntu Server, 18.04 LTS 64-bit edition which I run through Virtualbox. I have no idea if the same happens on any other system or distro. What I did was:
crystal init lib repo_name.crystal spec immediately after. Which gave this stacktrace: /usr/bin/x86_64-linux-gnu-ld: cannot find -lxm12
collect2: error: ld returned 1 exit status
Error: execution of command failed with code: 1: `cc "${@}" -o '/home/myUser/.cache/crystal/crystal-run-spec.tmp' -rdynamic -lxm12 -lpcre -lm -lgc -lpthread /usr/share/crystal/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/lib -L/usr/local/lib`
Crystal compiler version:
Crystal 0.24.2 [4f9ed8d03] (2018-03-08)
LLVM: 4.0.0
Default target: x86_64-unknown-linux-gnu
Duplicate of #5662, which is resolved in master :smiley:
Sorry for posting a duplicate, I did search but apparently not well enough ...
Master would also have told you to install the development packages for libxml2, which likely would have pointed to a solution
@RX14 time for a release? :smile:
@RX14 yeah, I had no idea that I should build from the master branch myself instead of installing the official release. Being simply a curious developer, rather than seeking to be an active contributer to the project.
@beanilsson No, you don't need to build from master, using the current release is fine, too. It just needs libxml.
The comment from @RX14 just indicated that master would also have a better error message indicating what libraries you need to provide.
had no idea that I should build from the master branch myself instead of installing the official release
That wasn't what I was trying to imply. You should continue using the latest release. I was simply saying that the next release will have multiple fixes in this area, instead of just removing libxml2 from spec.
Most helpful comment
@RX14 time for a release? :smile: