Cannot find library when building with Qt Creator - c++

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-*

Related

Installing node js pulsar client on ubuntu

I am trying to install the pulsar-client for node js client on ubuntu. I get the following error:
fatal error: pulsar/c/message.h: No such file or directory #include <pulsar/c/message.h>
compilation terminated.
Pulsar.target.mk:116: recipe for target 'Release/obj.target/Pulsar/src/addon.o' failed
make: *** [Release/obj.target/Pulsar/src/addon.o] Error 1
the documentation says
Pulsar Node.js client library is based on the C++ client library.
Follow the instructions for C++ library for installing the binaries
through RPM, Deb or Homebrew packages.
(Note: you will need to install not only the pulsar-client library but
also the pulsar-client-dev library)
However, the instructions for installing C++ library on Ubuntu are not very clear. It is also not clear how to install pulsar-client-dev library.
You are right that C++ library must be installed. One note is please make sure the compatible C++ library is installed.
https://github.com/apache/pulsar-client-node#compatibility
To install C++ library ubuntu, here is an example which is from our Docker image build on Ubuntu based.
https://github.com/kafkaesque-io/pulsar-beam/blob/master/Dockerfile#L29
wget --user-agent=Mozilla -O apache-pulsar-client.deb "https://archive.apache.org/dist/pulsar/pulsar-2.4.1/DEB/apache-pulsar-client.deb"
wget --user-agent=Mozilla -O apache-pulsar-client-dev.deb "https://archive.apache.org/dist/pulsar/pulsar-2.4.1/DEB/apache-pulsar-client-dev.deb"
apt install -y ./apache-pulsar-client.deb
apt install -y ./apache-pulsar-client-dev.deb

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.

Error during project compilation in QT [duplicate]

