[Qgis-developer] custom application: cannot open shared object file

Martin Dobias wonder.sk at gmail.com
Wed Jan 22 01:20:10 PST 2014


Hi Denis

I think you just need to set the Run Environment of your project in Qt
Creator - add LD_LIBRARY_PATH or PATH environment variable (depending
on your system) pointing to the directory with QGIS libraries.

Regards
Martin

On Mon, Jan 20, 2014 at 11:32 PM, Denis Rouzaud <denis.rouzaud at gmail.com> wrote:
> Hi,
>
> I am trying to create a custom application using QGIS API.
>
> I am using Qt Creator and while running the app I get this error:
> error while loading shared libraries: libqgis_core.so.2.1.0: cannot open
> shared object file: No such file or directory
>
> Here is the project file:
>
> QT       += core gui xml
>
> greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
>
> TARGET = hfp
> TEMPLATE = app
>
> SOURCES += main.cpp\
>         mainwindow.cpp
>
> HEADERS  += mainwindow.h
>
> FORMS    += mainwindow.ui
>
> win32:CONFIG(release, debug|release): \
>   LIBS += -L/$${QGISDIR}/lib/ -lqgis_core -lqgis_gui -lqgis_app
>
> else:win32:CONFIG(debug, debug|release): \
>   LIBS += -L/$${QGISDIR}/lib/ -lqgis_core -lqgis_gui -lqgis_app
>
> else:unix: \
>   QGISDIR = /home/denis/opt/qgis/Quantum-GIS \
>   LIBS += -L/$${QGISDIR}/build/output/lib/ -lqgis_core -lqgis_gui -lqgis_app
>
> INCLUDEPATH += $${QGISDIR}/src \
>             $${QGISDIR}/src/core \
>            $${QGISDIR}/src/gui \
>           $${QGISDIR}/build/ \
>
> DEFINES += GUI_EXPORT= CORE_EXPORT=
>
> What am I missing here?
>
> If you have any general comment regarding this project file, it is very
> welcome... first time trying this.
>
> Thanks a lot,
>
> Denis
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the Qgis-developer mailing list