8

I try setup a QGIS debug environment under Windows10 64bit. I followed the instrictions given at https://github.com/qgis/QGIS/blob/master/INSTALL#L423

I also had a look at https://www.shaeffer.co/compiling-qgis-on-windows/ and https://www.cursosgis.com/compilar-y-debuggear-qgis-en-windows/

When I try to start debugging in Visual Studio I get following error message:

Could not load qgis_app.dll
module not found
Check D:\Projects\QGIS\ms-windows\osgeo4w\build-qgis-test-x86_64\output\bin\RelWithDebInfo\qgis.env for correct environment paths.

The qgis_app.dll exists in the QGIS\ms-windows\osgeo4w\build-qgis-test-x86_64\output\bin\RelWithDebInfo folder.

During the build there is a crash of the crssync.exe which is called during the build:

Problemsignatur:
  Problemereignisname:  APPCRASH
  Anwendungsname:   crssync.exe
  Anwendungsversion:    0.0.0.0
  Anwendungszeitstempel:    5ddd3d2f
  Fehlermodulname:  qgis_core.dll
  Fehlermodulversion:   6.3.9600.19464
  Fehlermodulzeitstempel:   5d6727f2
  Ausnahmecode: c0000135
  Ausnahmeoffset:   00000000000ecf30
  Betriebsystemversion: 6.3.9600.2.0.0.272.7
  Gebietsschema-ID: 1031
  Zusatzinformation 1:  ac05
  Zusatzinformation 2:  ac0507478d1c5bd693cfc4fe3987e900
  Zusatzinformation 3:  ac05
  Zusatzinformation 4:  ac0507478d1c5bd693cfc4fe3987e900

What can I do to narrow down the source of the error and get Visual Developer to build the ALL_Build successfully?

The error messages vary. often the module syncsrsdb and qgis_core fail but sometimes also other modules cause trouble: One example for error messages:

    129>------ Build started: Project: qgis_authcryptotest, Configuration: RelWithDebInfo x64 ------
127>       CustomBuild:
127>         Running crssync
127>     1>
127>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code -1073741515.
127>
127>Build FAILED.

C:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\um\x86\Version.Lib : warning LNK4272: library machine type 'X86' conflicts with target machine type 'x64'

C:\Projects\QGIS\ms-windows\osgeo4w\build-qgis-test-x86_64\output\bin\RelWithDebInfo\qgis_core.dll : fatal error LNK1120: 3 unresolved externals

One message looks like a problem caused by a mixture between 32bit and 64 bit components

("C:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\um\x86\Version.Lib : warning LNK4272: library machine type 'X86' conflicts with target machine type 'x64'")

but I could not find any special 64 bit versions of the Windows SDK

20
  • Please always provide errors as formatted text rather than pictures.
    – PolyGeo
    Nov 6, 2019 at 19:53
  • Have you checked the qgis.env file mentioned?
    – til_b
    Nov 25, 2019 at 10:32
  • @til_b: I have running debug enviroments where qtcreator is used instead of visual studio and there is also no *.env file, so I guess the qgis.env file ist not neccessary for debugging
    – Thomas B
    Nov 25, 2019 at 10:38
  • 2
    I'll try the new dev branch then.
    – Fran Raga
    Nov 27, 2019 at 8:34
  • 1
    I will write down my notes for debugging with QTCreator as soon as I have done the setup again one a different PC. during my current setup I changed settings /setup so often until it worked that I need to recap the proper steps ;-)
    – Thomas B
    Dec 3, 2019 at 14:58

1 Answer 1

5
+150

I put as an answer the steps I've followed.

You have to follow my notes described in this post, BUT you will have to make some changes.

When you open the Visual Studio solution with the devenv command, DON'T DO THE BUILD, wait a bit.

Go to qgis_core properties and add Version.lib

Now do the build and go out for a drink as this takes a long time.

enter image description here

To debug remember to have the symbols installed and placed in your project

enter image description here

and in the project

enter image description here

In my case I also have installed the Qt plugin for Visual studio 2015.

enter image description here

And run debug.

enter image description here

I'm using this version, updated yesterday and Windows 10 64 bits

https://github.com/All4Gis/QGIS

https://github.com/All4Gis/QGIS/commit/e75d0f858687808c51d4578c94001b63c6eee233

I hope it helps.

2
  • It's strange that only half of the bounty is awarded even if the answer is marked as correct. I thought I would have 6 days to award the bounty manually but in my inbox there is a message ..."answer auto-selected"
    – Thomas B
    Dec 3, 2019 at 21:18
  • You have to accept the answer within bounty's period, not afterwards.
    – Fran Raga
    Dec 4, 2019 at 11:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.