Menu

Loading MathGL classes from .dll files only?

Help
2018-12-29
2018-12-30
  • Zachary1234

    Zachary1234 - 2018-12-29

    I am used to using #include to gain access to fields, methods, macros etc. from classes. What do I need to do
    to gain that access again from the MathGL 64 bit .dlls on 64 bit Windows C++? I am looking for a simple way
    to gain that original access again, without having to result to a complex loader like windows.h, which will force me to pick through for one function or variable at a time. What is the easy way to load up classes from the .dll files so that I can, in easy and direct terms, use the MathGL classes as easily as I would via #include?

     
  • Alexey Balakin

    Alexey Balakin - 2018-12-29

    Hi, I don't understand the question exactly. So, I'll try to answer at several points.

    You can link DLL's as usual. For MinGW you just need to provide linker option -lmgl (or even -lmgl.dll???) for linking libmgl.dll. Note, that you need put corresponding lib/*.a files to a place which MinGW is know, or use option -L for specifying the path explicitly.

    If you use MSVS or Borland compiler then you need to first create the import libraries for each required DLL's and link this import libraries. Note, that different compilers have different way and different format for import libraries. So, make it for yours compiler. Comment: lib/*.a work as import libraries for MinGW, whose format is standardized :).

    At this, you shouldn't warry about C++ classes, because all public of them use inline members only (which may call C function), and work by the same way in any compilers. Just #include the proper header file (like, #include mgl2/mgl.h).

     
  • Zachary1234

    Zachary1234 - 2018-12-30

    [Please delete this post.]

     

    Last edit: Zachary1234 2019-01-14

Log in to post a comment.