[Qgis-user] Debugging QGIS using MSVC

Sjur Kolberg Sjur.A.Kolberg at sintef.no
Fri Nov 13 00:14:27 PST 2009


Hello, Rob,

> Does anyone know what other dependencies are involved?

That depends, among other things, on what drivers you have included in your GDAL. Under Windows, there's an excellent program for this called depends.exe (a.k.a. Dependency Walker), which is either included with your MSVC or it can be downloaded from the net. Run it on your qgis.exe, and you'll find the complete dependency tree, and more. Useful to count the number of missing dlls, even more useful to verify that your program loads its dlls from the right files (spot debug/release + old version mixups).

Sjur  :-)

________________________________
From: qgis-user-bounces at lists.osgeo.org [mailto:qgis-user-bounces at lists.osgeo.org] On Behalf Of InterRob
Sent: 12. november 2009 10:56
To: qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] Debugging QGIS using MSVC

Hi All,

Thanks Jurgen & Sjur; that helped a bit.

I found the INSTALL.vcproj; it indeed copies the files to my Program Files folder (after I granted myself access; note the Vista/Windows 7 superuser system) by some cmake rules. I put the Qt binary folder in my path. Then still I need to copy some fies by hand; think of gdal, geos, proj, libpq.dll and some from the GnuWin32 dependencies (as instructed by the PDF manual dealing with building / compiling QGIS from source).

Anyhow, QGIS.exe now still complains about missing DLLs; currently: SSLEAY32.dll

Does anyone know what other dependencies are involved?

Thanks in advance for your reply,
Rob

2009/11/11 Sjur Kolberg <Sjur.A.Kolberg at sintef.no<mailto:Sjur.A.Kolberg at sintef.no>>
Rob,

I haven't actually built QGIS myself, but in general you need to make all necessary dlls available to your .exe file, also for debugging. This means in the same folder, or in a folder that's included in your path. Beware that these may include both dlls that you compile as a part of the QGIS solution, and pre-compiled dlls that you have downloaded in binary form.

It is quite common that multi-project solutions in Visual Studio put their binaries in project-specific folders, typically /Debug and /Release at the same level as each .vcproj file resides. This leaves it to you to (manually or by setting some poist-build events) copy all dlls and .exes into the right (common) place.

VS will always ask for executable when you try to debug a dll; naturally since a dll needs to be run by an application (.exe file). qgis.exe will be the natural choice here, be sure to pick the right of the debug or release version.

I tend to create a /bin catalogue (and a /debbin, for debug versions) at the solution directory level (where the .sln file is) , and either direct or copy the linker output (.dlls and .exes) here.

BTW, I also copy all .lib files to a common /lib folder (/deblib), and the .h files to a common /include folder, and make sure that either VS or all the projects look in these folders for libraries and include files. This seems to be OK in your case, if everyting builds nicely.

Good luck,

Sjur K :-)


________________________________
From: qgis-user-bounces at lists.osgeo.org<mailto:qgis-user-bounces at lists.osgeo.org> [mailto:qgis-user-bounces at lists.osgeo.org<mailto:qgis-user-bounces at lists.osgeo.org>] On Behalf Of InterRob
Sent: Wednesday, November 11, 2009 10:21 PM
To: qgis-user at lists.osgeo.org<mailto:qgis-user at lists.osgeo.org>
Subject: [Qgis-user] Debugging QGIS using MSVC

Dear list,

It has been quite a struggle to get QGIS to compile on my PC using MS Visual Studio 8 (2005). At the moment, it seems like all binaries compile correctly, but all in separate folders... Executing QGIS.exe ( (...)\qgis-1.3.0\build\src\app\debug\qgis.exe) results in a message of missing dlls.

How am I supposed to Run / Debug QGIS from MSVC? Pressing the "play" button, MSVC asks for which executable file to be used for the debug session.

Any help is appreciated. I guess I need some post-linking process that copies newly built QGIS files? And some more static Qt binaries.


Rob

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20091113/e5bcf0bf/attachment.html>


More information about the Qgis-user mailing list