I have a windows native DLL from which I need to execute functions, from within a GCC compiled linux executable. Could someone direct me to relevant docs for this ?
Thanks!!
Running windows DLL functions from GCC application
Re: Running windows DLL functions from GCC application
Simple answer - you can't.robiwan wrote:I have a windows native DLL from which I need to execute functions, from within a GCC compiled linux executable.
Longer answer - just build your program as win32 program and run inside Wine. Use mingw, to comile win32-pe binaries on Linux
Long answer - use winelib. But do understand that created binary will only run under Wine and only with specific Wine version. And it will not be a standalone app. That means you can not distribute your program by itself in binary format, but it will have to be packaged together with your Wine version.
Yes, winelib app can see both win32 API and POSIX API. But they do not coexist together well in all areas and you have to do extra work when mixing the two. Example: synchronization, files, GUI, network.
Re: Running windows DLL functions from GCC application
As the DLL I'll be calling merely does calculations, I hope to avoid those problems. But to dig in a bit, is it necessary to use winegcc to build a winelib application or would -lwine with gcc suffice ?vitamin wrote:Yes, winelib app can see both win32 API and POSIX API. But they do not coexist together well in all areas and you have to do extra work when mixing the two. Example: synchronization, files, GUI, network.
Re: Running windows DLL functions from GCC application
Does it allocate memory? Does it import any functions (use winedbump to check).If the answer is yes to either of the above questions then it's not that simple.robiwan wrote:As the DLL I'll be calling merely does calculations, I hope to avoid those problems.
You have to use winegcc.robiwan wrote:But to dig in a bit, is it necessary to use winegcc to build a winelib application or would -lwine with gcc suffice ?
Re: Running windows DLL functions from GCC application
Doesn't winelib wrap all Windows specific allocations (GlobalAlloc/Free etc)?vitamin wrote:Does it allocate memory?
If memory allocations/frees are just within the DLL function (i.e. no pointers are returned from function calls), shouldn't that be just fine ?
I think not, at least nothing outside core Windows DLLs (hopefully only kernel32, which I'll check), which I hope winelib should be able to handle ?vitamin wrote:Does it import any functions (use winedbump to check).
Ok, fair enough.vitamin wrote:You have to use winegcc.