How to implement GDAL library on Qt? - c++

I need to make a GUI on Qt Creator using GDAL. I'm having some trouble while trying to implement GDAL on Qt Creator. I learned that I should've used MinGW for that. However, I could not find any documentation or instruction showing how to make implementation. Could you guys help?

I will try to help you and tell you what you have to do))
download library's binary, header file (if not found, have to build from lib source)
place in some local folder.
add in .pro file
INCLUDEPATH += .../GDAL/Maked/include
LIB += -L/path_to_lib -lgdal-20
run qmake,
build project,
move gdal-20.dll , libstdc++-6.dll , libiconv-2.dll
dlls in current working directory
how to work with her? you can see here
GDAL Warp API tutorial
Raster API tutorial
Using C++ Classes, Templates, and GDAL

Related

How to add a Scintilla component to a Qt Creator C++ project?

I would like to use scintilla on a Qt project, but I don't know how to start, do I have to include the source files? or is there some library that I can reference?
The only installation examples I have found are for PyQt but I'm using c++ on Linux.
QScintilla is a library derived from Scintilla to use with Qt. This library can be downloaded from https://riverbankcomputing.com/software/qscintilla/download.
To use this library you need to build and install first. As you use Linux, the building process is
cd Qt4Qt5
qmake
make
make install
Note:
The directory Qt4Qt5 is inside the uncompressed QScintilla directory.
Make sure Qt binary path is in your Linux PATH variable.
To use QScintilla in your project, in your .pro file just add the following line.
CONFIG += qscintilla2
The library comes with an example. To build the example use the following commands in your bash.
cd example-Qt4Qt5
qmake
make

What is the proper way to incorporate gstreamer into Qt (Windows)?

Since there is no real tutorial on the internet except for a very few similar questions that have had no answer, how do I incorporate gstreamer into Qt on Windows 7?
I have installed gstreamer throught the installer; then i copied the whole folder into my Qt project folder and put this line in the main:
#include <gstreamer/1.0/x86_64/include/gstreamer-1.0/gst/gst.h>
The compiler suggests gst_init, which means it can read gst.h, yet when I build the copiler gives this error:
C:\ ..path here...\Qt\BachelorProject_AUDIOVIDEO_STREAMING\gstreamer\1.0\x86_64\include\gstreamer-1.0\gst\gst.h:27: error: C1083: Cannot open include file: 'glib.h': No such file or directory
What am I missing?
EDIT: by adding this in the .pro file (as suggested by the gstreamer webpage) and compiling with cmake:
CONFIG += link_pkgconfig
PKGCONFIG += QtGStreamer-1.0
doesn't work either. It really seems that no "official" solution is available online
You can use pkgconfig which can be used inside Qt project (*.pro) file like
PKGCONFIG += gstreamer-1.0 gstreamer-1.0-app
If I remember correctly..
And you can link other dependant libraries like glib (GStreamer is based on GLib)
Of course you will have to provide correct path to the gstreamer .pc files which contain correct paths to where it is installed - you just keep gstreamer at the default location and it (maybe) should work..
I hope this approach is working on Windows..

Using Ogre library locally for a project

what I would like to do is to have an application (I am currently working off the sample framework app) and include any ogre library files with it, as opposed to have it installed for the whole system. This way I can easily port the application onto other computers once built.
I am on Mac OS 10.9. I built Ogre by first running the CMake app to configure the Xcode project, then opening the created Xcode project and building the Install and SampleBrowser congifurations. A directory sdk/lib was created in the Ogre directory. This contains directories debug, OGRE and pkgconfig. The OGRE directory has all the samples .dylib files. What I do not see is the main ogre library file.
The contents of the file lib/pkgconfig/Ogre.pc suggest that there should be a library file called OgreMain in the lib directory:
Libs: -L${libdir} -lOgreMain -lpthread
As far as I understand it, I need this library file to be a part of my project. I could then link the sdk/include for all the Ogre's header files. I am confused about how to make this work. Could anyone please help?
Sounds like this is Ogre 1.8. In that case the libraries and frameworks need to be installed in your application bundle. Inside MyApp.app/Contents you will need folders named Components, Plugins and Frameworks. Ogre.framework goes in frameworks, component dylibs go into Components, plugin dylibs go in Plugins.
I actually found a great tutorial that worked straight away for me here: http://will.thimbleby.net/ogre3d-tutorial/
This is for Ogre 1.8, the only difference when using Ogre1.9 is that you don't use RenderSystem_GL.dylib but RenderSystem_GL.framework (found at the same place as Ogre.framework) and you deal with it in the same manner in terms of your project setup as with Ogre.framework.

How to link to yaml-cpp on Arch Linux with qtcreator?

I'm interested in using Yaml in my media player project. The only problem is I can't figure out how you compile with Yaml, especially on qt-creator. The AUR package for yaml-cpp doesn't seem to install the libs in /usr/lib for some reason, so I'm not sure how to go about doing this. I'm using Qt and developing within the Qtcreator environment. Help would be appreciated.
I used QtCreator to start a CMake project, then used a CMake file to find yaml-cpp. Here is the CMake file to link yaml-cpp to your project.
Additionally, you should be able to go into your ".pro" file, r-click, and hit "add library". Select "system library", then you can use either pkgconfig or manual if you know where the lib is. If you can't figure out where it is, look in the PKGBUILD for yaml-cpp - it will tell you where it installs everything.

Qt C++ Stand alone executable in Windows

I want to make my Qt C++ program a stand alone single application. By the way, I am using Qt creator 2.2.1 which is based on Qt 4.7.4. I followed the instructions from http://www.formortals.com/how-to-statically-link-qt-4/ to statically link the libraries. I did not know where to find the configure.exe in the QtSDK folder so I downloaded "qt-everywhere-opensource-src-4.7.3" and followed the instructions.
I was unsure in Step 4 because the windows Qt options do not look similar. Its not a path to a folder but rather a path to qmake location and I am not sure what to choose for that option.
If anyone knows how to create the program as a stand alone without needing any dlls and can help me out, I would really appreciate it.
Thanks
Regarding the step 4 you mentioned, in QtCreator you need to point the qmake executable you will find it in the build tree (where you built Qt statically) in the bin folder.
I guess if you have problems on step 4 you should have built the static version of Qt, you've done 95% of the work !
The moment QtCreator will accept the qmake you made, you will just have to select this version use any wizard to get you first app, then add CONFIG += static to you .pro file.
Here some Qt tutorial just in case.