lhmouse / nano-win

GNU nano text editor for Windows [WARNING: The master branch is constantly rebased and force-pushed so don't expect it to be steady!! -end WARNING]
https://files.lhmouse.com/nano-win/
GNU General Public License v3.0
210 stars 25 forks source link

../../../ncurses-6.2/ncurses/curses.priv.h:2613:5: error: unknown type name ‘HANDLE’ #29

Closed SamuelMarks closed 3 years ago

SamuelMarks commented 3 years ago
$ ./build_nano-win.sh
[omit succeeding output]
gcc -DHAVE_CONFIG_H -I../ncurses -I. -I../../../ncurses-6.2/ncurses -I../include -I../../../ncurses-6.2/ncurses/../include -D__USE_MINGW_ANSI_STDIO -DHAVE_NCURSESW_NCURSES_H                   -I"C:/Users/samuel/repos/test_repos/nano-win/pkg_x86_64-w64-mingw32/include" -I"C:/Users/samuel/repos/test_repos/nano-win/pkg_x86_64-w64-mingw32/include/ncursesw" -D_XOPEN_SOURCE=600 -DNDEBUG -DWINVER=0x0501 -DWIN32_LEAN_AND_MEAN -DUSE_WIN32CON_DRIVER -O2 -pthread --param max-inline-insns-single=1200 -c ../../../ncurses-6.2/ncurses/base/lib_beep.c -o ../objects/lib_beep.o
In file included from ../../../ncurses-6.2/ncurses/tty/hashmap.c:71:
../../../ncurses-6.2/ncurses/curses.priv.h:2613:5: error: unknown type name ‘HANDLE’
 2613 |     HANDLE  fd,
      |     ^~~~~~
In file included from ../../../ncurses-6.2/ncurses/tty/hardscroll.c:149:
../../../ncurses-6.2/ncurses/curses.priv.h:2613:5: error: unknown type name ‘HANDLE’
 2613 |     HANDLE  fd,
      |     ^~~~~~
../../../ncurses-6.2/ncurses/curses.priv.h:2617:5: error: unknown type name ‘HANDLE’
 2617 |     HANDLE fd,
      |     ^~~~~~
../../../ncurses-6.2/ncurses/curses.priv.h:2617:5: error: unknown type name ‘HANDLE’
 2617 |     HANDLE fd,
      |     ^~~~~~
make[1]: *** [Makefile:983: ../objects/hardscroll.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:987: ../objects/hashmap.o] Error 1
.. adding -P option to work around gcc 10.2.0
.. adding -P option to work around gcc 10.2.0
In file included from ../../../ncurses-6.2/ncurses/base/lib_addch.c:37:
../../../ncurses-6.2/ncurses/curses.priv.h:2613:5: error: unknown type name ‘HANDLE’
 2613 |     HANDLE  fd,
      |     ^~~~~~
../../../ncurses-6.2/ncurses/curses.priv.h:2617:5: error: unknown type name ‘HANDLE’
 2617 |     HANDLE fd,
      |     ^~~~~~
make[1]: *** [Makefile:991: ../objects/lib_addch.o] Error 1
In file included from ../../../ncurses-6.2/ncurses/base/lib_addstr.c:46:
../../../ncurses-6.2/ncurses/curses.priv.h:2613:5: error: unknown type name ‘HANDLE’
 2613 |     HANDLE  fd,
      |     ^~~~~~
../../../ncurses-6.2/ncurses/curses.priv.h:2617:5: error: unknown type name ‘HANDLE’
 2617 |     HANDLE fd,
      |     ^~~~~~
make[1]: *** [Makefile:995: ../objects/lib_addstr.o] Error 1
In file included from ../../../ncurses-6.2/ncurses/base/lib_beep.c:44:
../../../ncurses-6.2/ncurses/curses.priv.h:2613:5: error: unknown type name ‘HANDLE’
 2613 |     HANDLE  fd,
      |     ^~~~~~
../../../ncurses-6.2/ncurses/curses.priv.h:2617:5: error: unknown type name ‘HANDLE’
 2617 |     HANDLE fd,
      |     ^~~~~~
make[1]: *** [Makefile:999: ../objects/lib_beep.o] Error 1
lhmouse commented 3 years ago

Please make sure you have mingw-w64-x86_64-gcc and mingw-w64-i686-gcc installed.

This error seems to be caused by failure to find x86_64-w64-mingw32-gcc. The configure script uses plain gcc as a fallback, which is the MSYS2 GCC and can't be used.

SamuelMarks commented 3 years ago

I was missing mingw-w64-i686-gcc. After installing it and recloning and rerunning I was left in the same boat (same error)

lhmouse commented 3 years ago

If the command that is causing an error starts with gcc then there's definitely something wrong.

Note the build_nano.sh script selects x86_64-w64-mingw32 by default. In order to build for i686-w64-mingw32, you have to specify it explicitly, like ./build_nano-win.sh i686.

SamuelMarks commented 3 years ago

Hmm, maybe it's because I manually pacman installed clang gcc; so removing both and now [after the whole reclone rerun dance] is:

checking for x86_64-w64-mingw32-gcc... no
checking for x86_64-w64-mingw32-cc... no
checking for gcc... no
checking for cc... no
configure: error: no acceptable cc found in $PATH

Why can't it find those MinGW CCs?

lhmouse commented 3 years ago

It's because you are in MSYS shell. Run ./build_nano-win.sh in MINGW64 shell instead. (If you want the 32-bit build you have to run ./build_nano-win.sh i686 in MINGW32 shell.) Otherwise the /mingw64/bin directory will not be in your PATH.

SamuelMarks commented 3 years ago

Thanks took a while to run but it worked this time!

  v5.6.1-100-g2077e573