Cannot find -lxml2 when trying to run crystal spec - crystal-lang

Hello I get an error when trying to run crystal spec
/usr/bin/ld: cannot find -lxml2
Is this just a dependency error or? I've tried googling but still can't find a solution.

You need to install libxml development headers. Check this: https://github.com/crystal-lang/crystal/wiki/All-required-libraries

Or if taking the question literally:
apt-get install libxml2-dev

Related

gperftools not installing -lprofiler on Mac after installing it with brew

Recently I wanted to profile my cpp code and came across gperftool, but there aren't really clear instructions on how to use it with Mac. So far I have run brew install gperftools and wanted to compile my simple cpp file which just outputs "Hello world!". I run g++ main.cpp -lprofiler -o main but get error ld: library not found for -lprofiler. I really appreciate it if you could guide me or should me a tutorial where it's easy to follow. Thanks :)
Edit: Currently I am using MacOS with new M1 chip (not sure if that can cause any issue)
So brew didn't install the binaries and that's it.
Follow these steps if you are having a hard time making it work
clone https://github.com/gperftools/gperftools
run ./autogen.sh
run ./configure
make && sudo make install
you should see some path where the binaries where installed, if you wanna take a look at it to make sure (mine was /usr/local/lib)
Profit
I found you can also use the -L$(brew --prefix gperftools)/lib flag to tell g++ where to look for the libraries if you don't want to install with make.

Compiling 32bit Qt on 64bit Linux - fatal error: gnu/lib-names-32.h

Edit: I finally found the answer here. I'd been doing searches that were too specific and when I did a more general search I found that.
I'm trying to compile a 32bit version of Qt 5.6.2 on 64bit Linux Mint, but I'm getting the error fatal error: gnu/lib-names-32.h.
Just to go through what I've done, I used the below configuration command:
./configure -platform linux-g++-64 -xplatform linux-g++-32 -prefix /home/matthew/Qt/Qt5.6.2-S32 -static -opensource -confirm-license -make libs
I then built it with make -j4. I got some compilation errors which where solved by installing gcc-multilib and g++-multilib, but then ran into another error.
Searching for solutions to the latest error, most people suggest installing libx32gcc-4.8-dev and libc6-dev-i386, but I still get the same error.
Does anybody know what I need to install to build 32bt Qt on 64bit Linux Mint?
I finally found the answer here. I'd been doing searches that were too specific and when I did a more general search I found the answer.
You can try installing ia32 libs.
sudo aptitude install ia32-libs
Are you following a tutorial? If so, please, include the link. Could you also please explain your motivation to install 32b Qt libs on your 64b machine?
I had the same issue on the Linux Mint 18.3 x64, but all solutions found here did't solve the problem.
I've made some dig up and found that the only headers i have is these:
>find /usr/include -iname lib-names*
/usr/include/x86_64-linux-gnu/gnu/lib-names-64.h
/usr/include/x86_64-linux-gnu/gnu/lib-names.h
Seems this package (libc6-dev:amd64) is responsible for these files:
>dpkg -S /usr/include/x86_64-linux-gnu/gnu/lib-names-64.h
libc6-dev:amd64: /usr/include/x86_64-linux-gnu/gnu/lib-names-64.h
>dpkg -S /usr/include/x86_64-linux-gnu/gnu/lib-names.h
libc6-dev:amd64: /usr/include/x86_64-linux-gnu/gnu/lib-names.h
I've tried to remove it:
>sudo apt remove libc6-dev:amd64
... to DELETE:
build-essential g++ g++-5 g++-5-multilib g++-multilib gcc-5-multilib gcc-multilib lib32stdc++-5-dev libc6-dev
libc6-dev-i386 libc6-dev-x32 libstdc++-5-dev libx32stdc++-5-dev
If try to reinstall the deleted packages nothing would change. But if change one package just like that (libc6-dev:i386 instead of libc6-dev):
>sudo apt-get install build-essential g++ g++-5 g++-5-multilib g++-multilib gcc-5-multilib gcc-multilib lib32stdc++-5-dev libc6-dev:i386
libc6-dev-i386 libc6-dev-x32 libstdc++-5-dev libx32stdc++-5-dev
Now it has installed the required headers:
>find /usr/include -iname lib-names*
/usr/include/i386-linux-gnu/gnu/lib-names.h
/usr/include/i386-linux-gnu/gnu/lib-names-32.h
/usr/include/x86_64-linux-gnu/gnu/lib-names-64.h
/usr/include/x86_64-linux-gnu/gnu/lib-names.h
It looks like some dependency links are broken or not complete.

