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: Xypron
Subject: Re: [Help-glpk] Re: libglpk0: excessive install dependencies
Date: Fri, 14 Mar 2008 19:24:30 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.8.1.12) Gecko/20080201 SeaMonkey/1.1.8

Hello Vijay,

I am currently implementing using dynamic load libraries for linux.

My idea is to try to load MySQL and iODBC in mpl_initialize and to unload the libraries in mpl_terminate. I want to use library ltdl to gain support for most Linux like operating systems. I plan to use #ifdef WIN32 to use loadlibrary instead of lt_dlopenext, etc. when compiling with windows.

Best regards

Xypron




vijay patil wrote:


On Thu, Mar 13, 2008 at 11:02 PM, vijay patil <address@hidden <mailto: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 <http://msdn2.microsoft.com/en-us/library/ms681914%28VS.85%29.aspx>

LoadLibrary Function
http://msdn2.microsoft.com/en-us/library/ms684175(VS.85).aspx <http://msdn2.microsoft.com/en-us/library/ms684175%28VS.85%29.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]