Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old February 16, 2015, 09:49   #51
KarlM
Rookie
 
Join Date: May 2007
Location: Canberra, Australia
Posts: 16
KarlM is on a distinguished road
Quote:
Originally Posted by TJS View Post
Ah ok thanks for the information, I guess that Angband is not going to normally be compilable on Visual C++.

I might look into using another compiler and IDE, what do other people use when compiling the game?
Run some version of Linux in a VM. My fave is debian in VirtualBox, but you have many options.
__________________
"You hit Morgoth, Lord of Darkness. You have slain Morgoth, Lord of Darkness. Congratulations, you have won the game. The Great Wyrm of Balance breathes chaos. You die."
KarlM is offline   Reply With Quote
Old February 17, 2015, 12:05   #52
TJS
Swordsman
 
Join Date: May 2008
Posts: 473
TJS is on a distinguished road
Quote:
Originally Posted by Nick View Post
I tend to favour utility over shininess.

I think
Code:
static struct init_module arrays_module = {
"arrays",
init_arrays,
cleanup_arrays
};
should work (and the same for any other similar construction). Let me know if it does, and what other problems you run into, and we'll see what we can do
Thanks that fixed that problem, but unfortunately there are loads of other errors as well:

1>c:\games\roguelikes\development\angband-latest\src\z-set.c(69): error C2065: 'ssize_t' : undeclared identifier
1>c:\games\roguelikes\development\angband-latest\src\z-set.c(69): error C2146: syntax error : missing ';' before identifier 'i'
1>c:\games\roguelikes\development\angband-latest\src\z-set.c(69): error C2065: 'i' : undeclared identifier
1>c:\games\roguelikes\development\angband-latest\src\win\win-layout.c(21): fatal error C1083: Cannot open include file: 'ui-term.h': No such file or directory
1>c:\games\roguelikes\development\angband-latest\src\win\scrnshot.c(20): fatal error C1083: Cannot open include file: 'png.h': No such file or directory
1>c:\games\roguelikes\development\angband-latest\src\mon-lore.c(1545): error C2057: expected constant expression

There's a fair few more after that (and probably more if those get fixed).

I guess I'll have to look at other compilers.

Quote:
TJS did say they were using VS express 2010 - MS might have improved C99 support in VS 2012 and 2013 (which also have free express versions).
I have the latest VS Express too, but it doesn't even allow you to create an empty win32 project (which is ridiculous).
TJS is offline   Reply With Quote
Old February 17, 2015, 13:24   #53
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 55
Posts: 8,638
Donated: $60
Nick will become famous soon enough
If you want to keep trying:

Quote:
Originally Posted by TJS View Post
1>c:\games\roguelikes\development\angband-latest\src\z-set.c(69): error C2065: 'ssize_t' : undeclared identifier
1>c:\games\roguelikes\development\angband-latest\src\z-set.c(69): error C2146: syntax error : missing ';' before identifier 'i'
1>c:\games\roguelikes\development\angband-latest\src\z-set.c(69): error C2065: 'i' : undeclared identifier
Replace ssize_t with int

Quote:
Originally Posted by TJS View Post
1>c:\games\roguelikes\development\angband-latest\src\win\win-layout.c(21): fatal error C1083: Cannot open include file: 'ui-term.h': No such file or directory
Looks like an issue with not finding a higher level directory
Quote:
Originally Posted by TJS View Post
1>c:\games\roguelikes\development\angband-latest\src\win\scrnshot.c(20): fatal error C1083: Cannot open include file: 'png.h': No such file or directory
This thread has some discussion of png issues (plus discussion of the ssize_t error, amd others)
Quote:
Originally Posted by TJS View Post
1>c:\games\roguelikes\development\angband-latest\src\mon-lore.c(1545): error C2057: expected constant expression
As per thread, replace list_size with a #define value, or just 64

I'm disappointed more recent versions didn't help - you couldn't import a 2010 project, could you?
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old February 17, 2015, 16:25   #54
EpicMan
Swordsman
 
Join Date: Dec 2009
Location: Dallas, Texas, USA
Posts: 436
EpicMan is on a distinguished road
I'm using VS 2013 at work and it has an empty project option under "Visual C++" that I use to compile 'Bands. As long as everything is a .c file it will compile as C and not C++. It's the premium version but I'd be surprised if the Express one lacked that option.

Getting sound to work is also a pain, but you can just comment out the #define SOUND statement (at least with older versions, haven't looked at the post-restructure code yet).
EpicMan is offline   Reply With Quote
Old February 17, 2015, 17:03   #55
Ingwe Ingweron
Veteran
 
Join Date: Jan 2009
Location: Manhattan Beach, CA
Posts: 2,005
Ingwe Ingweron is on a distinguished road
Any chance of moving this discussion to a new thread? Every time I see Restructure update, I'm excited to see news from Nick and hoping to start playing a dev 4.0 version.
Ingwe Ingweron is offline   Reply With Quote
Old February 17, 2015, 21:06   #56
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 55
Posts: 8,638
Donated: $60
Nick will become famous soon enough
Quote:
Originally Posted by Ingwe Ingweron View Post
Any chance of moving this discussion to a new thread? Every time I see Restructure update, I'm excited to see news from Nick and hoping to start playing a dev 4.0 version.
Don't worry, when that happens I'll start a new thread