How to compile with FLTK under Ubuntu

I am using Code:blocks under Ubuntu 12.04 LTS. I am attempting to compile my first program using FLTK and I get the following errors.
Linking console executable: bin/Debug/<project name removed for security reasons>
/usr/bin/ld: cannot find -lXft
/usr/bin/ld: cannot find -lfontconfig
/usr/bin/ld: cannot find -lfontconfig
/usr/bin/ld: cannot find -lXinerama
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
4 errors, 0 warnings
Is there something else I need to install, or a path I need to add?
To build an FLTK project in Code::Blocks 16.01 on UBUNTU 16.04.
Install FLTK and two additional packages:
$ sudo apt install fltk1.3-dev
$ sudo apt install libxft-dev
$ sudo apt install libxinerama-dev
After this, you can define an FLTK project, and build it without problems.
If you do not install the libxft-dev and libXinerama-dev packages, you will indeed get these error messages listed in question about missing libraries (-lXft, -lfontconfig, -lXinerama).
The reason these packages are not installed automatically with fltk1.3-dev is because they're only 'suggested', and not a hard dependency. This can be seen here:
package: libfltk1.3-dev
However, the 'fltk-config' flag which is used by Code:Blocks to decide what libraries to link in requires them.
For more detail on the fltk-config flag, see:
Beginners Guide to fltk-config
For completeness, here the links to the 2 additional packages:
package: libxft-dev
package: libxinerama-dev
The dev version of libraries used by FLTK might be missing http://packages.ubuntu.com/precise/libfltk1.3 .
You can use apt-get to install them : libxft-dev, libfontconfig1-dev and libxinerama-dev.
You obviously do not have libXft, libfontconfig and libXinerama installed on your machine. If you installed FLTK using Ubuntu package manager, then you should report missing dependency information in the FLTK package.
Typically we do this by finding out who is the package maintainer, and send e-mail to that person.
I managed to get code:blocks 13.12 working with FTLK on Raspberry Pi using Raspian. CodeBlocks gave me those same errors "cannot find -lXft" "cannot find -lfontconfig" and "cannot find -lXinerama".
I used the add/remove software provided with Raspian and searched for each of the following libraries libxft-dev, libfontconfig1-dev and libxinerama-dev and then I installed them using the package manager. When I restarted codeblocks FLTK worked fine!

Link error: "Cannot find -ltinfo" on Ubuntu 12.04 on a 32-bit arm processor

I get the following link error when I'm compiling a small function using ncurses for an Ubuntu 12.04 running on arm. The error is
arm-linux-gnueabihf/bin/ld: cannot find -ltinfo
A lot of hints are floating around on what to install, but I can't seem to find any packages that does the trick for my arm box.
I have done
sudo apt-get install libncurses5-dev
And this does not contain the tinfo library. Other suggestions usually result in the library is "not available but referred by another package" or "has no installation candidate".
All help is appreciated
/Henrik
As mentioned by lucasg
sudo apt-get install libtinfo-dev
solved the same problem for me.
When you cross compile the nurses library, configure this option --with-termlib. It shall install libtinfo into your target location.

Cannot find library when building with Qt Creator

I'm using ubuntu 12.04 64-bit.
I when building a project I receive an error:
cannot find -lNSPR
collect2: ld returned 1 exit status
the .pro file contains
libraries.path = /opt/my_dir
libraries.files = \
engine/x64/libNSPR.so \
Why can't it find the library?
The only workaround so far - I just put libNSPR.so into /usr/lib/x86_64-linux-gnu directory.
From there linker picked the library and build was successful.
I understand that it's not the best way to solve the problem, so constuctive criticism is welcome.
Install Qt libraries by apt-get
sudo apt-get install libqt4-core libqt4-gui
Also you can install for having all libraries
sudo apt-get install libqt4-*