building programs

Vincent Béron vberon at
Sun Mar 6 11:13:58 CST 2005

Le sam 05/03/2005 à 16:17, Rob D a écrit :
> I have attached 2 Makefiles that give me the unresolved main error on 
> Solaris10.
> AEP Makefile is supposed to make an executable from a few files and some 
> libraries.

I've only looked at the netclient one for now, I'll get to the other one

> Netclient is supposed to make a static lib, and it works good, but it 
> complains about missing main also.

(I had to add explicit paths to your Makefile for Wine
tools/libs/includes as my Wine is run from it's compile tree, and my ar
didn't like -r -v and preferred rcv)

See the attached main.cpp (I don't have yours). The output from a simple
make is then (paths removed for clarity):

winebuild -o netclient.dbg.c --debug -C.  main.cpp
winegcc -c     -o netclient.dbg.o netclient.dbg.c
wineg++ -c     -o main.o main.cpp
wineg++ -mwindows  -o  main.o  netclient.dbg.o   -lodbc32
-lole32 -loleaut32 -lwinspool -lws2_32 -luuid
ar rc netclient.a  main.o
r - main.o

No error in the end. Could you try my main.cpp and report if it works or

The whole ARCH part doesn't come from winemaker, right? It'd be much
simpler to change the .a rule to:
$(netclient_MODULE).a: $(netclient_OBJS)
        $(ARCH) $@ $(netclient_OBJS)

No need to build a .so and then the .a. Anyway, it still doesn't point
me in the right direction for your main() problem...

> Im not sure why I am having so many problems with this, but I tried 
> compiling the same source and Makefiles on a Debian Linux machine, but got 
> an error about ONLY_IN_WINELIB macro called without parameters or something.
> Then... I installed the 20050211 binary package on ANOTHER Debian machine, 
> but it couldnt find the windows includes, so I manually added a path, then 
> it complained about could not find -lwine lib. I assumed this was referring 
> to found in /usr/lib, so I tried adding /usr/lib to the 
> LIBRARIES_PATH in the makefile, but then it complained about /usr/lib file 
> not found.

If you add a dir to LIBRARY_PATH/netclient_LIBRARY_PATH, you need to
also add the -L prefix, else ld in the end will think it's a file you
want to link.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: text/x-c++
Size: 69 bytes
Desc: not available
Url :

More information about the wine-devel mailing list