Hello Andrew, for Windows 32 two different calling conventions are used: __cdecl and __stdcall.
To use GLPK in conjunction with 32bit LibreOffice (or OpenOffice) Basic it is necessary to compile the GLPK library with __stdcall. Compilation with __stdcall can be achieved by using the /Gz compiler option for Visual Studio Express C++. Unfortunately this is not enough. All functions passed to qsort must use the __cdecl calling convention. On Github I have set up a repository with a patched GLPK 4.60 which allows both compiling with __cdecl and with __stdcall: https://github.com/xypron/glpk/tree/glpk-4.60-stdcall The essential patch is https://github.com/xypron/glpk/commit/471b8ee233da57391b0f4401380c0405f7ab2455 It adds a symbol CDECL that is defined in config.h and applied to the relevant comparison functions. I have also added a Makefile and build batch file but these are not essential. Could you, please, consider adding this CDECL symbol to GLPK 4.61. --- LibreOffice Basic and OpenOffice Basic support a subset of the Microsoft VBA language. The essential difference with regards to GLPK is the lack of the AddressOf operator. Hence hook and callback functions cannot be used. Best regards Heinrich Schuchardt _______________________________________________ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk