Re: [Mingw-w64-public] mingw And dlopen

2021-03-06 Thread Biswapriyo Nath
In Microsoft Windows platform, LoadLibrary function is used to load DLLs
dynamically. Some projects do like this:

#ifdef _WIN32
ret = LoadLibrary(...)
#else
ret = dlopen(...)
#endif

If you want to use dlopen() in Microsoft Windows platform there is an
unofficial wrapper repository here
https://github.com/dlfcn-win32/dlfcn-win32.git.

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


Re: [Mingw-w64-public] mingw And dlopen

2021-03-06 Thread Vincent Torri
Hello

On Sat, Mar 6, 2021 at 8:48 AM Thomas Dineen  wrote:
>
> Gentle People:
>
>   Do any of you have experience with Mingw gcc and dlopen for
> dynamic (under application
> program control) loading of libs. Specifically I am looking at passing
> externs into C functions
> included in a dll library. I have been able to make this work just fine
> using gcc on Solaris and
> CentOS Linux by simply including extern statements in the lib (.so)
> source outside the function.
> Now using Mingw gcc the externs seem to be ignored and I get undeclared
> variables errors.
>  Can any of you point me to a simple (and current) example of how to
> do this?
> Why is it so different from Solaris and Linux.
> PS I am totally burned out from surfing the web and not finding a simple
> and current
> way of doing this.

It's more a Windows question than mingw one

basically :

to load the DLL : LoadLibrary()
to get the function pointer of the function in your DLL : GetProcAddress()
to free resources : FreeLibrary()

example attached

I suggest that you download dependency walker [1] to see if your
functions in your  correctly exported

hth

Vincent Torri

[1] https://dependencywalker.com/

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] mingw And dlopen

2021-03-05 Thread Thomas Dineen

Gentle People:

 Do any of you have experience with Mingw gcc and dlopen for 
dynamic (under application
program control) loading of libs. Specifically I am looking at passing 
externs into C functions
included in a dll library. I have been able to make this work just fine 
using gcc on Solaris and
CentOS Linux by simply including extern statements in the lib (.so) 
source outside the function.
Now using Mingw gcc the externs seem to be ignored and I get undeclared 
variables errors.
    Can any of you point me to a simple (and current) example of how to 
do this?

Why is it so different from Solaris and Linux.
PS I am totally burned out from surfing the web and not finding a simple 
and current

way of doing this.

Thomas Dineen



___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public