Compiling and testing Winboard development versions

Discussions about the WinBoard protocol. Here you can also report bugs and request new features.

Moderators: hgm, Andres Valverde

Compiling and testing Winboard development versions

Postby lantonov » 28 Feb 2014, 13:36

Hello to all,
Hello, HGM,

First, I would like to thank HGM on my behalf and on behalf of a lot of Winboard users I have talked to, for his unfailing readiness to help and to respond to our wishes with immediate patches, no matter how freaky can be those wishes sometimes, and no matter if he likes the patches or not. Thanks to HGM's work Winboard / Xboard became a dream program to many chess enthusiasts.

I like particularly the abilities of Winboard to handle opening books. This can be done much easier in Winboard than in Scid, especially manual tweaking. I became particularly interested in the ability of the latest development versions to easily import pgn files with many games into books ("Save games to book" feature). That's why I tried to compile some of the latest xboard patches on the HGM's git hub. I have a Windows 32 system so the choice was Mingw or Cygwin. I tried both. In this post I'll relate my experience and problems with Mingw.

Running
Code: Select all
make -f makefile.gcc
in the winboard directory stopped almost immediately with the error showing that the compiler does not recognise the -mno-cygwin option. After removing this from makefile.gcc and continuing the compiler stopped with the error that highTextStart[2]and highTextEnd[2] are defined as extern int in engineoutput.h and as static int in wengineoutput.c. After commenting out line 58 in engineoutput.h
Code: Select all
extern int highTextStart[2], highTextEnd[2];
and continuing I received the following output (several warnings and an error):
Code: Select all
$ make -f makefile.gcc
 ../backend.c
../backend.c: In function 'HandleMachineMove':
../backend.c:8762:1: warning: unknown conversion type character 'l' in format [-
Wformat=]
 if(appData.debugMode) fprintf(debugFP, "nodes = %d, %lld\n", (int) programStats
.nodes, programStats.nodes);
 ^
../backend.c:8762:1: warning: too many arguments for format [-Wformat-extra-args
]
../backend.c: In function 'read_from_ics':
../backend.c:3085:6: warning: 'collective' may be used uninitialized in this fun
ction [-Wmaybe-uninitialized]
    if(collective != 3) next_out = i+1; // [HGM] suppress printing in ICS window
      ^
 ../book.c
 ../gamelist.c
 ../lists.c
 ../moves.c
 ../pgntags.c
 ../uci.c
 ../zippy.c
 ../parser.c
windres -D_WIN32_IE=0x0300 -DWIN32 --use-temp-file --include-dir .. winboard.rc
-O coff -o wbres.o
 wclipbrd.c
 wedittags.c
wedittags.c: In function 'EditTagsDialog':
wedittags.c:59:32: warning: variable 'flags' set but not used [-Wunused-but-set-
variable]
   int len, newSizeX, newSizeY, flags;
                                ^
 wengineoutput.c
wengineoutput.c: In function 'ResizeWindowControls':
wengineoutput.c:181:9: warning: variable 'npsWidth' set but not used [-Wunused-b
ut-set-variable]
     int npsWidth;
         ^
wengineoutput.c:180:9: warning: variable 'maxControlWidth' set but not used [-Wu
nused-but-set-variable]
     int maxControlWidth;
         ^
 wevalgraph.c
 wgamelist.c
wgamelist.c: In function 'GameListDialog':
wgamelist.c:167:27: warning: variable 'flags' set but not used [-Wunused-but-set
-variable]
   int newSizeX, newSizeY, flags;
                           ^
 whistory.c
 ../history.c
 winboard.c
winboard.c: In function 'WndProc':
winboard.c:4721:13: warning: variable 'wmEvent' set but not used [-Wunused-but-s
et-variable]
   int wmId, wmEvent;
             ^
winboard.c: In function 'CommentDialog':
winboard.c:6392:32: warning: variable 'flags' set but not used [-Wunused-but-set
-variable]
   int len, newSizeX, newSizeY, flags;
                                ^
winboard.c: In function 'ErrorDialog':
winboard.c:6757:10: warning: variable 'hwndText' set but not used [-Wunused-but-
set-variable]
   HANDLE hwndText;
          ^
winboard.c: In function 'GothicDialog':
winboard.c:6807:10: warning: variable 'hwndText' set but not used [-Wunused-but-
set-variable]
   HANDLE hwndText;
          ^
 wlayout.c
 woptions.c
woptions.c: In function 'PaintSampleSquare':
woptions.c:360:11: warning: variable 'oldBrushSquare' set but not used [-Wunused
-but-set-variable]
   HBRUSH  oldBrushSquare;
           ^
 wsnap.c
 wsockerr.c
 help.c
 wsettings.c
wsettings.c: In function 'GetOptionValues':
wsettings.c:383:12: warning: variable 'hwndCombo' set but not used [-Wunused-but
-set-variable]
     HANDLE hwndCombo;
            ^
wsettings.c: In function 'AddOption':
wsettings.c:580:2: warning: case value '112' not in enumerated type 'Control' [-
Wswitch]
  case Slider+100:
  ^
wsettings.c: In function 'PseudoOK':
wsettings.c:891:12: warning: variable 'saveOK' set but not used [-Wunused-but-se
t-variable]
     void (*saveOK)();
            ^
wsettings.c: In function 'LayoutOptions':
wsettings.c:165:38: warning: 'nextType' may be used uninitialized in this functi
on [-Wmaybe-uninitialized]
  if((nextType == TextBox || nextType == ListBox || nextType == FileName || next
Type == PathName) && lastType == ComboBox)
                                      ^
 wchat.c
 ../engineoutput.c
 ../evalgraph.c
