5

I'm trying to learn how to build QGIS from source perfectly with windows 7 x64 to adapt QGIS for a urban planing. But I get plenty of errors.

Until now this is what I'm doing:

PART1: VISUAL STUDIO

I download and install Visual C++ 2010 Express from this link:

microsoft-visual-cpp-express.soft32.es/descarga-gratuita/?dm=1

I download and install Windows SDK 7.1 y NET Framework 4 from this link:

filehippo.com/es/download_microsoft_windows_sdk_for_windows_7_and_net_framework_4/

PART2: OTHER DEPENDENCIES AND TOOLS

I download and install CMake 2.8.6 x86: cmake.org/files/v2.8/cmake-2.8.6-win32-x86.exe

I download and install these packages from:

cygwin.com/setup-x86.exe
  • flex
  • bison
  • GIT
  • Perl
  • Wget
  • Unzip
  • Tar
  • Bzip2

I download and install OSGEO4W with advance install: download.osgeo.org/osgeo4w/osgeo4w-setup-x86.exe

I look for these package in search, and install them - expat - fcgi - gdal - gsl - iconv - pyqt4 - qca - json - qt4 - qwt - sip - spatialite - libspatialindex - python - qscintilla

PART3: PREPARING BATCH FILE

I use this batch file:

@echo off

  set VS90COMNTOOLS=%PROGRAMFILES(x86)%\Microsoft Visual Studio 10.0\Common7\Tools\

  call "%PROGRAMFILES(x86)%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"

  set INCLUDE=%INCLUDE%;%PROGRAMFILES%\Microsoft SDKs\Windows\v7.1\Include

set LIB=%LIB%;%PROGRAMFILES%\Microsoft SDKs\Windows\v7.1\Lib

  set OSGEO4W_ROOT=C:\OSGeo4W

  call "%OSGEO4W_ROOT%\bin\o4w_env.bat"

  path %PATH%;%PROGRAMFILES(x86)%\CMake\bin;C:\cygwin\bin;%PROGRAMFILES(x86)%\Microsoft Visual Studio 10.0\Common7\IDE

  @set GRASS_PREFIX=c:/OSGeo4W/apps/grass/grass-6.4.4

  @set GRASS_PREFIX7=c:/OSGeo4W/apps/grass/grass-7.0.4

  @set SIP_BINARY_PATH=%OSGEO4W_ROOT%/apps/Python27/sip.exe

  @set QWT_LIBRARY=%OSGEO4W_ROOT%/lib/qwt.lib

  @set SIP_BINARY_PATH=%OSGEO4W_ROOT%/bin/sip.exe

  @set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\include

  @set LIB=%LIB%;%OSGEO4W_ROOT%\lib;%OSGEO4W_ROOT%\lib


  @cmd

PART4: CMAKE

I enter CMD from the batch file created and I write:

cmake-gui

I select where the source is,and where to build the binaries

