Error cannot find -lsbml and -lstdc++ when compiling qt project - qt

I would like to cross compile a qt project on raspberry. I finished all the installing steps and the configuration of qt creator. But when i tried but when i tried to compile an example project I got an error
cannot find -lsbml
cannot find -lstdc++

First make sure that these libs are already installed:
sudo apt-get install sbml
sudo apt-get install stdc++
I am not sure about the names, but you can check them via apt-cache like:
apt-cache search sbml | less
You can use this to get all packages which are related to the corresponding library. Choose the right package and install it via apt-get install ...
Now try again. When the compile-step still fails you need to specify the lib-directories in the .pro-file like:
LIBS += -L<Path_to_sbml> -lsbml -L<Path_to_stdc++> -lstdc++
Hope that helps you.

Related

Can't build project on Ubuntu using QT6.4 and CMake

I installed a fresh new copy of QTCreator on a Ubuntu VM. It is a clean virtual machine. Then I create a dummy QTQuick project with almost nothing in it. But creator fails to compile, saying CMAKE_CXX_COMPILER not found. See message below:
error: No CMAKE_CXX_COMPILER could be found. Tell CMake where to find the compiler by
setting either the environment variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER
to the full path to the compiler, or to the compiler name if it is in the PATH.
Am I missing the compiler? This is a fresh install and I don't understand. Creator is showing the only compiler option. See the screen shot below:
Any ideas why it does not compile from a clean install, using all default option? The compiler must be there.
thank you.
I followed these instructions and it worked finally.
sudo apt-get update && sudo apt-get upgrade
sudo apt-get -y install build-essential openssl libssl-dev libssl1.0 libgl1-mesa-dev libqt5x11extras5
downloaded the install and made it executable
chmod +x qt*.run
then it worked.
Here is the page with more explanations:
https://web.stanford.edu/dept/cs_edu/resources/qt/install-linux

Facing "Could not find all of moc, rcc, and uic for Qt5" in omnet++ version 5.7. while installing

I followed every steps of installation manual while installing it. according to the manual, I need to type ./configure. Whenever I typed it, the problem occurred. Showing the exact line"Could not find all of moc, rcc, and uic for Qt5 -- nope, nope, nope"
Before running ./configure you must always source setenv and make sure that all required packages (i.e. qt-default) is installed.
You can try to install Qt5 to solve the problem
sudo apt-get install qt5-default qtcreator

Why is there no qmake-qt5 included in the qt5-default package

I installed qt5-default on my Odroid XU3 using the the sudo apt-get install qt5-default command and wanted to run qmake-qt5 using the terminal but it printed that this command is unknown. Then I looked in the usr/share/qt5 folder and noticed that there is only the doc-foder inside. I also looked in the usr/bin folder and could only find qmake-qt4 but no qmake-qt5. When I run the install command, I also read that some libraries will be installed, so I think, libraries are not the problem.
Next I tried to install qmake-q5t manually from this page https://launchpad.net/ubuntu/trusty/+package/qt5-qmake but then I got a message that there is a newer version of qmake-qt5 already installed. I searched the whole system using the find command for qmake-qt5 but couldn't detect it.
Last I also tried to add the ubuntu-sdk ppa using as described here https://askubuntu.com/questions/279421/how-can-i-install-qt-5-x-on-12-04-lts but this also didn't work out.
Does it have something to do with my Odroid or with Lubuntu? Is there any other way to install qmake-qt5?
I tried to compile and make with the already installed qt4 and this did work out using
qmake-qt4 -project
qmake-qt4
make
./helloworld
I want do the same but only with qt5
Thanks in advance
The qmake executable is installed in /usr/lib/<your_arch>/qt5/bin as qmake (no -qt5 suffix).
You can check with qmake --version, it should report you a Qt version 5.x.x

Self-compile Qt Webkit

I have self-compiled Qt 5.4.1 and installed in /opt/qt-5.4.1.
However, I encountered an error while trying to 'qmake' my project file:
Project ERROR: Unknown module(s) in QT: webkitwidgets
I did sudo apt-get install libqt5webkit5-dev but the error persists.
I suspect then that apt-get install does not work when Qt-Core was self-compiled. The Qt Webkit source is available on https://qt.gitorious.org/qt
The question is, how and where should I install Webkit from source so that it can be detected while running qmake?
Probably you missed compilation of webkit while compilation of Qt. Read here how to resolve this issue:
https://forum.qt.io/topic/40378/solved-linux-unknown-module-s-in-qt-webkitwidgets
QtWebKit is not built anymore by default. You can build it after you have a proper build of Qt. Once you have your build of Qt clone the QtWebKit repo:
git clone https://github.com/qt/qtwebkit.git
then, make a new dir for the build files and from that directory enter the command:
/opt/qt-5.4.1/bin/qmake <path/to/qtwebkit>
make -j<n>
make install
Now you should be able to use QtWebKit with your build.
might want to try:
sudo apt-get install libqt5webkit5
and
sudo apt-get install libqt5webkit5-dev

Compiling Qt 4.8.3 on Ubuntu 12 failing

I am new to Ubuntu and i am getting a message while building Qt 4.8.3 on Ubuntu 12:
Basic XLib functionality test failed! You might need to modify the
include and library search paths by editing QMAKE_INCDIR_X11 and
QMAKE_LIBDIR_X11 in
/home/majidmax/qt-everywhere-opensource-src-4.8.3/mkspecs/linux-g++.
what the proper steps to build Qt on Ubuntu?
http://qt-project.org/doc/qt-4.8/requirements-x11.html
the website provide the package list which must be installed
try it~
These are the packages you need to install and you'll be good to go. I just had this same problem and this worked for me. These came from the link provided by Garlic Tseng in the accepted answer. I am just putting these here for convenience:
libfontconfig1-dev
libfreetype6-dev
libx11-dev
libxcursor-dev
libxext-dev
libxfixes-dev
libxft-dev
libxi-dev
libxrandr-dev
libxrender-dev
One (copy pastable) command to install all:
sudo apt-get install libfontconfig1-dev libfreetype6-dev libx11-dev libxcursor-dev libxext-dev libxfixes-dev libxft-dev libxi-dev libxrandr-dev libxrender-dev
What about sudo apt-get build-dep qt4-qmake?
Try to run that command before you compile Qt (on Debian-like distros).
Same problem i faced in fedora20 (64-bit) for Qt-4.8.3
1)- yum install libXext-devel
(internet connectivity should be there for checking the dependency and install all dependency).
2)- ./configure
3)- make
4)- make install
5)- Installation finish successfully.
The error message doesn't give a lot of information as to the actual issue of XLib failing.
To get more information on the error causing it to fail you can 'make' the xlib tests:
$ cd <Qt_Source_Directory>/config.tests/x11/xlib/
$ make
g++ -Wl,-O1 -o xlib xlib.o -L/usr/X11R6/lib -ltcg -lXext -lX11 -lm
/usr/bin/ld: cannot find -ltcg
collect2: error: ld returned 1 exit status
make: *** [xlib] Error 1
In my case above, I was using -ltcg which was being interpreted as an explicit library to include. I was using this option as it is listed on the qt 4.8 configure options as:
Use Link Time Code Generation
When I looked at the configure options using ./configure --help I noticed that this option isn't listed. Removing the option from my configure line fixed my issue.
what the proper steps to build Qt on Ubuntu?
Check the Qt supported Platforms.
Check Qt for X11 requirements.
3a. Check steps to install Qt on X11 platforms(along with build).
or
3b. Check steps to build static Qt.

Resources