[PROJ] unresolved external symbol EARTH (windows)
Even Rouault
even.rouault at spatialys.com
Wed Jul 14 09:10:52 PDT 2021
I guess there must be a way, at least for projects using PROJ CMake
file, to have the PROJ target define PROJ_MSVC_DLL_IMPORT for dynamic
builds. That would be welcome as a PR
Le 14/07/2021 à 18:02, Javier Jimenez Shaw a écrit :
> This issue is about the same topic:
> https://github.com/OSGeo/PROJ/issues/1821
> <https://github.com/OSGeo/PROJ/issues/1821>
> that "stale" closed after 2 months of inactivity.
>
> .___ ._ ..._ .. . ._. .___ .. __ . _. . __.. ... .... ._ .__
> Entre dos pensamientos racionales
> hay infinitos pensamientos irracionales.
>
>
>
> On Wed, 14 Jul 2021 at 12:56, Even Rouault <even.rouault at spatialys.com
> <mailto:even.rouault at spatialys.com>> wrote:
>
> Javier,
>
> the symbol is CPL_DLL exported and defined in static.cpp. You
> don't mention which type of linking you use: dynamic / static.
>
> You may perhaps need to define PROJ_MSVC_DLL_IMPORT.
>
> See the following in proj.h
>
> #ifndef PROJ_DLL
> #ifdef PROJ_MSVC_DLL_EXPORT
> #define PROJ_DLL __declspec(dllexport)
> #elif defined(PROJ_MSVC_DLL_IMPORT)
> #define PROJ_DLL __declspec(dllimport)
> #elif defined(__GNUC__)
> #define PROJ_DLL __attribute__ ((visibility("default")))
> #else
> #define PROJ_DLL
> #endif
> #endif
>
> Even
>
>
> Le 14/07/2021 à 12:33, Javier Jimenez Shaw a écrit :
>> Hi all
>>
>> I am using PROJ 8.1.0 in C++ in a library. While linking the unit
>> test in Windows (no problem in Ubuntu or macOS), I get this error
>> message:
>>
>> psrs.lib(SrsCatalog.cpp.obj) : error LNK2019: unresolved external
>> symbol "public: static class std::basic_string<char,struct
>> std::char_traits<char>,class std::allocator<char> > const
>> osgeo::proj::datum::Ellipsoid::EARTH"
>> (?EARTH at Ellipsoid@datum at proj@osgeo@@2V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@B)
>> referenced in function "public: void __cdecl
>> pd::srs::SrsCatalog::Impl::populate(void)"
>> (?populate at Impl@SrsCatalog at srs@pd@@QEAAXXZ)
>>
>> In the same function I am using proj methods like getCRSInfoList
>> or createCoordinateReferenceSystem, but not another constant.
>>
>> Do I have to do anything special to use/link that? Or is it a
>> problem in PROJ?
>> This happens in the CI machine. I do not have a Windows local
>> computer to reproduce it.
>>
>> I solved it easily not using the variable
>> osgeo::proj::datum::Ellipsoid::EARTH, but the string "Earth".
>> However, it could be interesting if there is any problem in proj
>> code.
>>
>> Thanks,
>> Javier
>> .___ ._ ..._ .. . ._. .___ .. __ . _. . __.. ... .... ._ .__
>> Entre dos pensamientos racionales
>> hay infinitos pensamientos irracionales.
>>
>>
>> _______________________________________________
>> PROJ mailing list
>> PROJ at lists.osgeo.org <mailto:PROJ at lists.osgeo.org>
>> https://lists.osgeo.org/mailman/listinfo/proj <https://lists.osgeo.org/mailman/listinfo/proj>
>
> --
> http://www.spatialys.com <http://www.spatialys.com>
> My software is free, but my time generally not.
>
> _______________________________________________
> PROJ mailing list
> PROJ at lists.osgeo.org <mailto:PROJ at lists.osgeo.org>
> https://lists.osgeo.org/mailman/listinfo/proj
> <https://lists.osgeo.org/mailman/listinfo/proj>
>
--
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20210714/c6a27d87/attachment-0001.html>
More information about the PROJ
mailing list