NetHack / NetHack

Official NetHack Git Repository

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nmake vs code file error

tsukYYnethack opened this issue · comments

When i nmake build custom NetHack the extern.h file shows only error of non having '(' , ')' , '*' , ','
image
Fix for it? Thx anyway!

There's insufficient information provided by the screen capture above to really assist you.

Ideally, you need to provide a complete build log, that shows the commands that you entered, the commands being executed including the arguments to those commands, and the output.

Makefile.mingw32 is meant to be used with GNU make and a shell such as bash. Are you using such a shell? If not, you'll have to replace all the external commands in the Makefile with alternative commands that work in your environment to accomplish the same thing. That sounds like a lot of extra trial-and-error work.

I recommend you use a shell that the existing Makefile.mingw32 was written for, but that's up to you of course.

If I had to guess the cause of the specific error shown in your image above, it would probably be an invalid ../include/nhlua.h file, probably because of the shell issue I just described. The ../include/nhlua.h file is created during the Makefile processing.

Where did you obtain your mingw-w64 from?

official MinGW installer

Sorry for misproviding but i used the nmake command in visual studio code shell
only commands i executed were
cd src
copy ..\sys\windows\Makefile.nmake Makefile
nmake install

What operating system and version are you doing that on?

Windows 11

Have you read sys/windows/Install.windows?

Which compiler, referenced in that file, did you download?

i have linux subsystem if it matters

of course i did reade it

and its saying in visual studio 2022

And where is your Lua located on your system?

lib\lua-5.4.6
and pdcursedmod and the pdcurses are in lib\ in separete folders

lib\ in Nethack folder

I think your include/nhlua.h is messed up. I can confirm if you post its contents, but try starting fresh:
nmake spotless
nmake install

thx its now good :)

exept it says that cursidial.c cant open #include file cursedial.h i will try again

nah its again like this

In src/Makefile, find this:

# if next line is commented out, full compiler command lines will be output
Q=@

and comment it out like so:

# if next line is commented out, full compiler command lines will be output
#Q=@

Then, post the output of the cursdial compile.

the same

image
the full size kinda there is more

cd ..\sys\windows
nhsetup.bat
cd ..\..\src
(Do not edit the Makefile!)
nmake clean
nmake install

Edit: fix path to Windows slash

there actually isnt curses.h idk what is happening

The "cl /I /I\pdurses" in your output doesn't look correct.
It should look like this:

cl /I..\lib\pdcursesmod /I..\lib\pdcursesmod\pdcurses -c -nologo -D"_CRT_NONSTDC_NO_DEPRECATE" -D"_CRT_SECURE_NO_DEPRECATE"  -D"_LIB" -D"_SCL_SECURE_NO_DEPRECATE" -D"_VC80_UPGRADE=0x0600" -D"_MBCS"  -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -D"NDEBUG" -D"YY_NO_UNISTD_H"  -DHAS_STDINT_H -DHAS_INLINE   -EHsc -fp:precise -Gd -GF -GS -Gy  -sdl -WX- -Zc:forScope -Zc:wchar_t -Zi -analyze- -D"_DEBUG" -MTd -RTC1 -Od /fsanitize=address -D_X86_=1  -DWIN32 -D_WIN32 -W4 -wd4100 -wd4244 -wd4245 -wd4310 -wd4706 -w44777 -wd4820 -w44774 /I..\include /I..\sys\windows /I..\lib\lua-5.4.6\src  -DDLB -DSAFEPROCS  -DSND_LIB_WINDSOUND -DUSER_SOUNDS -DSND_SOUNDEFFECTS_AUTOMAP -D"CURSES_GRAPHICS" -DPDC_NCMOUSE -DCURSES_UNICODE -DPDC_WIDE -D"_CONSOLE" -DWIN32CON -D"CURSES_GRAPHICS" -DPDC_NCMOUSE -DTILES -DMSWIN_GRAPHICS -DNOTTYGRAPHICS -D"CURSES_GRAPHICS" -DPDC_NCMOUSE   -Foobjtty\x86\cursdial.o ..\win\curses\cursdial.c
cursdial.c

oh wait
image
is the PDCURSETOP right?

Sending screen shots isn't productive. There's information at the start of the build that is critical to resolving issues. The full text log would be much more useful.

image
I think this wrong also

Yea i see cl for the lua is correct but the pdcurse isnt good for real.

It might be a bug in Makefile.nmake. I'll have a look.

I think i set the pdcurse folder wrong. But idk i did what the Install.windows says

You could try this:
nmake INTERNET_AVAILABLE=Y install

NMAKE : fatal error U1073: don't know how to make '..\sound\windsound\windsound.c'
now this error is interesting XD?

now if i nmake install or anything its saying this error

How did you obtain your NetHack sources?

i fixed the curses.h thing when i just copied the curses.h from pdcurse

trought github repository

i fixed the curses.h thing when i just copied the curses.h from pdcurse

I'm afraid that's a really bad idea. It will freeze that copy of a file that doesn't come with NetHack, it comes from pdcursesmod. Now when pdcursesmod is improved, you'll be stuck with the old version in a NetHack directory other than lib/pdcursesmod.

oh yeah

i removed it

i changed the pdcurse top and i will see if it works now

it works but the wind thing doesnt

Take a step back. Just a moment ago, I started with a fresh, empty directory on my machine.
The entire process, including cloning a fresh copy of NetHack from GitHub took 6 commands:

git clone https://github.com/NetHack/NetHack.git
cd NetHack
cd sys\windows
.\nhsetup.bat
cd ..\..\src
nmake INTERNET_AVAILABLE=Y install

There's a full log in here, and everything I had to type in is marked in green.
Build-nethack-on-windows.pdf

Text version of the full log without colour-coding:
nh.log

thx i will try it

Its ok it worked. But it says that there is error and i should reinstall it when i open nethack.exe

the error is proceed because clang_rt.asan_dynamic-i386

Edit src/Makefile and comment out the line that says ASAN=/fsanitize=address by putting a '#' at the start of the line.

!IF ($(VSVER) >= 2019)
#ASAN=/fsanitize=address
!ELSE
ASAN=
!ENDIF

Then rebuild:

nmake spotless
nmake install

I'll fix that so it isn't the default in sys/windows/Makefile.nmake.

thank u for your patiance for my dumass to run the custom build, it works only the symbol.template is missing but thats easy work. Have a great day men!
Just asking when im fullscreen nethack curses how to make it to not bug and is making the font bigger a cause of texture bug.
And i OPTIONS=perm_invent doesnt work

You are seeing stuff in the wrong place with the curses interface because pdcursesmod under the current version of the relatively new Windows Terminal, along with the NetHack 3.7 work-in-progress code, don't interact correctly.

Until those interactions get resolved (and I'm sure they will), use your terminal window pulldown 'v", on the top bar, to run it under cmd for now.

Note that this is not exactly a NetHack issue, although we may be able to work around it in NetHack at some point.

Build issue in title was apparently resolved during follow-up discussion. Closing.