gcc  backend.o book.o gamelist.o lists.o moves.o pgntags.o uci.o zippy.o parser.
o wbres.o wclipbrd.o wedittags.o wengineoutput.o wevalgraph.o wgamelist.o whisto
ry.o history.o winboard.o wlayout.o woptions.o wsnap.o wsockerr.o help.o wsettin
gs.o wchat.o engineoutput.o evalgraph.o -lmsvcrt -DNDEBUG -fpic -s -mwindows -lw
sock32 -lwinmm -lcomctl32 -o winboard.exe
backend.o:backend.c:(.text+0x241f8): undefined reference to `AddBookMove'
collect2.exe: error: ld returned 1 exit status
make: *** [winboard.exe] Error 1

AddBookMove is at line 7003 of backend.c. Commenting out this line
Code: Select all
AddBookMove(buf);
Winboard compiled at last and it was working!

Tried it in standalone mode and in FICS without problems so far. The new function "Save games to book" works as expected. Another new function, a separate chat window also works. It has 6 button, only 2 of which are functional (the other 4 are blank). Checking TbHits box shows some numbers in the line below the clocks but does not show them in the engine output window. I am not sure what these numbers mean. I suppose that the last one is the tablebase hits because it stayed 0 at the beginning and started to increase towards the endgame (I used Stockfish development version with syzygy bases).

I have a small comment about the Game list item. In the View menu 'Game list' starts the Game list dialog box if such list is available, otherwise it starts the Game Tags box. In the Options menu, almost the same item 'Game list ...' starts the Game Tags box. It is a little confusing. Another duplicate command is 'Ponder next move'. It is in Options, Common Engine ... and in Options, General ...

This is all for now. Next time I will tell about my experience with Cygwin.

Thank you again, HGM. Keep up the great work!
lantonov
 
Posts: 62
Joined: 28 Feb 2014, 08:43

Re: Compiling and testing Winboard development versions

Postby H.G.Muller » 28 Feb 2014, 15:02

lantonov wrote:I like particularly the abilities of Winboard to handle opening books. This can be done much easier in Winboard than in Scid, especially manual tweaking. I became particularly interested in the ability of the latest development versions to easily import pgn files with many games into books ("Save games to book" feature). That's why I tried to compile some of the latest xboard patches on the HGM's git hub. I have a Windows 32 system so the choice was Mingw or Cygwin. I tried both. In this post I'll relate my experience and problems with Mingw.

Thank you for your interest in WinBoard. Note that I always compile WinBoard under Cygwin, with a pretty old version of gcc (3.4.4). This needs the -mno-cygwin option to generate a native Windows binary. I noticed that the latest gcc version under Cygwin does not support this option, and advises me to use a Mingw compiler instead. Just deleting the option does not seem to work there, as it tries to make a Cygwin1.dll-dependent version then, and gives error messages on all the native Windows API calls. I could not figure out how to fix that in Cygwin, so I just went back to gcc 3.4.4. In a true Mingw compiler this option might be the default, however.

Also note that the "Save games to book" option does already exist in the 'stable release' 4.7.3. (It might have been broken in an earlier version of the 4.7.x branch.)

Running
Code: Select all
make -f makefile.gcc
in the winboard directory stopped almost immediately with the error showing that the compiler does not recognise the -mno-cygwin option. After removing this from makefile.gcc and continuing the compiler stopped with the error that highTextStart[2]and highTextEnd[2] are defined as extern int in engineoutput.h and as static int in wengineoutput.c.

After commenting out line 58 in engineoutput.h
Code: Select all
extern int highTextStart[2], highTextEnd[2];
and continuing I received the following output (several warnings and an error):
Code: Select all
$ make -f makefile.gcc
...
make: *** [winboard.exe] Error 1


Apparently this Mingw compiler is more critical than gcc 3.3.4 (and even that usually gives a lot more warnings than my XBoard compiles on Linux). Thanks for this list; I will try to fix them all.

AddBookMove is at line 7003 of backend.c. Commenting out this line
Code: Select all
AddBookMove(buf);
Winboard compiled at last and it was working!

Unfortunately the current version in my on-line repository is in an extremely messy state. This is the main reason why I have not pushed it to the official repositories at GNU Savannah yet. I surged ahead so fast on an idea I had for the XBoard GTK build (to equip it with an ICS window such as WinBoard has), that I broke the other versions in the process. With the latest version of master in hgm.nubati.net the XBoard Xaw version crashes in ICS mode, and (as you discovered) WinBoard does not compile because some of the new front-end functions some of my new features call are not implemented in the WinBoard front-end yet. AddBookMove is such a front-end function that I added to XBoard, but not yet to WinBoard. It should add a line of text to the Edit Book dialog. Deleting it should not break anything, because that function is called only in response to an "add next move" button in the Edit-Book dialog that I did not add to WinBoard yet either: pressing this button would add the move you play next on the board to the list of book moves for the current position, with weight 1 (without actuall playing it). Another feature I added in this dialog, which I also have not connected in WinBoard yet, is that right-clicking on a book move would play it. I hope to add the WinBoard support for this very soon.

Tried it in standalone mode and in FICS without problems so far. The new function "Save games to book" works as expected. Another new function, a separate chat window also works. It has 6 button, only 2 of which are functional (the other 4 are blank).

This existed already before WB 4.6.0. The buttons allow you to navigate between different chats, but you first have to 'open' such chats by typing the name of the person you want to chat with in the Chat Partner field. Then the name of that partner will appear on one of the buttons, so you can easily call it to the front.

Checking TbHits box shows some numbers in the line below the clocks but does not show them in the engine output window. I am not sure what these numbers mean. I suppose that the last one is the tablebase hits because it stayed 0 at the beginning and started to increase towards the endgame (I used Stockfish development version with syzygy bases).

You are probably talking about the checkbox in the Engine Settings dialog, and this controls an option of the Polyglot adapter whether it will transmit the UCI engine's tbhits info to the GUI. Whether they will be displayed in the Engine Output window is controlled by the header lines there: when you right-click tbhits there, it should enable or disable the display of them. (And by default they are indeed off.)

I have a small comment about the Game list item. In the View menu 'Game list' starts the Game list dialog box if such list is available, otherwise it starts the Game Tags box.

That sounds very wrong. For me it pops up an error dialog "No game list".
In the Options menu, almost the same item 'Game list ...' starts the Game Tags box. It is a little confusing.

Indeed, the naming might not be ideal. But for everything in the Options menu it is sort of implied that they are 'Options' for the thing they mention. E.g. there also is "Load Game..." and "Save Game.." there, that do something completely different from the identically named items in the "File" menu.
Another duplicate command is 'Ponder next move'. It is in Options, Common Engine ... and in Options, General ...

I don't consider having duplicates a really bad thing. Sometimes I keep them in an illogical place for historic reasons, so that people used to find them there will not be disappointed. Altering WinBoard dialogs is also a pain: to delete an element, I would have to shift all following elements by re-calculating their coordinates. Sometimes I am just too lazy to do that.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Compiling and testing Winboard development versions

Postby lantonov » 28 Feb 2014, 16:31

HGM, you are as quick in responding as in applying a patch. Thank you for this.

My comments were not intended as a criticism, just suggestions. You accepted some, for others gave well-founded reasons not to accept. I agree with all.

The dialog "No game list" popped to me when no game list is loaded. When I load a pgn file with several games through File, Load game ... then "Game list" under the View menu pops the dialog box "Game list" with the one-liners for each game in the pgn files and the filtering buttons below.

Just a few words about compiling under Cygwin. With makefile.gcc set to MINGW=0, the compiler exited with error on function select because it had two different definitions in winsock.h and in fnctl.h (if I am not mistaken). This error disappeared when preserving winsock.h and removing fnctl.h (not vice versa) and winboard.exe compiled after several warnings. To start, it required 3 .dll files: cygwin1.dll, cygstdc++-6.dll, and cyggcc_s-1.dll.

However, the version that came out was very buggy and crippled. The things I remember: after each game it gives a message "Bad Seek: The device does not recognize the command", "Edit, Paste game from Clipboard" pops a message "Unable to create temporary file", some tags in the output pgn file have Unix line feeds, etc. Because most of these bugs are connected with reading / writing, I suppose that this is because of the deletion of fnctl.h. But I may wrong.

I will do some more experiments with Cygwin and give you more concrete info.

My Mingw gcc version is 4.8.1, and for Cygwin I don't have info right now. I have Cygwin on another computer.
lantonov
 
Posts: 62
Joined: 28 Feb 2014, 08:43

Re: Compiling and testing Winboard development versions

Postby lantonov » 28 Feb 2014, 18:44

In Cygwin (gcc version 4.8.2) with Makefile
line 26
Code: Select all
USE_MINGW=1

line 31
Code: Select all
CFCYG = -DUSE_I64

line 32
Code: Select all
LFCYG = -lmsvcrt

I get the following:
Code: Select all
$ make -f makefile.gcc
 ../backend.c
../backend.c: In function ‘HandleMachineMove’:
../backend.c:9403:10: warning: format ‘%u’ expects argument of type ‘unsigned int *’, but argument 7 has type ‘long long unsigned int *’ [-Wformat=]
          &plylev, &plyext, &curscore, &time, &nodes, buf1) >= 5) {
          ^
../backend.c:9403:10: warning: format ‘%u’ expects argument of type ‘unsigned int *’, but argument 7 has type ‘long long unsigned int *’ [-Wformat=]
../backend.c:9548:10: warning: format ‘%u’ expects argument of type ‘unsigned int *’, but argument 4 has type ‘long long unsigned int *’ [-Wformat=]
          &mvtot, mvname) >= 5) {
          ^
../backend.c:9548:10: warning: format ‘%u’ expects argument of type ‘unsigned int *’, but argument 4 has type ‘long long unsigned int *’ [-Wformat=]
../backend.c:9611:10: warning: format ‘%u’ expects argument of type ‘unsigned int *’, but argument 7 has type ‘long long unsigned int *’ [-Wformat=]
          &plylev, &plyext, &curscore, &time, &nodes, buf1) >= 5)
          ^
../backend.c:9611:10: warning: format ‘%u’ expects argument of type ‘unsigned int *’, but argument 7 has type ‘long long unsigned int *’ [-Wformat=]
../backend.c: In function ‘SaveGameToFile’:
../backend.c:13245:6: warning: implicit declaration of function ‘lseek’ [-Wimplicit-function-declaration]
      if(lseek(fileno(f), 0, SEEK_END) == -1) DisplayError(_("Bad Seek"), errno);     // better safe than sorry...
      ^
../backend.c: In function ‘read_from_ics’:
../backend.c:3085:6: warning: ‘collective’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    if(collective != 3) next_out = i+1; // [HGM] suppress printing in ICS window
      ^
 ../book.c
 ../gamelist.c
 ../lists.c
 ../moves.c
 ../pgntags.c
 ../uci.c
 ../zippy.c
 ../parser.c
windres -D_WIN32_IE=0x0300 -DWIN32 --use-temp-file --include-dir .. winboard.rc -O coff -o wbres.o
cygwin warning:
  MS-DOS style path detected: res\winboard.exe.manifest
  Preferred POSIX equivalent is: res/winboard.exe.manifest
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
 wclipbrd.c
 wedittags.c
wedittags.c: In function ‘EditTagsDialog’:
wedittags.c:59:32: warning: variable ‘flags’ set but not used [-Wunused-but-set-variable]
   int len, newSizeX, newSizeY, flags;
                                ^
 wengineoutput.c
wengineoutput.c: In function ‘ResizeWindowControls’:
wengineoutput.c:181:9: warning: variable ‘npsWidth’ set but not used [-Wunused-but-set-variable]
     int npsWidth;
         ^
wengineoutput.c:180:9: warning: variable ‘maxControlWidth’ set but not used [-Wunused-but-set-variable]
     int maxControlWidth;
         ^
 wevalgraph.c
 wgamelist.c
wgamelist.c: In function ‘GameListDialog’:
wgamelist.c:167:27: warning: variable ‘flags’ set but not used [-Wunused-but-set-variable]
   int newSizeX, newSizeY, flags;
                           ^
 whistory.c
 ../history.c
 winboard.c
In file included from /usr/include/cygwin/sys_time.h:13:0,
                 from /usr/include/sys/time.h:61,
                 from /usr/include/sys/_default_fcntl.h:200,
                 from /usr/include/sys/fcntl.h:3,
                 from /usr/include/fcntl.h:14,
                 from winboard.c:69:
/usr/include/sys/select.h:31:5: error: conflicting types for ‘select’
 int select __P ((int __n, fd_set *__readfds, fd_set *__writefds,
     ^
In file included from winboard.c:61:0:
/usr/include/w32api/winsock.h:299:34: note: previous declaration of ‘select’ was here
   WINSOCK_API_LINKAGE int WSAAPI select(int nfds,fd_set *readfds,fd_set *writefds,fd_set *exceptfds,const PTIMEVAL timeout);
                                  ^
winboard.c: In function ‘WndProc’:
winboard.c:4721:13: warning: variable ‘wmEvent’ set but not used [-Wunused-but-set-variable]
   int wmId, wmEvent;
             ^
winboard.c: In function ‘CommentDialog’:
winboard.c:6392:32: warning: variable ‘flags’ set but not used [-Wunused-but-set-variable]
   int len, newSizeX, newSizeY, flags;
                                ^
winboard.c: In function ‘ErrorDialog’:
winboard.c:6757:10: warning: variable ‘hwndText’ set but not used [-Wunused-but-set-variable]
   HANDLE hwndText;
          ^
winboard.c: In function ‘GothicDialog’:
winboard.c:6807:10: warning: variable ‘hwndText’ set but not used [-Wunused-but-set-variable]
   HANDLE hwndText;
          ^
makefile.gcc:81: recipe for target 'winboard.o' failed
make: *** [winboard.o] Error 1


The development version is xboard-5e165b4.
lantonov
 
Posts: 62
Joined: 28 Feb 2014, 08:43

Re: Compiling and testing Winboard development versions

Postby lantonov » 28 Feb 2014, 19:09

Sorry, the previous output was with line 58 of engineoutput.h
Code: Select all
extern int highTextStart[2], highTextEnd[2];
commented out. When I enable this line, the output is the following:
Code: Select all
$ make -f makefile.gcc
 ../backend.c
../backend.c: In function ‘HandleMachineMove’:
../backend.c:9403:10: warning: format ‘%u’ expects argument of type ‘unsigned int *’, but argument 7 has type ‘long long unsigned int *’ [-Wformat=]
          &plylev, &plyext, &curscore, &time, &nodes, buf1) >= 5) {
          ^
../backend.c:9403:10: warning: format ‘%u’ expects argument of type ‘unsigned int *’, but argument 7 has type ‘long long unsigned int *’ [-Wformat=]
../backend.c:9548:10: warning: format ‘%u’ expects argument of type ‘unsigned int *’, but argument 4 has type ‘long long unsigned int *’ [-Wformat=]
          &mvtot, mvname) >= 5) {
          ^
../backend.c:9548:10: warning: format ‘%u’ expects argument of type ‘unsigned int *’, but argument 4 has type ‘long long unsigned int *’ [-Wformat=]
../backend.c:9611:10: warning: format ‘%u’ expects argument of type ‘unsigned int *’, but argument 7 has type ‘long long unsigned int *’ [-Wformat=]
          &plylev, &plyext, &curscore, &time, &nodes, buf1) >= 5)
          ^
../backend.c:9611:10: warning: format ‘%u’ expects argument of type ‘unsigned int *’, but argument 7 has type ‘long long unsigned int *’ [-Wformat=]
../backend.c: In function ‘SaveGameToFile’:
../backend.c:13245:6: warning: implicit declaration of function ‘lseek’ [-Wimplicit-function-declaration]
      if(lseek(fileno(f), 0, SEEK_END) == -1) DisplayError(_("Bad Seek"), errno);     // better safe than sorry...
      ^
../backend.c: In function ‘read_from_ics’:
../backend.c:3085:6: warning: ‘collective’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    if(collective != 3) next_out = i+1; // [HGM] suppress printing in ICS window
      ^
 ../book.c
 ../gamelist.c
 ../lists.c
 ../moves.c
 ../pgntags.c
 ../uci.c
 ../zippy.c
 ../parser.c
windres -D_WIN32_IE=0x0300 -DWIN32 --use-temp-file --include-dir .. winboard.rc -O coff -o wbres.o
 wclipbrd.c
 wedittags.c
wedittags.c: In function ‘EditTagsDialog’:
wedittags.c:59:32: warning: variable ‘flags’ set but not used [-Wunused-but-set-variable]
   int len, newSizeX, newSizeY, flags;
                                ^
 wengineoutput.c
wengineoutput.c: In function ‘ResizeWindowControls’:
wengineoutput.c:181:9: warning: variable ‘npsWidth’ set but not used [-Wunused-but-set-variable]
     int npsWidth;
         ^
wengineoutput.c:180:9: warning: variable ‘maxControlWidth’ set but not used [-Wunused-but-set-variable]
     int maxControlWidth;
         ^
wengineoutput.c: At top level:
wengineoutput.c:228:23: error: static declaration of ‘highTextStart’ follows non-static declaration
 static int currentPV, highTextStart[2], highTextEnd[2];
                       ^
In file included from wengineoutput.c:44:0:
../engineoutput.h:58:12: note: previous declaration of ‘highTextStart’ was here
 extern int highTextStart[2], highTextEnd[2];
            ^
wengineoutput.c:228:41: error: static declaration of ‘highTextEnd’ follows non-static declaration
 static int currentPV, highTextStart[2], highTextEnd[2];
                                         ^
In file included from wengineoutput.c:44:0:
../engineoutput.h:58:30: note: previous declaration of ‘highTextEnd’ was here
 extern int highTextStart[2], highTextEnd[2];
                              ^
makefile.gcc:120: recipe for target 'wengineoutput.o' failed
make: *** [wengineoutput.o] Error 1
lantonov
 
Posts: 62
Joined: 28 Feb 2014, 08:43

Re: Compiling and testing Winboard development versions

Postby lantonov » 28 Feb 2014, 19:53

Version xboard-5e165b4 in Mingw (gcc 4.8.1) with the usual culprits disabled gives new errors preventing compilation:
Code: Select all
$ make -f makefile.gcc
 ../backend.c
../backend.c: In function 'HandleMachineMove':
../backend.c:8762:1: warning: unknown conversion type character 'l' in format [-
Wformat=]
 if(appData.debugMode) fprintf(debugFP, "nodes = %d, %lld\n", (int) programStats
.nodes, programStats.nodes);
 ^
../backend.c:8762:1: warning: too many arguments for format [-Wformat-extra-args
]
../backend.c: In function 'read_from_ics':
../backend.c:3085:6: warning: 'collective' may be used uninitialized in this fun
ction [-Wmaybe-uninitialized]
    if(collective != 3) next_out = i+1; // [HGM] suppress printing in ICS window

      ^
 wengineoutput.c
wengineoutput.c: In function 'ResizeWindowControls':
wengineoutput.c:181:9: warning: variable 'npsWidth' set but not used [-Wunused-b
ut-set-variable]
     int npsWidth;
         ^
wengineoutput.c:180:9: warning: variable 'maxControlWidth' set but not used [-Wu
nused-but-set-variable]
     int maxControlWidth;
         ^
 wevalgraph.c
 wgamelist.c
wgamelist.c: In function 'GameListDialog':
wgamelist.c:167:27: warning: variable 'flags' set but not used [-Wunused-but-set
-variable]
   int newSizeX, newSizeY, flags;
                           ^
 whistory.c
 ../history.c
 winboard.c
winboard.c: In function 'WndProc':
winboard.c:4721:13: warning: variable 'wmEvent' set but not used [-Wunused-but-s
et-variable]
   int wmId, wmEvent;
             ^
winboard.c: In function 'CommentDialog':
winboard.c:6392:32: warning: variable 'flags' set but not used [-Wunused-but-set
-variable]
   int len, newSizeX, newSizeY, flags;
                                ^
winboard.c: In function 'ErrorDialog':
winboard.c:6757:10: warning: variable 'hwndText' set but not used [-Wunused-but-
set-variable]
   HANDLE hwndText;
          ^
winboard.c: In function 'GothicDialog':
winboard.c:6807:10: warning: variable 'hwndText' set but not used [-Wunused-but-
set-variable]
   HANDLE hwndText;
          ^
 wlayout.c
 woptions.c
woptions.c: In function 'PaintSampleSquare':
woptions.c:360:11: warning: variable 'oldBrushSquare' set but not used [-Wunused
-but-set-variable]
   HBRUSH  oldBrushSquare;
           ^
 wsnap.c
 wsockerr.c
 help.c
 wsettings.c
wsettings.c: In function 'GetOptionValues':
wsettings.c:383:12: warning: variable 'hwndCombo' set but not used [-Wunused-but
-set-variable]
     HANDLE hwndCombo;
            ^
wsettings.c: In function 'AddOption':
wsettings.c:580:2: warning: case value '112' not in enumerated type 'Control' [-
Wswitch]
  case Slider+100:
  ^
wsettings.c: In function 'PseudoOK':
wsettings.c:891:12: warning: variable 'saveOK' set but not used [-Wunused-but-se
t-variable]
     void (*saveOK)();
            ^
wsettings.c: In function 'LayoutOptions':
wsettings.c:165:38: warning: 'nextType' may be used uninitialized in this functi
on [-Wmaybe-uninitialized]
  if((nextType == TextBox || nextType == ListBox || nextType == FileName || next
Type == PathName) && lastType == ComboBox)
                                      ^
 wchat.c
 ../engineoutput.c
 ../evalgraph.c
gcc  backend.o book.o gamelist.o lists.o moves.o pgntags.o uci.o zippy.o parser.
o wbres.o wclipbrd.o wedittags.o wengineoutput.o wevalgraph.o wgamelist.o whisto
ry.o history.o winboard.o wlayout.o woptions.o wsnap.o wsockerr.o help.o wsettin
gs.o wchat.o engineoutput.o evalgraph.o -lmsvcrt -DNDEBUG -fpic -s -mwindows -lw
sock32 -lwinmm -lcomctl32 -o winboard.exe
pgntags.o:pgntags.c:(.text+0xb): undefined reference to `_imp____ctype_ptr__'
uci.o:uci.c:(.text+0x7f): undefined reference to `_imp____ctype_ptr__'
zippy.o:zippy.c:(.text+0x24b): undefined reference to `__errno'
zippy.o:zippy.c:(.text+0xefd): undefined reference to `_imp____ctype_ptr__'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: zippy.o: b
ad reloc address 0x0 in section `.data'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: final link
 failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