I press configure and i got this log:

  • Check for working C compiler using: Visual Studio 10
  • Check for working C compiler using: Visual Studio 10 -- works
  • Detecting C compiler ABI info
  • Detecting C compiler ABI info - done
  • Check for working CXX compiler using: Visual Studio 10
  • Check for working CXX compiler using: Visual Studio 10 -- works
  • Detecting CXX compiler ABI info
  • Detecting CXX compiler ABI info - done
  • QGIS version: 2.16.3 Nødebo (21603)
  • Found GRASS 6: c:/OSGeo4W/apps/grass/grass-6.4.4 (6.4.4, off_t size = )
  • Found GRASS 7: c:/OSGeo4W/apps/grass/grass-7.0.4 (7.0.4, off_t size = 8)
  • Found Proj: C:/OSGeo4W/lib/proj.lib
  • Found GEOS: C:/OSGeo4W/lib/geos_c.lib (3.5.0)
  • Found GDAL: C:/OSGeo4W/lib/gdal_i.lib (2.1.1)
  • Found Expat: C:/OSGeo4W/lib/libexpat.lib
  • Found Spatialindex: C:/OSGeo4W/lib/spatialindex_i.lib
  • Found Qwt: C:/OSGeo4W/lib/qwt.lib (6.0.2)
  • Found Sqlite3: C:/OSGeo4W/lib/sqlite3_i.lib
  • Found PostgreSQL: C:/OSGeo4W/lib/libpq.lib
  • Found SpatiaLite: C:/OSGeo4W/lib/spatialite.lib
  • Looking for gaiaDropTable in C:/OSGeo4W/lib/spatialite.lib
  • Looking for gaiaDropTable in C:/OSGeo4W/lib/spatialite.lib - not found
  • Looking for gaiaStatisticsInvalidate in C:/OSGeo4W/lib/spatialite.lib
  • Looking for gaiaStatisticsInvalidate in C:/OSGeo4W/lib/spatialite.lib
  • not found
  • Looking for spatialite_init_ex in C:/OSGeo4W/lib/spatialite.lib
  • Looking for spatialite_init_ex in C:/OSGeo4W/lib/spatialite.lib - not found
  • Qt WebKit support enabled
  • Looking for Q_WS_X11
  • Looking for Q_WS_X11 - not found.
  • Looking for Q_WS_WIN
  • Looking for Q_WS_WIN - found
  • Looking for Q_WS_QWS
  • Looking for Q_WS_QWS - not found.
  • Looking for Q_WS_MAC
  • Looking for Q_WS_MAC - not found.
  • Found Qt4: C:/OSGeo4W/bin/qmake.exe (found suitable version "4.8.6", required is "4.8.0")
  • Found Qt version: 4.8.6
  • Touch support disabled
  • Found QScintilla2: C:/OSGeo4W/lib/qscintilla2.lib (2.8.4)
  • Found QCA: C:/OSGeo4W/lib/qca.lib (2.1.0)
  • Pedantic compiler settings enabled
  • Found PythonInterp: C:/OSGeo4W/bin/python.exe (found suitable version "2.7.4", required is "2.7")
  • Found Python executable: C:/OSGeo4W/bin/python.exe
  • Found Python version: 2.7.4
  • Found Python library: C:/OSGeo4W/apps/Python27/libs/python27.lib
  • Found PyQt4 version: 4.11.3
  • Found SIP version: 4.16.5
  • Found QScintilla2 PyQt module: 2.8.4
  • Found GSL: C:/OSGeo4W/lib/gsl.lib;C:/OSGeo4W/lib/cblas.lib
  • txt2tags not found - disabled
  • Ctest Binary Directory set to: C:/AGIS/output/bin
  • Configuring done

PART5: VCEXPRESS

I get these error when i build "ALL-BUILD" after accessing visual studio from cmd "vcexpress":

106 Errors:

  • qgsaggregatecalulator.cpp Warning C4702: unreachable code
  • qgsqml.cpp Warning C4389: signed/unsigned mismatch
  • qlist.h Warning C4127: conditional expression is constant
  • qhash.h Warning C4127: conditional expression is constant
  • qvector.h Warning C4127: conditional expression is constant
  • qmap.h Warning C4127: conditional expression is constant

24064 Warning

  • Spatialite.lib
  • qgis_core.dll
  • Microsoft.Common.targets

PART6: NSIS

If i try to get the binary installer for windows, i get this error when he unpack the downloaded packages: error Please help me to get an installer for windows, my objective is to add custom plugins and QIG template and repack in an windows installer so I can give it to my friends.

  • Are you sure you want to build just so you can package QGIS + some plugins? You could use installer builder software EXE to MSI is on that package the normal installer + anything extra you need. – Nathan W Sep 26 '16 at 0:11
  • i dont want to add plugins only, i want to change everything i can to help the user to design better in QGIS . However i need for that understand well how the building process works, and i prefer to learn for windows if the posibility exist rather that linux – IceTorm Sep 26 '16 at 1:10
  • Are you building for 64 bit or 32? If you're building for 64 then you will need to use OSGEO4W 64 and cywgin 64, not 32. – ndawson Sep 26 '16 at 2:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.