<div dir="ltr"><div>Hello Longhui, <br></div><div><br></div><div>Not a VS expert but have you tried using the cwrap versions of these files? <br></div><div>
I got it to work on Windows with that method. <br></div><div>It is explained nicely here: <a href="https://gitlab.onelab.info/gmsh/gmsh/tree/master/api">https://gitlab.onelab.info/gmsh/gmsh/tree/master/api</a><br></div><div><br></div><div>The following is taken from the relevant readme.md file: <br></div><div><br></div><div>"The additional file `gmsh.h_cwrap' redefines the C++ API in terms of the C API.<br>This is provided as a convenience for users of the binary Gmsh SDK whose C++<br>compiler ABI is not compatible with the ABI of the C++ compiler used to create<br>the SDK. To use these C++ bindings of the C API instead of the native C++ API,<br>simply rename `gmsh.h_cwrap' as `gmsh.h'. Note that this will lead to (slightly)<br>reduced performance compared to using the native Gmsh C++ API, as it entails<br>additional data copies between the C++ wrapper, the C API and the native C++<br>code."<br></div><div><br></div><div>The libgmsh.dll is essential for sure, not sure about the .lib. I also had to put the gmsh-3.0.dll in the same folder as my executable.</div><div>And if not, there's always Python!<br></div><div><br></div><div>Good luck!</div><div>Max Orok<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jul 29, 2018 at 10:55 AM, Li Longhui <span dir="ltr"><<a href="mailto:lilonghui@hotmail.com" target="_blank">lilonghui@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div link="#0563C1" vlink="#954F72" lang="ZH-CN">
<div class="m_-7644784921901788480WordSection1">
<p class="MsoNormal"><span lang="EN-US">Greetings,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">This is Longhui. <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I am evaluating the gmsh sdks with C/C++ on windows, and having problems linking the SDK libraries.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I am wondering if some experts can have a look? Thanks.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Here are what I have done<u></u><u></u></span></p>
<p class="m_-7644784921901788480MsoListParagraph" style="margin-left:39.0pt">
<u></u><span lang="EN-US"><span>1.<span style="font:7.0pt "Times New Roman"">
</span></span></span><u></u><span lang="EN-US">In Visual Studio 2015, create a function as below<u></u><u></u></span></p>
<p class="m_-7644784921901788480MsoListParagraph" style="margin-left:38.95pt;text-indent:0cm">
<span lang="EN-US"><u></u> <u></u></span></p>
<p class="m_-7644784921901788480MsoListParagraph" style="margin-left:38.95pt;text-indent:0cm">
<span lang="EN-US"><img style="width:4.0625in;height:1.7187in" id="m_-7644784921901788480_x56fe__x7247__x0020_1" src="cid:image002.png@01D4278C.851E09B0" width="390" height="165"></span><span lang="EN-US"><u></u><u></u></span></p>
<p class="m_-7644784921901788480MsoListParagraph" style="margin-left:39.0pt">
<u></u><span lang="EN-US"><span>2.<span style="font:7.0pt "Times New Roman"">
</span></span></span><u></u><span lang="EN-US">Configure the sdk include path and the sdk library path
<u></u><u></u></span></p>
<p class="m_-7644784921901788480MsoListParagraph" style="margin-left:38.95pt;text-indent:0cm">
<span lang="EN-US"><img style="width:5.9166in;height:1.552in" id="m_-7644784921901788480_x56fe__x7247__x0020_2" src="cid:image004.jpg@01D4278E.A4312330" width="568" height="149"></span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">The codes can be built without compiling errors, but having linkage errors
<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:31.5pt"><span lang="EN-US"><img style="width:9.4375in;height:1.4062in" id="m_-7644784921901788480_x56fe__x7247__x0020_3" src="cid:image007.jpg@01D4278E.A4312330" width="906" height="135"></span><span lang="EN-US"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I have tried with both 32-bit and 64-bit sdks, and they have behaved exactly same.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Should I have the Can I have the two files
<u></u><u></u></span></p>
<p class="MsoNormal" style="text-indent:21.0pt"><span lang="EN-US">libgmsh.dll<u></u><u></u></span></p>
<p class="MsoNormal" style="text-indent:21.0pt"><span lang="EN-US">libgmsh.lib<u></u><u></u></span></p>
<p class="MsoNormal" style="text-indent:21.0pt"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Do we need a libgmsh.dll and libgmsh.lib file?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Any advices will be greatly appreciated/<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks Much, <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Longhui<u></u><u></u></span></p>
</div>
</div>
<br>______________________________<wbr>_________________<br>
gmsh mailing list<br>
<a href="mailto:gmsh@onelab.info">gmsh@onelab.info</a><br>
<a href="http://onelab.info/mailman/listinfo/gmsh" rel="noreferrer" target="_blank">http://onelab.info/mailman/<wbr>listinfo/gmsh</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Max Orok<br></div><div>Summer Student<br></div><a href="http://www.mevex.com" target="_blank">www.mevex.com</a><br><br><img src="https://docs.google.com/uc?export=download&id=1fHTIiW4OMUjQr1iOkspQ7wiEsxunoOs0&revid=0B6x5w-5zVaEjSkpwbm5oY29jbG1XMzJoYldXTmJpNGFtb3dVPQ" width="164" height="42"><br></div></div></div></div>
</div>