WineLib Linker Error?

Jussi Jumppanen jussij at zeusedit.com
Mon Aug 13 09:55:51 CDT 2001


I am doing some testing with WineLib and the 20010731 release
and am having some trouble with the final linkage. I have a 
very simple test.cpp file and the following spec file:

 name	test
 mode	guiexe
 type	win32
 
 import	shell32.dll
 import	comdlg32.dll
 import	user32.dll
 import	gdi32.dll
 import	kernel32.dll
 import	ntdll.dll

and a hand crafted make file.  When I run the make I get the 
following output (line wrapping added):

 make -f test.mak

 gcc -x c++ -c -g -Wall -O2 -mpreferred-stack-boundary=2 -fPIC 
  -I/usr/X11R6/include -I. -I../../wine-20010731/include 
  -I../zeusnls -I../ilib -I../clib -I../xlib -I../apollo test.cpp

 LD_LIBRARY_PATH="../../wine-20010731/unicode:$LD_LIBRARY_PATH" 
  ../../wine-20010731/tools/winebuild/winebuild -fPIC 
  -L../../wine-20010731/dlls -o test.spec.c -spec test.spec

 gcc -c -g -Wall -I/usr/X11R6/include -I. -I../../wine-20010731/include 
  -fno-builtin -o test.spec.o test.spec.c

 echo Linking.....
 gcc -shared  -Wl,-Bsymbolic test.o test.res test.spec.o -o test.so 
  -L../../wine-20010731/library -lwine -lshell32 -lcomctl32 
  -lcomdlg32 -luser32 -lkernel32 -lgdi32 -lm -lutil -ldl 
  -L../ilib -L../clib -L../xlib -L../apollo -lilib -lclib -lxlib 
  -lapollo 

 test.spec.o: In function `__wine_exe_main':
 /test/test.spec.c:68: undefined reference to `GetCommandLineA'
 /test/test.spec.c:71: undefined reference to `GetStartupInfoA'
 /test/test.spec.c:73: undefined reference to `__wine_get_main_args'
 /test/test.spec.c:74: undefined reference to `ExitProcess'

and this is the part of the test.spec.c file that was produced:

 #include <winbase.h>
 int _ARGC;
 char **_ARGV;
 extern int __stdcall WinMain(HINSTANCE,HINSTANCE,LPSTR,INT);
 static void __wine_exe_main(void)
 {
     extern int __wine_get_main_args( char ***argv );
     STARTUPINFOA info;
     LPSTR cmdline = GetCommandLineA();
     while (*cmdline && *cmdline != ' ') cmdline++;
     if (*cmdline) cmdline++;
     GetStartupInfoA( &info );
     if (!(info.dwFlags & STARTF_USESHOWWINDOW)) info.wShowWindow = 1;
     _ARGC = __wine_get_main_args( &_ARGV );
     ExitProcess( WinMain( GetModuleHandleA(0), 0, cmdline,
info.wShowWindow ) );
 }

Any help would be much appreciate.

Thanks in advance.

Regards Jussi Jumppanen




More information about the wine-users mailing list