[PROJ] Test failure when building on Windows

Asa Packer APacker at biosonicsinc.com
Tue Oct 22 17:27:17 PDT 2019


Hi Even,

Thanks for your quick response - it was very helpful to see what options the vcpkg sqlite is built with.  For the record, I'm now pretty sure that my issue is related to static linking to sqlite.  I was building a shared lib of proj but linking it to a static sqlite3.lib that I had compiled without marking the sqlite functions as exported.  Since the proj_test_cpp_api exe was also statically linking to sqlite3.lib, I think I had two separate instances of sqlite3 in my process.  So the in-memory db created in the exe was not attaching properly to the in-memory db being used inside proj.

I can get the test to pass by compiling my static sqlite3.lib with "-DSQLITE_API=__declspec(dllexport)", so the sqlite functions end up showing as exports from the proj dll.  In this case, proj_test_cpp_api.exe should probably not be linking to the sqlite3.lib also, but it still seems to work, perhaps because the proj lib is listed before the sqlite lib in the linker input.  The other way I can get the test to pass is by just building sqlite3 as a dll.

Asa

Asa Packer  | Lead Systems Engineer

BioSonics, Inc. 
2356 W Commodore Way, Unit 110
Seattle WA 98199-1258 USA
tel 206.782.2211 |  biosonicsinc.com

-----Original Message-----
From: Even Rouault <even.rouault at spatialys.com> 
Sent: Tuesday, October 22, 2019 1:29 PM
To: proj at lists.osgeo.org
Cc: Asa Packer <APacker at biosonicsinc.com>
Subject: Re: [PROJ] Test failure when building on Windows

Hi,

yes not sure what's wrong on your end, but PROJ AppVeyor continuous integration builds use sqlite 3.30.1 from vcpkg and the tests pass fine.

Even

> Hello,
> 
> I am working with proj 6.2.0 on Windows, have gotten it to build using 
> Visual Studio 2017, and all tests pass except one when I run ctest.  
> It is the "factory.attachExtraDatabases_auxiliary" test in proj_test_cpp_api.
> The error message printed is:
> 
> unknown file: error: C++ exception with description "geodeticCRS not found"
> thrown in the test body.
> 
> I am building proj with the sqlite code from 
> sqlite-amalgamation-3300100.zip, which is the latest version of sqlite 
> as of today.
> 
> The only way I have managed to get the test to pass is if I change 
> line 2471 of proj-6.2.0/test/unit/test_factory.cpp to remove the "mode=memory"
> setting.
> 
> I'm at a loss how to troubleshoot this.  Is this a proj issue, a 
> sqlite issue, or perhaps most likely, an issue with my build?  Any 
> advice/suggestions would be much appreciated.
> 
> Thanks!
> 
> Asa
> Asa Packer  | Lead Systems Engineer
> 
> BioSonics, Inc.
> 2356 W Commodore Way, Unit 110
> Seattle WA 98199-1258 USA
> tel 206.782.2211 |  biosonicsinc.com<http://www.biosonicsinc.com/>


--
Spatialys - Geospatial professional services http://www.spatialys.com


More information about the PROJ mailing list