[Qgis-developer] Write custom c++ application using QGIS under windows

eliu1234 lby20102 at hotmail.com
Tue Nov 18 15:04:34 PST 2014


Thanks so much for the answer. I am able to get the 32 bit version working.
Right now, I am facing the problem of not able to run debug mode. Since all
those xxxxxd.lib files does not exist with the OSGeo4W installation. Do you
have any idea how to fix this?

And right now, I cannot seem to print anything in this mode. I tried to use
cout but my output line is not printed. I tried to setup using visual
studio. But is unsure how to include these dll files without their
corresponding library files. Do you have any idea on this?

Thanks.

In Reply To
Re: Write custom c++ application using QGIS under	windows
Nov 18, 2014; 7:43am — by  Nejia Nejia

Hi, 

First you must download packages listed below from OSGeo4w (
http://qgis.org/en/site/forusers/download.html OSGeo4W Network Installer (32
or 64 bit)): 
        - qgis: QGIS desktop 
        - grass: GRASS GIS 
        - qgis-devel 
        - qt4-devel 
        - qt4-doc 
        - qt4-libs 
        - qwt-devel-qt4 
        - qwt-doc-qt 
        - qwt-libs-qt4 

In the post of Denis just replace: 
@set PATH=%OSGEO4W_ROOT%\bin;%OSGEO4W_ROOT%\apps\qgis-dev\bin;%PATH% 
@set
INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\include;%OSGEO4W_ROOT%\apps\qgis-dev\include 

With: 
@set PATH=%OSGEO4W_ROOT%\bin;%OSGEO4W_ROOT%\apps\qgis\bin;%PATH% 
@set
INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\include;%OSGEO4W_ROOT%\apps\qgis\include 

(replace qgis-dev with qgis) 

And if you want to build 64 bits applications with visual studio 2010
replace: 
set VS90COMNTOOLS=C:\Program Files\Microsoft Visual Studio
9.0\Common7\Tools\ call "C:\Program Files\Microsoft Visual Studio
9.0\VC\vcvarsall.bat" x86 

with: 
call "%PF86%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" amd64 if exist
"c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" call
"c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /x64 /Release
path %path%;%PF86%\Microsoft Visual Studio 10.0\VC\bin 

set SETUPAPI_LIBRARY=%PF86%\Microsoft
SDKs\Windows\v7.0A\Lib\x64\SetupAPI.Lib 
if not exist "%SETUPAPI_LIBRARY%" set
SETUPAPI_LIBRARY=%PROGRAMFILES%\Microsoft
SDKs\Windows\v7.1\Lib\x64\SetupAPI.lib 

Cheers, 
Nejia 



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Write-custom-c-application-using-QGIS-under-windows-tp5173377p5173692.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.


More information about the Qgis-developer mailing list