<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Dear Tobias,</p>
<p>I have looked and looked at this and don't have any idea why
there would be linking issues. I could guess what is causing it.
The method setUserDisclaimerConfirmed is implemented inline in the
header file, so it will be outside the DLL and in your client code
and it is trying to reference a static member of the InstallMgr
class. But we already declare class InstallMgr
_declspec(dllimport). You can see this in defs.h:</p>
<p>...</p>
<p>// _declspec works in BC++ 5 and later, as well as VC++<br>
#if defined(_MSC_VER)<br>
<br>
# ifdef SWMAKINGDLL<br>
# define SWDLLEXPORT _declspec( dllexport )<br>
</p>
<p>Note a couple things: we use a single underscore. Looking this
up, it seems a single underscore is the older way to do this now
that newer versions of the C++ spec reserve double underscores for
things like this, but it still works. Also, you might check that
_MSC_VER is defined and that SWMAKINGDLL is defined in your build
system when you build the DLL and that SWUSINGDLL is defined in
your build system when you link your client to the DLL. -- from
looking at defs.h lines 62ff.</p>
<p>BUT HAVING SAID ALL THIS, I have no idea why you would be able to
link to ANY methods in the DLL if this wasn't all correct. I
don't see anything different with the static bool
InstallMgr::userDisclaimerConfirmed compared to any of the other
methods or statics. Can you access any other static member of a
class? How about trying to link with a reference to:</p>
<p>InstallMgr::MODSTAT_OLDER;</p>
<p>And then maybe try a static from another class:</p>
<p>SWMgr::MODTYPE_BIBLES;</p>
<p><br>
</p>
<p>Thanks for any more info you might provide on this.</p>
<p>Troy<br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 9/22/20 11:57 AM, Tobias Klein
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:E1kKf1D-0001Fj-HO@smtprelay06.ispgateway.de">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
font-size:10.0pt;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";}
span.pre
{mso-style-name:pre;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style>
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">I’ve gone for an
alternative implementation as a work-around. Before, I was
calling InstallMgr::setUserDisclaimerConfirmed. That caused
the linking issue on Windows. I’ve now switched to
inheriting InstallMgr with a custom method
“isUserDisclaimerConfirmed”.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Best regards,<br>
Tobias</span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div
style="mso-element:para-border-div;border:none;border-top:solid
#E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="border:none;padding:0cm"><b>From:
</b><a href="mailto:contact@tklein.info"
moz-do-not-send="true">Tobias Klein</a><br>
<b>Sent: </b>Montag, 21. September 2020 21:58<br>
<b>To: </b><a href="mailto:sword-devel@crosswire.org"
moz-do-not-send="true">SWORD Developers' Collaboration
Forum</a><br>
<b>Subject: </b>Re: [sword-devel] Latest SWORD trunk /
Linkingerror/Missingsymbol:sword::InstallMgr::userDisclaimerConfirmed</p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal"
style="line-height:14.25pt;background:white"><span
style="color:black" lang="EN-US">I tried to fix this
by setting the CMake variable </span><span
style="color:black">CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE<o:p></o:p></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:white"><span
style="color:black"><a
href="https://cmake.org/cmake/help/v3.4/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html"
moz-do-not-send="true">https://cmake.org/cmake/help/v3.4/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html</a><o:p></o:p></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:white"><span
style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:white"><span
style="color:black">But that didn’t help! I still get
the same linker issue.<o:p></o:p></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:white"><span
style="color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:white"><span
style="color:black">However, in the above linked Cmake
help it says: </span><i><span
style="color:#444444;background:white">For global </span></i><em><span
style="font-family:"Calibri",sans-serif;color:#444444;background:white;font-style:normal">data</span></em><i><span
style="color:#444444;background:white"> symbols, </span></i><span
class="pre"><i><span
style="color:#444444;background:#ECF0F3">__declspec(dllimport)</span></i></span><i><span
style="color:#444444;background:white"> must still
be used when compiling against the code in the </span></i><span
class="pre"><i><span
style="color:#444444;background:#ECF0F3">.dll</span></i></span><i><span
style="color:#444444;background:white">.</span></i><i><span
style="color:black"> </span></i><i><span
style="color:#444444;background:white">All other
function symbols will be automatically exported and
imported by callers.<o:p></o:p></span></i></p>
</div>
</div>
</div>
<p class="MsoNormal"
style="line-height:14.25pt;background:white"><span
style="color:#444444;background:white"><o:p> </o:p></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:white"><span
style="color:#444444;background:white">Aren’t we dealing
with a „global data symbol“ in this case?<o:p></o:p></span></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:white"><i><span
style="color:#444444;background:white"><o:p> </o:p></span></i></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:white"><i><span
style="color:#444444;background:white">See also:<br>
<a
href="https://docs.microsoft.com/de-de/cpp/build/importing-into-an-application-using-declspec-dllimport?view=vs-2019"
moz-do-not-send="true">https://docs.microsoft.com/de-de/cpp/build/importing-into-an-application-using-declspec-dllimport?view=vs-2019</a><o:p></o:p></span></i></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:white"><i><span
style="color:#444444;background:white"><o:p> </o:p></span></i></p>
<p class="MsoNormal"
style="line-height:14.25pt;background:white"><span
style="color:#444444;background:white">Best regards,<br>
Tobias<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>From: </b><a
href="mailto:contact@tklein.info" moz-do-not-send="true">Tobias
Klein</a><br>
<b>Sent: </b>Montag, 21. September 2020 11:29<br>
<b>To: </b><a href="mailto:sword-devel@crosswire.org"
moz-do-not-send="true">SWORD Developers' Collaboration
Forum</a><br>
<b>Subject: </b>Re: [sword-devel] Latest SWORD trunk /
Linking
error/Missingsymbol:sword::InstallMgr::userDisclaimerConfirmed<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">I’m still having the
same issue with the latest SWORD trunk when linking on
Windows.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Since this wasn’t an
issue with SWORD trunk from May (SVN Rev. 3747), is there a
way to fix this in SWORD?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal">Best regards,<br>
Tobias<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>From: </b><a
href="mailto:contact@tklein.info" moz-do-not-send="true">Tobias
Klein</a><br>
<b>Sent: </b>Samstag, 29. August 2020 10:22<br>
<b>To: </b><a href="mailto:sword-devel@crosswire.org"
moz-do-not-send="true">SWORD Developers' Collaboration
Forum</a><br>
<b>Subject: </b>Re: [sword-devel] Latest SWORD trunk /
Linking error
/Missingsymbol:sword::InstallMgr::userDisclaimerConfirmed<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">This occurred to me when
building automatically via GitHub actions and that is always
a full-rebuild.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I had this problem also
in the past with manual Windows builds and the work-around
was to “re-declare” the respective symbol in the software
that links against Sword. I already had this issue before
with sword::SWBuf::nullStr:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#if defined(_WIN32)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">// For some reason this
symbol is missing in the sword.dll on Windows, hence we
include it here.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">char *
sword::SWBuf::nullStr = (char *)"";<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#endif<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Best regards,<br>
Tobias<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>From: </b><a
href="mailto:scribe@crosswire.org" moz-do-not-send="true">Troy
A. Griffitts</a><br>
<b>Sent: </b>Samstag, 29. August 2020 09:52<br>
<b>To: </b><a href="mailto:sword-devel@crosswire.org"
moz-do-not-send="true">SWORD Developers' Collaboration
Forum</a><br>
<b>Subject: </b>Re: [sword-devel] Latest SWORD trunk /
Linking error /
Missingsymbol:sword::InstallMgr::userDisclaimerConfirmed<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Hi Tobias,</p>
<p>This did receive a bit of a reorganization, but the symbol is
declared in include/installmgr.h:97 and is initialized with
the other statics in installmgr.cpp:75.</p>
<p>Have you tried a full rebuild?</p>
<p>Is anyone else having linking troubles?</p>
<p>Troy</p>
<p><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 8/29/20 9:20 AM, Tobias Klein wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-US">Hi Troy,</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Any feedback regarding
this one?</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Thanks!</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Best regards,<br>
Tobias</span><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>From: </b><a
href="mailto:contact@tklein.info" moz-do-not-send="true">Tobias
Klein</a><br>
<b>Sent: </b>Sonntag, 16. August 2020 11:10<br>
<b>To: </b><a href="mailto:sword-devel@crosswire.org"
moz-do-not-send="true">SWORD Developers' Collaboration
Forum</a><br>
<b>Subject: </b>[sword-devel] Latest SWORD trunk /
Linking error / Missing
symbol:sword::InstallMgr::userDisclaimerConfirmed<o:p></o:p></p>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">With the latest SWORD trunk I’m getting
the following linking error:<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Creating library
D:\a\ezra-project\ezra-project\node_modules\node-sword-interface\build\Release\node_sword_interface.lib
and object
D:\a\ezra-project\ezra-project\node_modules\node-sword-interface\build\Release\node_sword_interface.exp<o:p></o:p></p>
<p class="MsoNormal">repository_interface.obj : error LNK2001:
unresolved external symbol "public: static bool
sword::InstallMgr::userDisclaimerConfirmed"
(?userDisclaimerConfirmed@InstallMgr@sword@@2_NA)
[D:\a\ezra-project\ezra-project\node_modules\node-sword-interface\build\node_sword_interface.vcxproj]<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">The symbol
sword::InstallMgr::userDisclaimerConfirmed is missing in the
generated SWORD dll. Did something recently change regarding
this symbol or how it is included in the build (based on
CMake and Visual Studio 2019)?<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Best regards,<o:p></o:p></p>
<p class="MsoNormal">Tobias<o:p></o:p></p>
<p class="MsoNormal">_______________________________________________<o:p></o:p></p>
<p class="MsoNormal">sword-devel mailing list: <a
href="mailto:sword-devel@crosswire.org"
moz-do-not-send="true">sword-devel@crosswire.org</a><o:p></o:p></p>
<p class="MsoNormal"><a
href="http://www.crosswire.org/mailman/listinfo/sword-devel"
moz-do-not-send="true">http://www.crosswire.org/mailman/listinfo/sword-devel</a><o:p></o:p></p>
<p class="MsoNormal">Instructions to unsubscribe/change your
settings at above page<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<pre>_______________________________________________</pre>
<pre>sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org" moz-do-not-send="true">sword-devel@crosswire.org</a></pre>
<pre><a href="http://www.crosswire.org/mailman/listinfo/sword-devel" moz-do-not-send="true">http://www.crosswire.org/mailman/listinfo/sword-devel</a></pre>
</blockquote>
<pre style="mso-margin-top-alt:0cm;margin-right:36.0pt;margin-bottom:5.0pt;margin-left:36.0pt">Instructions to unsubscribe/change your settings at above page</pre>
<p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Courier New""><o:p> </o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
sword-devel mailing list: <a class="moz-txt-link-abbreviated" href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a>
<a class="moz-txt-link-freetext" href="http://crosswire.org/mailman/listinfo/sword-devel">http://crosswire.org/mailman/listinfo/sword-devel</a>
Instructions to unsubscribe/change your settings at above page</pre>
</blockquote>
</body>
</html>