<div dir="ltr"><div><div><div><div><div><div><div><div>Dear gmsh team,<br><br></div>First of all, I would like to congratulate your very nice job. You have made a very useful and powerful tool, and I would like to thank you for sharing it with all of us.<br>
<br></div>I am a little stuck with your program. I would like to be able to compile your gmsh as a DLL, for later use in a windows application. I am just interested in using some of the methods of your software for meshing a geometry, because I would use a personal solver to actually resolve the FEM. For that reason, Iīm not interested in using the FLTK interface. So I downloaded the source code of gmsh (2.8.2), and with the help of CMake I unchecked FLTK and checked the DLL and LIB options. Once I had it configured, I opened it with Visual Studio 2008 and tried to compile it. Though it gave me some errors, I actually was able to obtain the files I wanted.<br>
<br></div>The problem comes when I try to import these LIB or DLL in another MAIN project I added to the solution. Iīve added the source code to predefined directories, added the references and even linked the library gmshd.lib (Linker-<input-additional dependencies). So to see if it works I copied the code of MainSimple.cpp (contained in utils/appi_demos). When trying to compile it gives to me the famous linking error LNK2019.<br>
</div>So after trying everything already posted in forums regarding that errors, I have few questions:<br></div>- I didnīt find any .DEF file. I didnīt see in any header nor cpp file the "extern 'C'" or the "_declspec(dllexport)" directive anywhere, so Iīm not sure if the DLL is done correctly. Does CMake already prepares this?<br>
-By the way, shouldnīt I obtain a LIB file (export library) as well as the DLL in order to link it to the new project? If not, how can I use it in my program?<br>- Did I make any mistake at compiling with CMake? (Iīve never used CMake and it took me a while to understand how it works, what does it do and how to configure it).<br>
</div><div>-I am not able to add directly the DLL as a reference, it gives me many errors (as it is in machine language already compiled I doubt if VS understands it) and furthermore it says it canīt find the gmsh.lib (actually it just creates the gmsh.dll but Iīm missing the exporting LIB file. The correct way would be adding the LIB file which is related to the DLL instead of adding the DLL itself, am I right? How would I do it without the DLL?<br>
</div><div><br></div><div>I would like to use the libraries cause, if possible, I would like to pass directly from my application a string with all the content of the GEO file to gmsh, then mesh it and receive back the MSH file but in a string form. I know that I must adapt some of the source code of gmsh before doing this, but the first thing I would need to do is being able to use gmsh methods in another project.<br>
</div><div><br></div>Any help you could provide would be very appreciated. Thank you very much in advance.<br><br></div>Regards,<br><br></div>Kim<br><div><div><div><pre><br></pre><pre><br></pre></div></div></div></div>