Sorry for getting your hopes up this time...
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old February 18, 2015, 14:48   #57
TJS
Swordsman
 
Join Date: May 2008
Posts: 473
TJS is on a distinguished road
Quote:
Originally Posted by Nick View Post
If you want to keep trying:


Replace ssize_t with int


Looks like an issue with not finding a higher level directory

This thread has some discussion of png issues (plus discussion of the ssize_t error, amd others)

As per thread, replace list_size with a #define value, or just 64

I'm disappointed more recent versions didn't help - you couldn't import a 2010 project, could you?
Hey up, sorry for the delay in replying I've not had a chance to have a look at this until now.

Ok so it turns out there are two Visual Studio 2013 applications, one is called Visual Studio 2013 for Windows and the other is Visual Studio 2013 for Windows Desktop. I needed the latter and had installed the former.

The good news is that it does apparently conform to the C99 standards (or at least most of them). So the struct initialisation problem has gone away now.

[I still need to comment out get.c and get.h and you still can't use a static constant to define array length. I still had to replace ssize_t with int too. So maybe it doesn't use all the latest standards]

There are still a couple of compilation errors:

Error 4 error C2133: 'itypes' : unknown size angband-latest\src\load.c Line 780
Error 5 error C4703: potentially uninitialized local pointer variable 'chunk' used angband-latest\src\generate.c Line 752
Error 6 error C4703: potentially uninitialized local pointer variable 'info_ptr' used angband-latest\src\win\scrnshot.c Line 106

Quote:
Any chance of moving this discussion to a new thread? Every time I see Restructure update, I'm excited to see news from Nick and hoping to start playing a dev 4.0 version.
Apologies for spamming this thread with this stuff.
TJS is offline   Reply With Quote
Old February 18, 2015, 21:56   #58
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 55
Posts: 8,638
Donated: $60
Nick will become famous soon enough
Quote:
Originally Posted by TJS View Post
The good news is that it does apparently conform to the C99 standards (or at least most of them). So the struct initialisation problem has gone away now.
Great.

Quote:
[I still need to comment out get.c and get.h and you still can't use a static constant to define array length. I still had to replace ssize_t with int too. So maybe it doesn't use all the latest standards]
ssize_t is not C standard (it's POSIX standard), so we should be using int. get.c and get.h are not included in the standard buildsystem build, and will probably go from the codebase altogether.


Quote:
Code:
Error	4	error C2133: 'itypes' : unknown size  angband-latest\src\load.c	Line 780
This is another non-constant array declaration - my bad.

Quote:
Code:
Error	5	error C4703: potentially uninitialized local pointer variable 'chunk' used	angband-latest\src\generate.c	Line 752
Error	6	error C4703: potentially uninitialized local pointer variable 'info_ptr' used	angband-latest\src\win\scrnshot.c	Line 106
These are both pointer variables that should be initialized to NULL when they're defined.

Thanks for picking up all these - I will get to fixing them at some point, but this should keep you going for now.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old February 19, 2015, 11:46   #59
KarlM
Rookie
 
Join Date: May 2007
Location: Canberra, Australia
Posts: 16
KarlM is on a distinguished road
So you guys don't use the compiler to check for this stuff? It can save you a lot of time.

eg
http://stackoverflow.com/questions/3...-clean-up-code
__________________
"You hit Morgoth, Lord of Darkness. You have slain Morgoth, Lord of Darkness. Congratulations, you have won the game. The Great Wyrm of Balance breathes chaos. You die."
KarlM is offline   Reply With Quote
Old February 19, 2015, 16:27   #60
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,372
AnonymousHero is on a distinguished road
Quote:
Originally Posted by KarlM View Post
So you guys don't use the compiler to check for this stuff? It can save you a lot of time.

eg
http://stackoverflow.com/questions/3...-clean-up-code
First of all that advice is 7 years old, i.e. ancient and largely irrelevant these days. Don't bother with static checkers unless you're writing aerospace software and are ready to deal with ALL the warnings/checks on a continual basis. (And run multiple linters and such.)

What you want for practical applications is to just add

-fsanitize=undefined
-fsanitize=address

to the clang/gcc command line. It's runtime checking, but the fact that it only points out real errors that you actually hit in the game means that it's actually humanly possible to actually fix all the issues.
AnonymousHero 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
Ladder restructure request OOD Town drunk Vanilla 7 April 4, 2013 17:11
v4 update Magnate v4 10 December 13, 2011 14:40
Ladder Update UglySquirrell Vanilla 2 September 20, 2011 05:50
Quickband update Antoine Variants 11 March 21, 2011 02:26
Help me update PosBand! pampl Development 20 December 27, 2010 19:55


All times are GMT +1. The time now is 20:12.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.