make: *** [winboard.exe] Error 1

This is the last version on your git hub. The previous posts pertain to earlier versions.
lantonov
 
Posts: 62
Joined: 28 Feb 2014, 08:43

Re: Compiling and testing Winboard development versions

Postby H.G.Muller » 28 Feb 2014, 21:13

Don't think it would make much sense to build a WinBoard version that is dependent on Cygwin DLLs. So if it doesn't work anymore with the current system header files, I guess we should simply stop supporting that.

Anyway, I just finished the WinBoard front-end for the Edit Book enhancements (right-clicking on moves to play them, and a Play Move button to add a move to the list by playing it). This should bring WinBoard up-to-date, and I just have to fix the XBoard Xaw build for the ICS Chat Console. I uploaded the latest WinBoard binary to http://hgm.nubati.net/WinBoard-4.8.beta.zip , as usual.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Compiling and testing Winboard development versions

Postby lantonov » 28 Feb 2014, 22:09

I think I found a better way to compile in Cygwin without the need for additional dll files.

Write in makefile.gcc line 35
Code: Select all
CC = i686-pc-mingw32-gcc
that loads a mingw compatible compiler included in the default Cygwin package.
In winboard.c allow the inclusion of fcntl.h.
The output of compile is:
Code: Select all
$ make -f makefile.gcc
 ../backend.c
../backend.c: In function ‘HandleMachineMove’:
../backend.c:8762:1: warning: unknown conversion type character ‘l’ in format [-Wformat]
../backend.c:8762:1: warning: too many arguments for format [-Wformat-extra-args]
../backend.c: In function ‘read_from_ics’:
../backend.c:3085:6: warning: ‘collective’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 ../book.c
 ../gamelist.c
 ../lists.c
 ../moves.c
 ../pgntags.c
 ../uci.c
 ../zippy.c
 ../parser.c
windres -D_WIN32_IE=0x0300 -DWIN32 --use-temp-file --include-dir .. winboard.rc -O coff -o wbres.o
 wclipbrd.c
 wedittags.c
wedittags.c: In function ‘EditTagsDialog’:
wedittags.c:59:32: warning: variable ‘flags’ set but not used [-Wunused-but-set-variable]
 wengineoutput.c
wengineoutput.c: In function ‘ResizeWindowControls’:
wengineoutput.c:181:9: warning: variable ‘npsWidth’ set but not used [-Wunused-but-set-variable]
wengineoutput.c:180:9: warning: variable ‘maxControlWidth’ set but not used [-Wunused-but-set-variable]
 wevalgraph.c
 wgamelist.c
wgamelist.c: In function ‘GameListDialog’:
wgamelist.c:167:27: warning: variable ‘flags’ set but not used [-Wunused-but-set-variable]
 whistory.c
 ../history.c
 winboard.c
