top of page

Known problems for Wine and their solutions

  • Фото автора: Алексей Захаров
    Алексей Захаров
  • 3 янв. 2016 г.
  • 5 мин. чтения

This is a list of compilation problems and their solutions for Wine from previous post (http://likhach-umnik.wix.com/winedos#!Wine960811-modified/cgla/5688eae00cf20a60e3b27b56).

It is not nesessary that you will run into one of these errors. Also you can meet with another errors, not listed here. Feel free to ask me help if you need.

1. bison.exe fails with "Unable to open file m4sugar.m4". Solution is to use bison program from DJGPP (included in package from one of my previous posts). It works good and it don't have such problem.

2. lex -8 -I <filename> fails. Solution is to use "flex" instead of "lex" (change it in makefile).

3. In module "files\drive.c" line 453 error about "storage size of struct 'info' is unknown or zero". This happens dut to inappropriate including of headers. Solution: just #include <emx_add.h> into top of drive.c.

4. In file included from main.c:28

..\include\debugger.h:63:parser error before *, and some other errors in this file.

This happens because struct SIGCONTEXT is not defined properly. Solution is: remove directives #ifdef linux and #endif from structure "SIGCONTEXT" declaration in file wine-960811/include/regs.h.

5. signal.c: line 19, file "syscall.h" not found. Allright, there is no such file. Change it into #include <unistd.h>

6. signal.c: lines 230 and 239, errors about "itimerval" struct and about ITIMER_REAL macro. These macros are defined in <sys/wtime.h> (modified header by me), so include sys/wtime.h in somewhere in #include section of signal.c.

7. misc/winsock.c: lines 594-608. Parse error before u_long. I don't know what exactly macro _IOR does, but I assume that it needs size of type. So just change "u_long" into "sizeof(u_long)" (this is applicable to some next strings too).

"FIONBIO and FIOASYNC undeclared here". Just #include <sys/so_ioctl.h> in file winsock.c - these two macros are defined here.

8. In directory misc there may be ld error: no such file or directory for ole2. (instead of ole2 there may be other name). Reason is simple: command length is limited to 127 (or 128, I don't remember correctly) symbols. Extra symbols are being cut off, and linker see strange command.

Solution is to use partial linking. Idea: in first step we link one half of files into temporary file "misc1.o", in second step we link second half to "misc2.o", and finally we link these two files together: "ld -r misc1.o misc2.o -o misc.o". File "misc.o" will be almostly what we need. It will work by similar way, but will have a bit different size. If we need, we can do as many steps as we need. We can link files by 2, 3, 4 or 5 groups - they still will work.

To do partial linking, it is possible to use batch file. Here is an example of batch file for directory misc (here and next I will use @ symbols to divide file into strings):

-----start of file link.bat

@ld -r clipbrd.o comm.o commdlg.o compobj.o crtdll.o driver.o exec.o escape.o -o misc1.o @ld -r keyboard.o lstr.o lzexpand.o main.o network.o ole2.o ole2disp.o ole2nls.o olecli.o -o misc2.o @ld -r olesvr.o port.o rect.o registry.o shell.o sound.o spy.o stress.o system.o toolhelp.o -o misc3.o @ld -r user.o ver.o w32sys.o winsock.o wsprintf.o xmalloc.o -o misc4.o @ld -r misc1.o misc2.o misc3.o misc4.o -o misc.o @del misc1.o misc2.o misc3.o misc4.o -----end of file link.bat

9. Directory "OBJECTS", "No rule to make target cursoric.c needed by cursoric.o". I don't know why this error occurs. You can rename cursoric.c to crsic.c (and do same in makefile), for me it worked.

10. Same directory, oembmp.c can't find some include files. This is because I made mistaked while renaming. So change in oembmp.c: bitmaps/obm_cdr -> bitmaps/obm_cdro

bitmaps/obm_dnwi -> bitmaps/obm_dawi

bitmaps/obm_upwi -> bitmaps/obm_upai

11. Same directory, instead of objects.o there may appear "a.out". This says that we need partial linking again. If you rename long file clipboard.c to clip.c and do make again, you will see same error as at #8.

Batch file:

@ld -r bitblt.o bitmap.o brush.o clip.o color.o crsric.o dc.o dcvalues.o dib.o -o objs1.o @ld -r font.o gdiobj.o linedda.o metafile.o oembmp.o palette.o pen.o region.o text.o -o objs2.o @ld -r objs1.o objs2.o -o objects.o @del objs1.o objs2.o

12. /res directory, file sysres.c can't open many include files "sysres_**.h". It happened because I forgot to rename these files in #include directives. So just rename them into "sys_**.h" or copy-paste these strings:

#include "sys_En.h" #include "sys_Es.h" #include "sys_De.h" #include "sys_No.h" #include "sys_Fr.h" #include "sys_Fi.h" #include "sys_Da.h" #include "sys_Cz.h" #include "sys_Eo.h" #include "sys_It.h" #include "sys_Ko.h"

13. Same file, many errors "sysres_**_Table undeclared here (not a function)". Solution: rename all sysres_**_Table fields in struct SYSRES_resources into sys_**_Table or copy-paste:

sys_En_Table, /* LANG_En */ sys_Es_Table, /* LANG_Es */ sys_De_Table, /* LANG_De */ sys_No_Table, /* LANG_No */ sys_Fr_Table, /* LANG_Fr */ sys_Fi_Table, /* LANG_Fi */ sys_Da_Table, /* LANG_Da */ sys_Cz_Table, /* LANG_Cz */ sys_Eo_Table, /* LANG_Eo */ sys_It_Table, /* LANG_It */ sys_Ko_Table /* LANG_Ko */

14. File time.c in win32 directory. Undeclared identifier DST_NONE. You should define it, better in time.h (not sys/time.h): #define DST_NONE 0.

15. Again partial linking in "win32" directory. Use this file (remember, that @ is new line, you may remove it):

@ld -r advapi.o code_pag.o console.o crsric32.o env.o error.o except.o file.o -o win321.o @ld -r findfile.o init.o memory.o newfns.o obj_mgt.o process.o string32.o struct32.o thread.o time.o user32.o -o win322.o @ld -r win321.o win322.o -o win32.o @del win321.o win322.o

16. Same for "windows" directory. Use this batch file to link:

@ld -r caret.o class.o dce.o defdlg.o defwnd.o dialog.o event.o focus.o graphics.o -o windows1.o @ld -r hook.o keyboard.o mapping.o mdi.o message.o msgbox.o nonclnt.o painting.o property.o -o windows2.o @ld -r queue.o scroll.o syscolor.o sysmetr.o timer.o win.o winpos.o winproc.o -o windows3.o @ld -r windows1.o windows2.o windows3.o -o windows.o del windows1.o windows2.o windows3.o

17. Despite my coding, ./configure sript ignored fact that I manually typed suffix of executables. So winerc.exe and build.exe tools are called only winerc and build. This is not bad when you need to run them, but it is not good for compilation. So type command "gcc -O2 -o build.exe build.o" in "Tools" directory.

18. Debugger/editline.c. Many errors on lines 185-215. This is because undeclared structures. You need to add definitions of structs "sgttyb" and "tchars" (ltchars is not nesessary, but not extra) to file sys/ioctl.h.

Also, in file sys/ioctl.h change third parameter in macroses TIOCGETP, TIOCSETP, TIOCGETC, TIOCSETC from "struct sgttyb" to sizeof(struct sgttyb) (same with tchars). This is not good solution, just workaround, but it works. Also, debugger is not the most important thing now in Wine.

Finally, include <termios.h> file to file editline.c. This is nesessary for ECHO macro. You should also define RAW macro in termios.h:

#define RAW 0x00000020

19. To compile files from IF1632 folder, run in the beginning this batch:

@for %%i in (*.spe) do ( @ ..\tools\build.exe -spec %%i > %%~ni.s @)

It will manually call tool build.exe to convert .spe files (formerly they called .spec, I renamed them to fit into 8.3). if you launched this batch under NTVDM, you may probably get message "Warning: no DPMI server FPU support". You must remove this message (first line) from every file where it appeared.

Also you should change symbols "/*" (slash and asterisk) to "#" (sharp) in every file where "/*" presents. It is a C-style comment, and it needs to be changed to GAS-style.

After this you can calmly call "make" (or gmake, if you are using my EMX package).

In NTVDM you probably will get an error ENOMEM (not enough memory) on last step of building. Use DOSBox or real DOS, but this is not full solution, because the biggest command from four (which makes files call(to|from)(16|32).s) still can result out of memory error.

So the remaining solution is to do this part of code in real Linux. I will try to use Debian 2.0 on VirtualBox and report you about results.

To be continued...

 
 
 

Comments


Subscribe to news

Yeah :) You are with me now!

  • Black Facebook Icon
  • Black Twitter Icon
  • Black Pinterest Icon
  • Black Flickr Icon
  • Black Instagram Icon

© 2015-2016 by Alexey Zakharov (Napoleon80386). Proudly created with Wix.com

bottom of page