building a winelib dll?

Seth Burleigh wburle4 at
Thu Nov 18 20:59:24 CST 2010

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 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.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.'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the wine-devel mailing list