winboard.c: In function ‘WndProc’:
winboard.c:4721:13: warning: variable ‘wmEvent’ set but not used [-Wunused-but-set-variable]
winboard.c: In function ‘CommentDialog’:
winboard.c:6392:32: warning: variable ‘flags’ set but not used [-Wunused-but-set-variable]
winboard.c: In function ‘ErrorDialog’:
winboard.c:6757:10: warning: variable ‘hwndText’ set but not used [-Wunused-but-set-variable]
winboard.c: In function ‘GothicDialog’:
winboard.c:6807:10: warning: variable ‘hwndText’ set but not used [-Wunused-but-set-variable]
 wlayout.c
 woptions.c
woptions.c: In function ‘PaintSampleSquare’:
woptions.c:360:11: warning: variable ‘oldBrushSquare’ set but not used [-Wunused-but-set-variable]
 wsnap.c
 wsockerr.c
 help.c
 wsettings.c
wsettings.c: In function ‘GetOptionValues’:
wsettings.c:383:12: warning: variable ‘hwndCombo’ set but not used [-Wunused-but-set-variable]
wsettings.c: In function ‘AddOption’:
wsettings.c:580:2: warning: case value ‘112’ not in enumerated type ‘Control’ [-Wswitch]
wsettings.c: In function ‘PseudoOK’:
wsettings.c:891:12: warning: variable ‘saveOK’ set but not used [-Wunused-but-set-variable]
wsettings.c: In function ‘LayoutOptions’:
wsettings.c:165:38: warning: ‘nextType’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 wchat.c
wchat.c: In function ‘ChatProc’:
wchat.c:316:7: warning: value computed is not used [-Wunused-value]
wchat.c: In function ‘OutputChatMessage’:
wchat.c:408:6: warning: value computed is not used [-Wunused-value]
 ../engineoutput.c
 ../evalgraph.c
