[PROJ] unresolved external symbol EARTH (windows)

Even Rouault even.rouault at spatialys.com
Wed Jul 14 03:56:17 PDT 2021


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
> 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/93bff302/attachment.html>


More information about the PROJ mailing list