Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old December 27, 2017, 21:38   #1
rjphares
Rookie
 
Join Date: Dec 2017
Posts: 4
rjphares is on a distinguished road
Trouble compiling Angband

I'm on Windows 8.1 using visual studio 2017. I get error: Error C1189 #error: Macro definition of snprintf conflicts with Standard Library function declaration Angband1 c:\program files (x86)\windows kits\10\include\10.0.16299.0\ucrt\stdio.h 1933

Please help. Thanks.
rjphares is offline   Reply With Quote
Old December 27, 2017, 21:48   #2
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 52
Posts: 6,801
Donated: $60
Nick is on a distinguished road
Try going into the file src\h-basic.h, removing these lines:
Code:
/**
 * Native MSVC compiler doesn't understand inline or snprintf
 */
#ifdef _MSC_VER
#	define inline __inline
#	define snprintf _snprintf
#endif
and see what happens.

Those lines were apparently to deal with deficiencies in the Microsoft compiler which look like they may have been fixed. Let us know how you go.
__________________
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them.
Nick is offline   Reply With Quote
Old December 27, 2017, 23:32   #3
rjphares
Rookie
 
Join Date: Dec 2017
Posts: 4
rjphares is on a distinguished road
I'm down to 4 errors:

Error (active) E0028 expression must have a constant value Angband1 c:\Users\Robert\source\repos\Angband1\Angband1\loa d.c 808

Error C2057 expected constant expression Angband1 c:\users\robert\source\repos\angband1\angband1\loa d.c 808

Error C2466 cannot allocate an array of constant size 0 Angband1 c:\users\robert\source\repos\angband1\angband1\loa d.c 808

Error C2133 'itypes': unknown size Angband1 c:\users\robert\source\repos\angband1\angband1\loa d.c 808


line 808 from load.c looks like:
Code:
 	bitflag flags, itypes[itype_size];
rjphares is offline   Reply With Quote
Old December 28, 2017, 04:28   #4
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 52
Posts: 6,801
Donated: $60
Nick is on a distinguished road
OK, you can safely replace itype_size with ITYPE_SIZE in that line, which should fix that problem.
__________________
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them.
Nick is offline   Reply With Quote
Old December 28, 2017, 17:53   #5
rjphares
Rookie
 
Join Date: Dec 2017
Posts: 4
rjphares is on a distinguished road
2 errors:
Error LNK2001 unresolved external symbol _init_sound_win Angband1 C:\Users\Robert\source\repos\Angband1\Angband1\sou nd-core.obj 1

Error LNK1120 1 unresolved externals Angband1 C:\Users\Robert\source\repos\Angband1\Debug\Angban d1.exe 1

I may end up having to start over from the beginning.
This is what I did since the visual studio instructions are out of date:
  • Added libpng.dll and zlib1.dll to project directory.
  • Added zlib1.lib(no such file, I tried renaming) libpng.lib msimg32.lib winmm.lib to Properties->Linker->Input->Additional Dependencies
  • Added all src ".h" and ".c" files, excluding files with "main" and snd-sdl.c to project directory and project.
  • Added all src\win ".h" and ".c" files to project directory and project.
  • Added all src\win angband.rc and angband.ico files to project directory and project.
  • Added all src\win\include ".h" files to project directory and project.
  • Added main-win.c file to project directory and project.
rjphares is offline   Reply With Quote
Old January 11, 2018, 20:00   #6
rjphares
Rookie
 
Join Date: Dec 2017
Posts: 4
rjphares is on a distinguished road
I think I'm going to wait to compile until there is an update for visual studio instructions. Thanks for the help.
rjphares is offline   Reply With Quote
Old January 11, 2018, 22:37   #7
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 52
Posts: 6,801
Donated: $60
Nick is on a distinguished road
Sorry, I missed your last post.

You could try replacing
Code:
errr init_sound_win(struct sound_hooks *hooks, int argc, char **argv);
in src/snd-win.h with
Code:
extern errr init_sound_win(struct sound_hooks *hooks, int argc, char **argv);
from where you were at that point, and see if that works.
__________________
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them.
Nick is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble compiling spara Development 3 December 20, 2016 20:34
re: Get Angband and compiling it Tibarius Development 0 June 29, 2015 11:42
Compiling Z+Angband Ravenheart87 Variants 7 May 24, 2011 09:35
Angband startup trouble. Zambaku Vanilla 1 January 1, 2008 06:43
Trouble compiling angband 3.0.9 on linux RastaRuedi Vanilla 2 August 1, 2007 18:28


All times are GMT +1. The time now is 10:00.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.