Im trying to build a simple winelib. Its not working and is returning 'error 127'. I have some question:
(1) how do i determine which functions are exported by wine? All i see using nm zmq.dll.so is the names of my proxy function (add_proxy) instead of the name that is going to be called by the windows program (add) (2) whats the point of a spec file? what im saying is that i can build my files without a spec file and no error message is produced. In what stage of building is the spec file actually used? (3) is there any way to debug just specifically the errors produced by my stub dll under wine? somehow specify a debug channel where the real reason for 'error 127' is? The stub dll being dynamically loaded by a program for which i have no source code.
I am using these simple test files: //in zmq.c #include "zmq.h" #include "wine/debug.h" #include <windef.h>
long WINAPI add_proxy(long a,long b) { return a+b; } ;;in zmq.dll.spec @ stdcall add( long long ) add_proxy
and then i do
winegcc -c -o zmq.o zmq.c winegcc -shared -o zmq.dll.so zmq.o
However, i notice that i can just get rid of the spec file and no error messages are produced which makes no sense since the dll is supposed to redirect calls to add to add_proxy.
And once i use the windows program to call function add, i get the 'error 127', which means it cant find the function 'add.'
The purpose of this dll is to make a binding to zeromq. Ive tried compilin natively using microsoft visual studio but it doesn't like the msvc90 dll that i have and i dont want to have to worry about distribution issues of that dll. Plus mingw is a pain to build with and often fails randomly. So i thought this would be the best option. I know its simple to do, i just dont know what im doing wrong...
On Thu, Nov 18, 2010 at 8:59 PM, Seth Burleigh wburle4@gmail.com wrote:
Im trying to build a simple winelib. Its not working and is returning 'error 127'. I have some question:
(1) how do i determine which functions are exported by wine? All i see using nm zmq.dll.so is the names of my proxy function (add_proxy) instead of the name that is going to be called by the windows program (add) (2) whats the point of a spec file? what im saying is that i can build my files without a spec file and no error message is produced. In what stage of building is the spec file actually used? (3) is there any way to debug just specifically the errors produced by my stub dll under wine? somehow specify a debug channel where the real reason for 'error 127' is? The stub dll being dynamically loaded by a program for which i have no source code.
I am using these simple test files: //in zmq.c #include "zmq.h" #include "wine/debug.h" #include <windef.h>
long WINAPI add_proxy(long a,long b) { return a+b; } ;;in zmq.dll.spec @ stdcall add( long long ) add_proxy
and then i do
winegcc -c -o zmq.o zmq.c winegcc -shared -o zmq.dll.so zmq.o
However, i notice that i can just get rid of the spec file and no error messages are produced which makes no sense since the dll is supposed to redirect calls to add to add_proxy.
And once i use the windows program to call function add, i get the 'error 127', which means it cant find the function 'add.'
alright, so heres how it works:
first, you need to pass spec into the right place, heres the output of the make file.
winegcc -c -mno-cygwin -m32 -o zmq.o zmq.c winegcc -shared zmq.dll.spec -mno-cygwin -o zmq.dll.so zmq.o -lzmq
next, you need to make sure to include <windows.h> in zmq.c and put WINAPI between return type and function name if you are using stdcall in the spec file, otherwise it wont work.
Finally, heres a nice reference example http://www.winehq.org/pipermail/wine-devel/2010-June/084336.html
and in terms of finding what symbols are exported well those in the spec file are exported, so no big deal.