<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>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<br>
    </p>
    <div class="moz-cite-prefix">Le 14/07/2021 à 18:02, Javier Jimenez
      Shaw a écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:CADRrdKuynr_Emk6cWGER33yceJFfqYUoOTE9j3BsDWW-3TBC=A@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>This issue is about the same topic: <a
            href="https://github.com/OSGeo/PROJ/issues/1821"
            moz-do-not-send="true">https://github.com/OSGeo/PROJ/issues/1821</a></div>
        <div>that "stale" closed after 2 months of inactivity.</div>
        <div><br>
        </div>
        <div>
          <div>
            <div dir="ltr" class="gmail_signature"
              data-smartmail="gmail_signature">.___ ._ ..._ .. . ._. 
              .___ .. __ . _. . __..  ... .... ._ .__<br>
              Entre dos pensamientos racionales <br>
              hay infinitos pensamientos irracionales.<br>
              <br>
            </div>
          </div>
          <br>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Wed, 14 Jul 2021 at 12:56,
          Even Rouault <<a href="mailto:even.rouault@spatialys.com"
            moz-do-not-send="true">even.rouault@spatialys.com</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div>
            <p>Javier,</p>
            <p>the symbol is CPL_DLL exported and defined in static.cpp.
              You don't mention which type of linking you use: dynamic /
              static.</p>
            <p>You may perhaps need to define PROJ_MSVC_DLL_IMPORT.</p>
            <p>See the following in proj.h<br>
            </p>
            <p>#ifndef PROJ_DLL<br>
              #ifdef PROJ_MSVC_DLL_EXPORT<br>
              #define PROJ_DLL __declspec(dllexport)<br>
              #elif defined(PROJ_MSVC_DLL_IMPORT)<br>
              #define PROJ_DLL __declspec(dllimport)<br>
              #elif defined(__GNUC__)<br>
              #define PROJ_DLL __attribute__ ((visibility("default")))<br>
              #else<br>
              #define PROJ_DLL<br>
              #endif<br>
              #endif<br>
            </p>
            <p>Even</p>
            <p><br>
            </p>
            <div>Le 14/07/2021 à 12:33, Javier Jimenez Shaw a écrit :<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">
                <div>Hi all<br>
                </div>
                <div><br>
                </div>
                <div>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:<br>
                </div>
                <div><br>
                </div>
                <div><span style="font-family:monospace">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@Ellipsoid@datum@proj@osgeo@@2V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@B)
                    referenced in function "public: void __cdecl
                    pd::srs::SrsCatalog::Impl::populate(void)"
                    (?populate@Impl@SrsCatalog@srs@pd@@QEAAXXZ)</span></div>
                <div><br>
                </div>
                <div>In the same function I am using proj methods like
                  getCRSInfoList or createCoordinateReferenceSystem, but
                  not another constant.<br>
                </div>
                <div><br>
                </div>
                <div>Do I have to do anything special to use/link that?
                  Or is it a problem in PROJ?</div>
                <div>This happens in the CI machine. I do not have a
                  Windows local computer to reproduce it.</div>
                <div><br>
                </div>
                <div>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.</div>
                <div><br>
                </div>
                <div>Thanks,</div>
                <div>Javier<br>
                </div>
                <div>
                  <div dir="ltr">.___ ._ ..._ .. . ._.  .___ .. __ . _.
                    . __..  ... .... ._ .__<br>
                    Entre dos pensamientos racionales <br>
                    hay infinitos pensamientos irracionales.<br>
                    <br>
                  </div>
                </div>
              </div>
              <br>
              <fieldset></fieldset>
              <pre>_______________________________________________
PROJ mailing list
<a href="mailto:PROJ@lists.osgeo.org" target="_blank" moz-do-not-send="true">PROJ@lists.osgeo.org</a>
<a href="https://lists.osgeo.org/mailman/listinfo/proj" target="_blank" moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/proj</a>
</pre>
            </blockquote>
            <pre cols="72">-- 
<a href="http://www.spatialys.com" target="_blank" moz-do-not-send="true">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
          </div>
          _______________________________________________<br>
          PROJ mailing list<br>
          <a href="mailto:PROJ@lists.osgeo.org" target="_blank"
            moz-do-not-send="true">PROJ@lists.osgeo.org</a><br>
          <a href="https://lists.osgeo.org/mailman/listinfo/proj"
            rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/proj</a><br>
        </blockquote>
      </div>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
  </body>
</html>