i686-pc-mingw32-gcc  backend.o book.o gamelist.o lists.o moves.o pgntags.o uci.o zippy.o parser.o wbres.o wclipbrd.o wedittags.o wengineoutput.o wevalgraph.o wgamelist.o whistory.o history.o winboard.o wlayout.o woptions.o wsnap.o wsockerr.o help.o wsettings.o wchat.o engineoutput.o evalgraph.o -lmsvcrt -DNDEBUG -fpic -s -mwindows -lwsock32 -lwinmm -lcomctl32 -o winboard.exe

This looks better than all previous outputs -- only warnings and no error. The resulting winboard.exe is 38 kb bigger than that with disabled fcntl.h and is fully functional. I checked all the previously observed bugs, and none were present in this newest compile.
Thank you for responding so fast with a new version. I will check it, and try to compile from sources with this new method.
lantonov
 
Posts: 62
Joined: 28 Feb 2014, 08:43

Re: Compiling and testing Winboard development versions

Postby H.G.Muller » 28 Feb 2014, 22:53

I went through most of the warnings, and most of them are completely innocent, and I can fix them by simply removing the 'write-only' variable completely. Only one of them (in woptions.c) seemed a genuine bug, where the 'current color' during drawing was saved, but in the end restored from a wrong variable (when drawing the example pieces in the Board Options dialog). This did not seem to cause any adverse effects, however. In two other cases (wengineoutput.c) the width of a certain control was requested, but then never used. This was in code originally written by Alessandro Scotti. Perhaps I should try to figure out what he intended to do with the width of these fields. It is true that for one of them (where the NPS is displayed) people have complained that it is not wide enough to hold the NPS, so that the last digit is not shown. So for the moment I will leave these two in.

As you have been using the relatively new book features: what do you think: Would it be useful to have a way to load an existing .bin book into WinBoard's memory buffer, so you can add PGN games to it with the Save Games as Book function? Currently you can merge multiple PGN files into one book by alternately loading them with Load Game and then use Save Games to Book during the same session, but there is no way to include something that already is in bin format.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Compiling and testing Winboard development versions

Postby lantonov » 01 Mar 2014, 00:18

I prefer to add games from a pgn file rather than from bin file. It is easier to see moves and manipulate the pgn files. It would be good to be able to add pgn moves to an existing bin file. If you have a collection of chosen games this would be easier than manually adding move by move. So, yes, if it is not too hard, such option would be useful.

I made the following experiment. Created an empty bin file 'empty.bin'. Loaded it as a book in Winboard. Loaded a pgn file with several games with 'Load games'. 'Save games to book' popped the message 'Book file exists! Try again for overwrite'. 'Save games to book' again wrote the games in the book. Next I will try to see on book.bin with some moves already in: if they will be overwritten or added to. The problem is that it is not reproducible. Sometimes the games instead of entering in the book load in the program for playing.

Regarding the new version, I compiled the latest patch xboard-a343683 with the i686-pc-mingw32-gcc compiler. Moving through the book window and adding moves by moving on board works well. Pressing 'Play move' and moving on board adds the move in the book window in the form '0.0% 1 <move>'. Pressing the 'Save' button makes this '99.9% 1 <move>'.

Your compile in Winboard-4.8beta.zip has a bug in moving through the book window. When reaching the last move in the book, the program hangs, the screen fades, and the process has to be killed through the task manager. This is reproducible and I have no clue what happens. This problem did not appear in my compile.
lantonov
 
Posts: 62
Joined: 28 Feb 2014, 08:43

Re: Compiling and testing Winboard development versions

Postby H.G.Muller » 01 Mar 2014, 11:10

lantonov wrote:Next I will try to see on book.bin with some moves already in: if they will be overwritten or added to. The problem is that it is not reproducible. Sometimes the games instead of entering in the book load in the program for playing.

