Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old December 24, 2010, 21:11   #1
Omnipact
Rookie
 
Join Date: Jun 2007
Location: Bristol, UK
Posts: 23
Omnipact is on a distinguished road
Compiling 3.2

So I'm trying to compile Angband on WinXP with the SDL frontend...
I'm using code::blocks with the mingw stuff.

I get some very strange warnings:

Code:
||=== Angband, Debug ===|
C:\SDL-1.2.14\include\SDL_config.h|74|warning: "HAVE_STDINT_H" redefined|
C:\angband-3.2.0\src\h-basic.h|38|warning: this is the location of the previous definition|
C:\angband-3.2.0\src\main-sdl.c||In function 'Term_xtra_sdl_event':|
C:\angband-3.2.0\src\main-sdl.c|2738|warning: implicit declaration of function 'usleep'|
C:\SDL-1.2.14\include\SDL_config.h|74|warning: "HAVE_STDINT_H" redefined|
C:\angband-3.2.0\src\h-basic.h|38|warning: this is the location of the previous definition|
C:\angband-3.2.0\src\z-file.c||In function 'file_read':|
C:\angband-3.2.0\src\z-file.c|484|warning: implicit declaration of function 'fileno'|
||=== Build finished: 0 errors, 6 warnings ===|
The linker, however, does not fall over and I get a working Angband executable. (the 'implicit declarations' are called correctly)

Out of curiosity I then compiled 3.1.2 to see what happened...
It compiled perfectly with no warnings or errors. (it still uses usleep & fileno)

Another thing I tried was to add all the -Wxxx switches (from makefile.std)to the build and got over 300 warnings! Mainly 'unused parameter' & 'no previous declaration' errors.

I also couldn't compile unless I set '-std=c99' (which is not in makefile.std)

A few questions:

Has anyone else tried compiling a windows/SDL build of 3.2?

Any idea what those warnings are about? - Am I doing something daft?

Does anyone else compile with the -Wxxx settings on?
(There are a lot of unused parameters)

Oh yeah, and have a very merry christmas people!

Iain
Omnipact is offline   Reply With Quote
Old December 24, 2010, 21:43   #2
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,054
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate Send a message via Skype™ to Magnate
We did have to go to -std=c99, so not sure why that wasn't in the Makefile. Sorry. Do you still get all those warnings after that is set? The main problem is that none of the developers are using Windows so we cross-compile. Native windows compilation doesn't get a lot of testing.
Magnate is offline   Reply With Quote
Old December 24, 2010, 21:51   #3
Omnipact
Rookie
 
Join Date: Jun 2007
Location: Bristol, UK
Posts: 23
Omnipact is on a distinguished road
I still get the weird warnings even with c99 switched on.

I only used the makefile to see what flags to use to compile.
It was shocking to see 300-odd warnings with -Wall etc on though...
Omnipact is offline   Reply With Quote
Old December 25, 2010, 03:50   #4
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,828
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by Omnipact View Post
I still get the weird warnings even with c99 switched on.

I only used the makefile to see what flags to use to compile.
It was shocking to see 300-odd warnings with -Wall etc on though...
Pretty much 100% of them are fluff...

The redefinition problems come because we autodetect compilers that allow us to use C99 int types and apparently does SDL. Wrapping the defines in ifndefs probably makes sense, even if it is a bit icky.
__________________
"Physician, heal thyself."
takkaria is offline   Reply With Quote
Old December 25, 2010, 05:59   #5
APWhite
Adept
 
APWhite's Avatar
 
Join Date: Jul 2007
Location: St George Utah, USA
Posts: 244
APWhite is on a distinguished road
I use Visual Studio 2008 and I seem to have trouble with the subdirectories and the header files. z-info.c calls for #include "unit-test.h" but it is found in "tests/unit-test.h" and VS2008 can't seem to find it (even though it is in the project). I tried rewriting it to #include "Angband320/src/tests/unit-test.h" But it still fails. Anyone know how to get VS2008 to automatically scan the subdirectories or do I need to flatten all them out and move them in to the src directory?

Andrew
APWhite is offline   Reply With Quote
Old December 25, 2010, 09:15   #6
Omnipact
Rookie
 
Join Date: Jun 2007
Location: Bristol, UK
Posts: 23
Omnipact is on a distinguished road
Quote:
Originally Posted by APWhite View Post
I use Visual Studio 2008 and I seem to have trouble with the subdirectories and the header files. z-info.c calls for #include "unit-test.h" but it is found in "tests/unit-test.h" and VS2008 can't seem to find it (even though it is in the project). I tried rewriting it to #include "Angband320/src/tests/unit-test.h" But it still fails. Anyone know how to get VS2008 to automatically scan the subdirectories or do I need to flatten all them out and move them in to the src directory?
I usually go through the brute force and ignorance route:
Find your compiler search directories and just add directories. (maybe linker too - depends where the .o files are put).


Or maybe rewrite the whole path (with drive name) in the #include :
#include "C:/Angband320/src/tests/unit-test.h"

Iain
Omnipact is offline   Reply With Quote
Old December 27, 2010, 10:39   #7
Dean Anderson
Adept
 
Join Date: Nov 2009
Posts: 111
Dean Anderson is on a distinguished road
Quote:
Originally Posted by APWhite View Post
I use Visual Studio 2008 and I seem to have trouble with the subdirectories and the header files. z-info.c calls for #include "unit-test.h" but it is found in "tests/unit-test.h" and VS2008 can't seem to find it (even though it is in the project). I tried rewriting it to #include "Angband320/src/tests/unit-test.h" But it still fails. Anyone know how to get VS2008 to automatically scan the subdirectories or do I need to flatten all them out and move them in to the src directory?

Andrew
I'm using VS2010, not VS2008; but what I did should work for you.

Firstly, you need to set the main source folder (not any of the sub-folders) as part of your include path. It should then automatically scan subdirectories when processing #include statements.

Secondly, you need to set the properties of the player\types.c file so that it compiles to "p-util.obj" so that the linker doesn't get confused by having two files with the same name.

I think that's all you need to do - but I haven't tried compiling a version that uses main-win.c or using SDL, since I compile it as a Windows Console app using my own main-wcn.c.

Last edited by Dean Anderson; December 27, 2010 at 11:15.
Dean Anderson 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
Compiling with Borland C++ 5.5 (yes, I know) PaulBlay Development 2 February 23, 2009 16:55
compiling in VC6 NeoWizard Vanilla 1 January 16, 2009 03:10
Compiling in Linux trickypig Vanilla 6 November 16, 2008 16:26
Compiling Issues Gregian Vanilla 13 July 2, 2008 15:35
Compiling 3.0.9b under SuSE 9.3 ... TJA Vanilla 14 May 12, 2008 22:17


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


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