The goal is to show pdf's on my target => imx6 board + display. My host's OS is Linux.
So far i'm having a program written in Qt 5.
It compiles fine and i'm able to see it on the display.
To show some pdfs i would like to use the poppler library.
The problem is that i'm not able to get this done. Properly ...
My steps so far:
I did the basic installation of poppler like it is described in the INSTALL file.
mkdir build
cd build
cmake ..
make
make install
then added
INCLUDEPATH += /home/user/poppler/include/poppler/qt5
LIBS += -L"/home/user/poppler/lib" -lpoppler-qt5
to my .pro file
and the #include <poppler-qt5.h> to my .cpp file.
And the result when running is this:
/home/user/poppler/lib/libpoppler-qt5.so:-1: error: file not recognized: File format not recognized
:-1: error: collect2: error: ld returned 1 exit status
Now i have just two ideas. First one is to cross-compile the poppler source code. (I tried this with a toolchain file but failed :'D)
Second idea is to put the library into Qt together with my project and compile it there - maybe that could work. I just don't know how. Help.
I'm also open for something else then poppler - i just want to show pdf's.
The problem, here, is you are somehow compiling Qt projects for ARM, using the corresponding toolchain and sysroot and ABI, and you can not just link to libraries you compiled for, say, x86_64, because they're just binary incompatible.
In the very lucky case you managed to configure creator for cross compilation, just make a creator project for the poppler library, using cmake, and configure the project with the same kit you use for the imx6 applications. Once you have it built for ARM, you can proper link it in your app, providing the full path to LIBS in the .pro file.
In case you're using Yocto, instead, just make a recipe for poppler. In case you're not, maybe you should.
Related
It's not answer, but yet another question! While compiling a cmake generated ninja build for Qt, we get such an error - #include "../../../../../../../e:/github/Qt/qtbase/src/corelib/animation/qparallelanimationgroup.h", or something like this. Of course, the file won't be found.
Where, I gess, is the fault - in cmake or in a cmake script for Qt building?
It happens from version into version, when you build QT a 'disk-away' far from its sources location.
As it is generated automatically, it should be found and corrected in Qt source files!
I am cross-compiling a Qt Application. My host is a Ubuntu system and target is ARM board with buildroot based filesystem and I am using Qt 5.3.1. When I try to run make, I get the following error:
/home/hamzah/vibrante/toolchains/tegra-4.8.1-nv/usr/bin/armv7a-vfpv3-cortex_a15-linux-gnueabi/../../libexec/armv7a-vfpv3-cortex_a15-linux-gnueabi/gcc/arm-cortex_a15-linux-gnueabi/4.8.1/ld: cannot find /lib/libpthread.so.0
/home/hamzah/vibrante/toolchains/tegra-4.8.1-nv/usr/bin/armv7a-vfpv3-cortex_a15-linux-gnueabi/../../libexec/armv7a-vfpv3-cortex_a15-linux-gnueabi/gcc/arm-cortex_a15-linux-gnueabi/4.8.1/ld: cannot find /usr/lib/libpthread_nonshared.a
collect2: error: ld returned 1 exit status
As you can see, it is using absolute path in target for libpthread.so.0 and libpthread_nonshared.a. This library is placed in the target filesystem hosted on my host. The target library search path has been added in qmake.conf using QMAKE_LIBDIR variable:
QMAKE_LIBDIR += /home/hamzah/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf/sysroot
QMAKE_LIBDIR += /home/hamzah/buildroot/output/host/usr/arm-buildroot-linux-gueabihf/sysroot/usr/lib
I need to know how to make the ld able to find this library using sysroot variable or any other approach.
PS: I am compiling Qt Application. Pre-built Qt applications are running on both my host and target
Use the qmake built by Buildroot in output/host/usr/bin. This one has the right paths pre-configured. If it still doesn't work, please submit a bug report in the Buildroot bug tracker, with a simple test case to reproduce the problem, as well as the list of steps to reproduce it.
I have a prebuilt version of netcdf Library which I've downloaded from the Unidata website,
Now I am trying to link this Library to Qt 5, to use it in my Qt project. So I looked for some solutions in the internet and I found that I should add these lines to my Project.pro :
LIBS += -LC:/netcdf/lib -lnetcdf
INCLUDEPATH += C:/netcdf/include
But after runing the project, it doesn't work, so I rerun it with the debuger and it shows me this Message Box (titled "executable Failed") : During startup program exited with code 0xc0000135
Please help !
The pre-built libraries are built using Microsoft Visual Studio. As I recall, the C/C++ compiler the Qt SDK uses on Windows is a mingw-variant of gcc. I am not certain if the pre-built netcdf libraries are compatible with the mingw runtime, but it is usually not a good idea to mix C runtimes anyways.
I'm assuming you are using Qt Creator; if so, then it may be easier than you think to compile the netcdf-c libraries yourself. Because the netcdf-c project uses CMake, you will be able to open it as a project in Qt Creator.
Prerequisites
You will need the following:
cmake: http://cmake.org
netcdf-c source code: http://github.com/Unidata/netcdf-c/releases
NetCDF Dependencies
Note that you will need to install the following dependencies first, depending on the functionality you want from the netcdf library.
NetCDF4 support requires libhdf5 and libhdf5_hl, both provided by the hdf5 package available from http://www.hdfgroup.org.
DAP support requires libcurl. Google should be able to help you find this.
If you do not need these capabilities, you'll be fine with a straight netcdf-classic install.
Opening netcdf-c as a project in Qt Creator
Launch Qt Creator
Go to file->open project
Navigate to the netcdf-c source directory and open the CMakeLists.txt file.
This will load the netcdf source as a new project in Qt Creator. At this point it should be pretty straight forward to compile netcdf and install it somewhere on your system to use with your project.
Incorrect Assumption
If my assumption that you are using Qt Creator is wrong, this is all still possible from the command line; it will be, however, a little more involved.
I followed these instructions in the configuration of OpenCV SDK for using it in Qt Creator IDE, but I couldn't conclude point 6.5, due to configuration errors in Cmake-GUI. I setup the configuration in CMake of the compilers gcc and g++ contained in Qt folder for MinGW32, and all looks Ok. But when Cmake-GUI starts the process of build configuration it ends up saying
"Error in configuration process, project files may be invalid".
It can't find the following:
QT_QMAKE_EXECUTABLE;
Qt5Concurrent_DIR;
QT5Core_DIR;
QT5Gui_DIR;
QT5Test_DIR;
QT5Widgets_DIR.
After this issue I tried to go on with following points of configuration tutorial, without reaching the final instruction of mingw32-make install. I'm using the following versions of softwares: Qt 5.3.0, OpenCV 2.4.9, CMake 2.8.12.2. My OS is Windows 7.
How can I recover the missing Qt files in CMake configuration?
Is there an alternative way for configuring OpenCV with Qt (like using precompiled build of OpenCV libraries)?
You just need to indicate CMake the correct paths to each one. Click oh the path to browse and set each one individually:
QT_QMAKE_EXECUTABLE;
For this one, you need to search inside the Qt installation folder for the /bin directory. On it, you' ll find the qmake.exe. In my case it was C:/Qt/5.3/winrt_x64/bin/qmake.exe
All the following ones are in the Qt's /lib/cmake directory. In my case: C:/Qt/5.3/winrt_x64/lib/cmake :
Qt5Concurrent_DIR;
C:/Qt/5.3/winrt_x64/lib/cmake/Qt5Concurrent
QT5Core_DIR;
C:/Qt/5.3/winrt_x64/lib/cmake/Qt5Core
QT5Gui_DIR;
C:/Qt/5.3/winrt_x64/lib/cmake/Qt5Gui
QT5Test_DIR;
C:/Qt/5.3/winrt_x64/lib/cmake/Qt5Test
QT5Widgets_DIR.
C:/Qt/5.3/winrt_x64/lib/cmake/Qt5Widgets
Then click generate. It' ll show a new error and ask you for the QT5OpenGL_DIR. Just as before, show CMake the correct directory. In my case: C:/Qt/5.3/winrt_x64/lib/cmake/Qt5OpenGL. Finally, click Configure again, and then Generate, and now you're done creating the build files.
You have to specify the location of Qt manually by passing it as an argument for QT5Core_DIR. Qt5_DIR or CMAKE_PREFIX_PATH does also the trick.
Example
Given your Qt 5 is installed at /opt/selfcompiled/Qt5. When calling cmake, add the flag from above:
cmake -DQt5_DIR=/opt/selfcompiled/Qt5 <pathToSourceDir>
Once the Qt 5 directory is set and found by CMake, all the other variables related to Qt 5 should be found from there, too.
To get Facebook integration in our Nokia Symbian application we intend to use this library:
http://gitorious.org/qfacebookconnect
It is not otherwise working completely correctly, but it's a good start.
I have my project (.pro and .cpp files, using Qt Creator), which works fine in the emulator. I included this libqfacebook in the project in this way (in the .pro file):
LIBS += -LC:\projects\Pristop\Nokia\facebook_lib\libqfacebook-build-simulator\debug -lqfacebookconnect
INCLUDEPATH += C:\projects\Pristop\Nokia\facebook_lib\qfacebookconnect\inc
It works fine in the emulator. I use Qt Creator for everything, also to build libqfacebook. But if I want to test the application on a real phone, so to prepare a .sis file, I get this error:
:: error: No rule to make target `\NokiaQtSDK\Symbian\SDK\epoc32\release\armv5\LIB\qfacebookconnect.dso', needed by `\NokiaQtSDK\Symbian\SDK\epoc32\release\gcce\udeb\DogajaItak.exe'. Stop.
So I need to get a .dso file based on the source code of the qfacebookconnect library. For the emulator .lib and .pdb were enough. Obviously the difference is that .dso is arm while .lib & .pdb are x86.
If I try to configure qfacebookconnect to build for the phone, I get this error:
Makefile:232: error: PKG file does not exist, 'sis' and 'installer_sis' target are only supported for executables or projects with DEPLOYMENT statement. Stop.
It is correct that I do not want a .sis, all I want is a .dso.
If I go to Projects->Build Settings for Symbian Device for qfacebookconnect and I remove the build step "create SIS package" for qfacebookconnect, there is no error anymore, but I still don't believe it built a .dso for me.
So the question is how to configure Qt Creator or the .pro file to build me a .dso, or how to include external libraries in my .sis in another way?
I needed to freeze the library..
I found all the information there:
https://code.google.com/p/qfacebookconnect/issues/detail?id=13