I would like to ask how to use the static link library of Mathgl in my program.
Now, I use "-Lmathgl-2.4.4.LGPL-mingw.win64/lib -lmgl" in my project, compile and links can be completed to generate execute file, but when i run execute file, it tell me find not "libmgl.dll", why?
I clearly tell the linker to use the static library in path "mathgl-2.4.4.LGPL-mingw.win64/lib/libmgl.a", but in the end, the dynamic link library is used.
How I to link static library?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For anyone facing similar issue, to use static build of mathGL in your application, EXPORT can be disabled from your CMake target as
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE mgl_EXPORTS=0)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I would like to ask how to use the static link library of Mathgl in my program.
Now, I use "-Lmathgl-2.4.4.LGPL-mingw.win64/lib -lmgl" in my project, compile and links can be completed to generate execute file, but when i run execute file, it tell me find not "libmgl.dll", why?
I clearly tell the linker to use the static library in path "mathgl-2.4.4.LGPL-mingw.win64/lib/libmgl.a", but in the end, the dynamic link library is used.
How I to link static library?
Of course, I also added "-DMGL_STATIC_DEFINE" macro definition
Were you able to solve it. I'm too facing similar issue, bin contains libmgl-wx.dll and libmgl.dll, even though static flag is set
Last edit: vktrax 2022-03-08
For anyone facing similar issue, to use static build of mathGL in your application, EXPORT can be disabled from your CMake target as
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE mgl_EXPORTS=0)