I just reinstalled QtCreator, created new project (Qt Application) an got this after compilation:
/usr/bin/ld: **cannot find -lGL**
collect2: error: ld returned 1 exit status
make: *** [untitled1] Error 1
18:07:41: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project untitled1 (kit: Desktop Qt 5.1.0 GCC 32bit)
When executing step 'Make'
(Project is empty, I did'n commit any changes)
Qt Creator 2.7.2
Based on Qt 5.1.0 (32 bit)
Ubuntu 13.04
How do I solve this problem?
You should install package "libgl1-mesa-dev":
sudo apt install libgl1-mesa-dev
you don't need to install anything. libGL is already installed with Ubuntu, you just need to soft link it. (tested for ubuntu 14.x and 15.x, might work for later versions)
First locate the GL library
Then link it under /usr/lib
If the library is missing, it can be installed via libgl1-mesa-dev package
Here is how you could do this:
$ locate libGL
/usr/lib/i386-linux-gnu/mesa/libGL.so.1
/usr/lib/i386-linux-gnu/mesa/libGL.so.1.2.0
/usr/lib/x86_64-linux-gnu/libGLEW.so.1.10
/usr/lib/x86_64-linux-gnu/libGLEW.so.1.10.0
/usr/lib/x86_64-linux-gnu/libGLEWmx.so.1.10
/usr/lib/x86_64-linux-gnu/libGLEWmx.so.1.10.0
/usr/lib/x86_64-linux-gnu/libGLU.so.1
/usr/lib/x86_64-linux-gnu/libGLU.so.1.3.1
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0
/usr/lib/x86_64-linux-gnu/mesa-egl/libGLESv2.so.2
/usr/lib/x86_64-linux-gnu/mesa-egl/libGLESv2.so.2.0.0
$ sudo ln -s /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 /usr/lib/libGL.so
The gui Qt module is included by default. If you don't want to use it in a project (e.g., it is a library or only uses stdio), you need to specify that in the .pro file.
QT -= gui
And the linker won't attempt to find lGL regardless of whether it is installed.
My case is admittedly a bit odd, since the main reason to use Qt is to create gui's. Installing the GL library is certainly not difficult, I just wanted to know why my quick and dirty Hello World wanted it.
write:
yum provides */libGL.so
after providing:
yum install mesa-libGL-devel mesa-libGLU-devel
This worked for me:
sudo ln -s /usr/lib/libEGL1.so /usr/lib/libGL.so
My system is Ubuntu 16.04 on x86 computer(with NVIDIA GeForce GPU).
Check the library files located in /usr/lib/x86_64-linux-gnu
ls -al /usr/lib/x86_64-linux-gnu/libG*
If you see the broken link, reinstall libgl1-mesa-glx
sudo apt install --reinstall libgl1-mesa-glx
And, recheck library.
In my case: I have installed QT 32 bit lib in Win10 64 bit and it ran into error, I change to all 64 bit and QT creator run smoothly.
Solved this problem just a minute ago in suse.
Just do the following step below and QTCreator should works just fine.
sudo zypper install --type pattern devel_basis

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!

Qt: can't find -lGL error

I just reinstalled QtCreator, created new project (Qt Application) an got this after compilation:
/usr/bin/ld: **cannot find -lGL**
collect2: error: ld returned 1 exit status
make: *** [untitled1] Error 1
18:07:41: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project untitled1 (kit: Desktop Qt 5.1.0 GCC 32bit)
When executing step 'Make'
(Project is empty, I did'n commit any changes)
Qt Creator 2.7.2
Based on Qt 5.1.0 (32 bit)
Ubuntu 13.04
How do I solve this problem?
You should install package "libgl1-mesa-dev":
sudo apt install libgl1-mesa-dev
you don't need to install anything. libGL is already installed with Ubuntu, you just need to soft link it. (tested for ubuntu 14.x and 15.x, might work for later versions)
First locate the GL library
Then link it under /usr/lib
If the library is missing, it can be installed via libgl1-mesa-dev package
Here is how you could do this:
$ locate libGL
/usr/lib/i386-linux-gnu/mesa/libGL.so.1
/usr/lib/i386-linux-gnu/mesa/libGL.so.1.2.0
/usr/lib/x86_64-linux-gnu/libGLEW.so.1.10
/usr/lib/x86_64-linux-gnu/libGLEW.so.1.10.0
/usr/lib/x86_64-linux-gnu/libGLEWmx.so.1.10
/usr/lib/x86_64-linux-gnu/libGLEWmx.so.1.10.0
/usr/lib/x86_64-linux-gnu/libGLU.so.1
/usr/lib/x86_64-linux-gnu/libGLU.so.1.3.1
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0
/usr/lib/x86_64-linux-gnu/mesa-egl/libGLESv2.so.2
/usr/lib/x86_64-linux-gnu/mesa-egl/libGLESv2.so.2.0.0
$ sudo ln -s /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 /usr/lib/libGL.so
The gui Qt module is included by default. If you don't want to use it in a project (e.g., it is a library or only uses stdio), you need to specify that in the .pro file.
QT -= gui
And the linker won't attempt to find lGL regardless of whether it is installed.
My case is admittedly a bit odd, since the main reason to use Qt is to create gui's. Installing the GL library is certainly not difficult, I just wanted to know why my quick and dirty Hello World wanted it.
write:
yum provides */libGL.so
after providing:
yum install mesa-libGL-devel mesa-libGLU-devel
This worked for me:
sudo ln -s /usr/lib/libEGL1.so /usr/lib/libGL.so
My system is Ubuntu 16.04 on x86 computer(with NVIDIA GeForce GPU).
Check the library files located in /usr/lib/x86_64-linux-gnu
ls -al /usr/lib/x86_64-linux-gnu/libG*
If you see the broken link, reinstall libgl1-mesa-glx
sudo apt install --reinstall libgl1-mesa-glx
And, recheck library.
In my case: I have installed QT 32 bit lib in Win10 64 bit and it ran into error, I change to all 64 bit and QT creator run smoothly.
Solved this problem just a minute ago in suse.
Just do the following step below and QTCreator should works just fine.
sudo zypper install --type pattern devel_basis