help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] Re: libglpk0: excessive install dependencies


From: vijay patil
Subject: Re: [Help-glpk] Re: libglpk0: excessive install dependencies
Date: Fri, 14 Mar 2008 20:35:31 +0530



On Thu, Mar 13, 2008 at 11:02 PM, vijay patil <address@hidden> wrote:
It would be nice to have this change (i.e. explicitly loading the dynamic library/shared object related to table feature in MathProg) work on MS Windows.

I ported example on page http://linux.die.net/man/3/dlopen to windows. We will need to use ifdefs at come places (loading, unloading, and getting function address), but actual function invocation is OS independent. I have tested program below on Windows XP and it works as expected.

I forgot to post to reference links (for code) yesterday, here :

About Dynamic-Link Libraries
http://msdn2.microsoft.com/en-us/library/ms681914(VS.85).aspx

LoadLibrary Function
http://msdn2.microsoft.com/en-us/library/ms684175(VS.85).aspx

-------------------------------
Example just demonstrates how to invoke simple function (like cos). I wonder how to define a pointer to a structure (that is) defined in dynamic lib/shared object.

For example, in file glpsql.c (in libglpk-4.27) we have:

   MYSQL           *con;   //connection
   MYSQL_RES       *res;    //result

These pointers are used to store return values of MySQL functions like mysql_init. Structures MYSQL and MYSQL_RES are defined in libmySQL.dll. I think those pointers (con, res) have to be converted into void pointers, unless there is better way. I tried some simple C examples using void*, and seems to work.

--
Vijay Patil
reply via email to

[Prev in Thread] Current Thread [Next in Thread]