No need to try it: the book would be overwritten, erased like it had never existed at all. The way it works is that WinBoard has a memory buffer that starts empty, and to which you add all (position, move) pairs of the PGN file when you press "Save Games to Book", and then writes the buffer to a .bin file. It never reads from the .bin file in connection with the buffer. (It does with Edit Book, which is a mechanism entriely independent of the Save Games to Book.) But it does also never erase the buffer, so that when you press Save Games to Book a second time, it just adds more games to those already in the buffer, and then writes the combined set to the .bin file, completely overwriting the previous one (but that is no loss, as what was written there was also still in the memory buffer.

I could relatively easily make a 'Load Book for Merging' option in the File menu, which would put the current book file in the memory buffer, overwriting what was there. (More difficult would be to merge it what was already there.) This seems a rather specialized application, however, so it might be good enough to just supply a command-line option "-mergeBook FILENAME" that would make WinBoard start not with an empty memory buffer, but with the book (which then could be different than the book specified in Common Engine) loaded into it. That would also prevent you from accidentally pressing it when you are busy adding PGN games.

Regarding the new version, I compiled the latest patch xboard-a343683 with the i686-pc-mingw32-gcc compiler. Moving through the book window and adding moves by moving on board works well. Pressing 'Play move' and moving on board adds the move in the book window in the form '0.0% 1 <move>'. Pressing the 'Save' button makes this '99.9% 1 <move>'.

Right, that is how it should work. Percentages are only recalculated when you press Save, but I let the added lines start with 0.0% for better alignment.

Your compile in Winboard-4.8beta.zip has a bug in moving through the book window. When reaching the last move in the book, the program hangs, the screen fades, and the process has to be killed through the task manager. This is reproducible and I have no clue what happens. This problem did not appear in my compile.

Be careful! I noticed that I now both have a WinBoard-4.8.beta.zip and a much older WinBoard-4.8beta.zip on my website. Are you sure you did load the first one, and that the missing dot between 8 and beta is just a typo here?
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Compiling and testing Winboard development versions

Postby lantonov » 01 Mar 2014, 13:44

I am talking about WinBoard-4.8.beta.zip and not about WinBoard-4.8beta.zip. I loaded the latter about a month ago and used it since then. It doesn't have the latest features -- move through book, add moves through board, etc. The hanging seems to be compiler-dependent because the version created in i686-pc-mingw32-gcc works normally with move through book (does not hang).

I did the experiment with book overwrite anyway, and the result was exactly as you described it. A book bin file of 40k was overwritten to become 0k. I watched the process through the Windows Explorer. The book adding that you intend to implement can be done in polyglot but there it is more difficult -- you first have to turn the pgn into bin and then merge. It would be nice to be able to quickly add just 2 or 3 games to an existing book.

I found a way to compile winboard.exe in Mingw using in the Makefile mingw32-gcc compiler (included in the Mingw distribution) instead of gcc compiler. The compiler gave the same warnings as those for Cygwin with i386-pc-mingw32-gcc. The compiled exe with Mingw was about 1kb smaller then the exe compiled with Cygwin. I think that it is due to the different gcc versions (4.8.2 in Cygwin vs 4.8.1 in Mingw).
lantonov
 
Posts: 62
Joined: 28 Feb 2014, 08:43

Re: Compiling and testing Winboard development versions

Postby H.G.Muller » 01 Mar 2014, 14:03

lantonov wrote:I am talking about WinBoard-4.8.beta.zip and not about WinBoard-4.8beta.zip. I loaded the latter about a month ago and used it since then. It doesn't have the latest features -- move through book, add moves through board, etc. The hanging seems to be compiler-dependent because the version created in i686-pc-mingw32-gcc works normally with move through book (does not hang).

Interesting. The hanging seems to occur when I click in an empty Edit Book window. But not always. When I was in Edit Game mode it just says "Could not parse move" (which is the intended behavior). But when I play against Fairy-Max, which uses GUI book, and play my own moves by clicking in Edit Book, then it crashes. Is that the same with you?
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Compiling and testing Winboard development versions

Postby lantonov » 01 Mar 2014, 16:57

I confirm your observations. In Edit game mode clicking on empty book window gives the message "Could not parse move". In Analysis and Play mode the program crashes.
Contrary to what I said in previous posts, this happens in all compiles, both yours and mine so it is not compiler-dependent.
lantonov
 
Posts: 62
Joined: 28 Feb 2014, 08:43

Re: Compiling and testing Winboard development versions

Postby H.G.Muller » 01 Mar 2014, 19:31

It seems there was a bug in searching for the end of the clicked move, but even after I fixed that, it still crashed. The code fakes that the clicked move was typed in the move type-in, and apparently this cannot handle an empty string outside Edit Game mode. I have not tried to figure out why, but I now simply ignore the click when nothing was clicked.

The new binary is at the same link. (Not updated in the source repository yet, as I maintain that on another computer.)
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Compiling and testing Winboard development versions

Postby lantonov » 01 Mar 2014, 20:40

Not reacting on empty book window is even better than popping a message box. It is easier to work too. The user clicks 2-3 times into the book window, sees that it is empty and goes on.
lantonov
 
Posts: 62
Joined: 28 Feb 2014, 08:43

Re: Compiling and testing Winboard development versions

Postby lantonov » 03 Mar 2014, 01:13

The newest development version xboard-51af071 gave almost perfect compile with Mingw:
Code: Select all
$ make -f makefile.gcc
 ../backend.c
 ../book.c
 ../gamelist.c
 ../lists.c
 ../moves.c
 ../pgntags.c
 ../uci.c
 ../zippy.c
 ../parser.c
windres -D_WIN32_IE=0x0300 -DWIN32 --use-temp-file --include-dir .. winboard.rc
-O coff -o wbres.o
 wclipbrd.c
 wedittags.c
 wengineoutput.c
wengineoutput.c: In function 'ResizeWindowControls':
wengineoutput.c:181:9: warning: variable 'npsWidth' set but not used [-Wunused-b
ut-set-variable]
     int npsWidth;
         ^
wengineoutput.c:180:9: warning: variable 'maxControlWidth' set but not used [-Wu
nused-but-set-variable]
     int maxControlWidth;
         ^
 wevalgraph.c
 wgamelist.c
 whistory.c
 ../history.c
 winboard.c
 wlayout.c
 woptions.c
 wsnap.c
 wsockerr.c
 help.c
 wsettings.c
 wchat.c
 ../engineoutput.c
 ../evalgraph.c
"C:/Program Files/Help Workshop/hcrtf" -xn winboard.hpj && @cat winboard.err &&
@mv winboard.hlp tmp.hlp && @mv tmp.hlp winboard.hlp || true # these moves to ge
t the case right
/bin/sh: @cat: command not found
mingw32-gcc  backend.o book.o gamelist.o lists.o moves.o pgntags.o uci.o zippy.o
 parser.o wbres.o wclipbrd.o wedittags.o wengineoutput.o wevalgraph.o wgamelist.
o whistory.o history.o winboard.o wlayout.o woptions.o wsnap.o wsockerr.o help.o
 wsettings.o wchat.o engineoutput.o evalgraph.o -lmsvcrt -DNDEBUG -fpic -s -mwin
dows -lwsock32 -lwinmm -lcomctl32 -o winboard.exe

Only 2 warnings which do not seem serious.
lantonov
 
Posts: 62
Joined: 28 Feb 2014, 08:43

Re: Compiling and testing Winboard development versions

Postby lantonov » 06 Sep 2014, 08:23

Now I tried to compile Winboard with Microsoft Visual Studio 2010 from the command prompt. This is what I got:
Code: Select all
C:\Mingw\xboard-bf20302\winboard>nmake /f makefile.ms

Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

backend.c
../backend.c(917) : warning C4113: 'void (__cdecl *)()' differs in parameter lis
ts from 'DelayedEventCallback'
../backend.c(1986) : warning C4113: 'void (__cdecl *)()' differs in parameter li
sts from 'DelayedEventCallback'
../backend.c(5250) : warning C4113: 'void (__cdecl *)()' differs in parameter li
sts from 'DelayedEventCallback'
../backend.c(8375) : error C2143: syntax error : missing ';' before 'type'
../backend.c(8376) : error C2275: 'HMODULE' : illegal use of this type as an exp
ression
        C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\windef.h(281) : se
e declaration of 'HMODULE'
../backend.c(8376) : error C2146: syntax error : missing ';' before identifier '
lib'
../backend.c(8376) : error C2065: 'lib' : undeclared identifier
../backend.c(8377) : error C2275: 'PLOAD_EGBB' : illegal use of this type as an
expression
        ../backend.c(8345) : see declaration of 'PLOAD_EGBB'
../backend.c(8377) : error C2146: syntax error : missing ';' before identifier '
loadBB'
../backend.c(8377) : error C2065: 'loadBB' : undeclared identifier
../backend.c(8378) : error C2065: 'path' : undeclared identifier
../backend.c(8379) : error C2065: 'buf' : undeclared identifier
../backend.c(8379) : warning C4047: 'function' : 'char *' differs in levels of i
ndirection from 'int'
../backend.c(8379) : warning C4024: 'strncpy' : different types for formal and a
ctual parameter 1
../backend.c(8379) : error C2065: 'path' : undeclared identifier
../backend.c(8379) : warning C4047: 'function' : 'const char *' differs in level
s of indirection from 'int'
../backend.c(8379) : warning C4024: 'strncpy' : different types for formal and a
ctual parameter 2
../backend.c(8380) : error C2065: 'p' : undeclared identifier
../backend.c(8380) : error C2065: 'buf' : undeclared identifier
../backend.c(8380) : warning C4047: 'function' : 'const char *' differs in level
s of indirection from 'int'
../backend.c(8380) : warning C4024: 'strchr' : different types for formal and ac
tual parameter 1
../backend.c(8380) : warning C4047: '=' : 'int' differs in levels of indirection
 from 'char *'
../backend.c(8380) : error C2065: 'p' : undeclared identifier
../backend.c(8380) : error C2100: illegal indirection
../backend.c(8380) : error C2065: 'p' : undeclared identifier
../backend.c(8380) : error C2065: 'buf' : undeclared identifier
../backend.c(8380) : error C2065: 'buf' : undeclared identifier
../backend.c(8380) : warning C4047: 'function' : 'const char *' differs in level
s of indirection from 'int'
../backend.c(8380) : warning C4024: 'strlen' : different types for formal and ac
tual parameter 1
../backend.c(8381) : error C2065: 'p' : undeclared identifier
../backend.c(8381) : warning C4047: 'function' : 'char *' differs in levels of i
ndirection from 'int'
../backend.c(8381) : warning C4024: '_snprintf' : different types for formal and
 actual parameter 1
../backend.c(8381) : error C2065: 'buf' : undeclared identifier
../backend.c(8381) : warning C4047: 'function' : 'const char *' differs in level
s of indirection from 'int'
../backend.c(8381) : warning C4024: 'strlen' : different types for formal and ac
tual parameter 1
../backend.c(8382) : error C2065: 'lib' : undeclared identifier
../backend.c(8382) : error C2065: 'buf' : undeclared identifier
../backend.c(8382) : warning C4047: 'function' : 'LPCSTR' differs in levels of i
ndirection from 'int'
../backend.c(8382) : warning C4024: 'LoadLibraryA' : different types for formal
and actual parameter 1
../backend.c(8382) : warning C4047: '=' : 'int' differs in levels of indirection
 from 'HMODULE'
../backend.c(8383) : error C2065: 'lib' : undeclared identifier
../backend.c(8384) : error C2065: 'loadBB' : undeclared identifier
../backend.c(8384) : error C2065: 'lib' : undeclared identifier
../backend.c(8384) : warning C4047: 'function' : 'HMODULE' differs in levels of
indirection from 'int'
../backend.c(8384) : warning C4024: 'GetProcAddress' : different types for forma
l and actual parameter 1
../backend.c(8384) : warning C4047: '=' : 'int' differs in levels of indirection
 from 'PLOAD_EGBB'
../backend.c(8385) : error C2065: 'lib' : undeclared identifier
../backend.c(8385) : warning C4047: 'function' : 'HMODULE' differs in levels of
indirection from 'int'
../backend.c(8385) : warning C4024: 'GetProcAddress' : different types for forma
l and actual parameter 1
../backend.c(8386) : error C2065: 'loadBB' : undeclared identifier
../backend.c(8387) : error C2065: 'p' : undeclared identifier
../backend.c(8387) : error C2109: subscript requires array or pointer type
../backend.c(8387) : error C2065: 'buf' : undeclared identifier
../backend.c(9000) : warning C4047: '=' : 'char *' differs in levels of indirect
ion from 'int'
../backend.c(11480) : warning C4113: 'void (__cdecl *)()' differs in parameter l
ists from 'DelayedEventCallback'
../backend.c(11733) : warning C4113: 'void (__cdecl *)()' differs in parameter l
ists from 'DelayedEventCallback'
../backend.c(14520) : warning C4113: 'void (__cdecl *)()' differs in parameter l
ists from 'DelayedEventCallback'
../backend.c(16746) : warning C4113: 'void (__cdecl *)()' differs in parameter l
ists from 'DelayedEventCallback'
../backend.c(16747) : warning C4113: 'void (__cdecl *)()' differs in parameter l
ists from 'DelayedEventCallback'
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BI
N\cl.EXE"' : return code '0x2'
Stop.


In the makefile.ms, it was VCVER=8.
Note that, with a big help from HGM (thanks!), I compiled Winboad with Mingw and Cygwin with only a couple of mild warnings.
lantonov
 
Posts: 62
Joined: 28 Feb 2014, 08:43

Re: Compiling and testing Winboard development versions

Postby H.G.Muller » 06 Sep 2014, 21:50

There is indeed a violation of the C syntax in the bitbases routine, which puts an assignment statement before declarations. Gcc does not seem to care about this, but MSVS then refuses to accept the declarations that follow, leading to an avelanch of errors. Line 8374-77 should really be:

Code: Select all
   char *p, *path = strstr(appData.egtFormats, "scorpio:"), buf[MSG_SIZ];
   HMODULE lib;
   PLOAD_EGBB loadBB;
   loaded = 2; // prepare for failure
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Compiling and testing Winboard development versions

Postby lantonov » 07 Sep 2014, 09:36

Now with the corrected version it is:
Code: Select all
C:\Mingw\xboard-c7c73ac\winboard>nmake /f makefile.ms

Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

backend.c
../backend.c(917) : warning C4113: 'void (__cdecl *)()' differs in parameter lis
ts from 'DelayedEventCallback'
../backend.c(1986) : warning C4113: 'void (__cdecl *)()' differs in parameter li
sts from 'DelayedEventCallback'
../backend.c(5250) : warning C4113: 'void (__cdecl *)()' differs in parameter li
sts from 'DelayedEventCallback'
../backend.c(9000) : warning C4047: '=' : 'char *' differs in levels of indirect
ion from 'int'
../backend.c(11483) : warning C4113: 'void (__cdecl *)()' differs in parameter l
ists from 'DelayedEventCallback'
../backend.c(11736) : warning C4113: 'void (__cdecl *)()' differs in parameter l
ists from 'DelayedEventCallback'
../backend.c(14523) : warning C4113: 'void (__cdecl *)()' differs in parameter l
ists from 'DelayedEventCallback'
../backend.c(16751) : warning C4113: 'void (__cdecl *)()' differs in parameter l
ists from 'DelayedEventCallback'
../backend.c(16752) : warning C4113: 'void (__cdecl *)()' differs in parameter l
ists from 'DelayedEventCallback'
book.c
gamelist.c
lists.c
moves.c
pgntags.c
uci.c
zippy.c
parser.c
../parser.c(91) : error C2054: expected '(' to follow 'inline'
../parser.c(92) : error C2085: 'Match' : not in formal parameter list
../parser.c(92) : error C2143: syntax error : missing ';' before '{'
../parser.c(103) : error C2054: expected '(' to follow 'inline'
../parser.c(104) : error C2085: 'Word' : not in formal parameter list
../parser.c(104) : error C2143: syntax error : missing ';' before '{'
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\BI
N\cl.EXE"' : return code '0x2'
Stop.
lantonov
 
Posts: 62
Joined: 28 Feb 2014, 08:43

Next

Return to WinBoard development and bugfixing

Who is online

Users browsing this forum: No registered users and 7 guests