Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old April 8, 2014, 19:51   #101
EpicMan
Swordsman
 
Join Date: Dec 2009
Location: Dallas, Texas, USA
Posts: 356
EpicMan is on a distinguished road
I am trying to build Angband 3.5-release (https://github.com/angband/angband/tree/3.5-release) with Visual Studio 2013 using Blue Baron's guide and Mark's comments.

When I compile I am getting a syntax error on these foo_make_module declarations, i.e.
struct init_module generate_module = {
.name = "generate",
.init = run_room_parser,
.cleanup = NULL
};

The error is C2509: syntax error '.'

Any ideas?

EDIT: Turns out MS's compiler doesn't support this syntax, at least in my version of VS2013. I was able to get around it by using this syntax:
struct init_module generate_module = { "generate", run_room_parser, NULL };

Last edited by EpicMan; April 8, 2014 at 20:39. Reason: Fixed
EpicMan is offline   Reply With Quote
Old April 8, 2014, 22:33   #102
EpicMan
Swordsman
 
Join Date: Dec 2009
Location: Dallas, Texas, USA
Posts: 356
EpicMan is on a distinguished road
Linker also couldn't handle lines 2853-2855 in init.c, where the declarations said they were external:
extern struct init_module mon_make_module;

Copying the lines into externs.h and removing the extern modifier from the lines fixed the issue.

I also have gotten a bunch of linker errors for readpng.obj and scrnshot.obj. I'll post my fixes for those when I find them.
EpicMan is offline   Reply With Quote
Old April 8, 2014, 23:07   #103
EpicMan
Swordsman
 
Join Date: Dec 2009
Location: Dallas, Texas, USA
Posts: 356
EpicMan is on a distinguished road
Strange. I had not added png.h and pngconf.h, but even after adding them to the project I am still getting 28 unresolved external symbols:

Error 312 error LNK2019: unresolved external symbol _png_set_sig_bytes referenced in function _ReadDIB2_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\readpng.obj Camband
Error 313 error LNK2019: unresolved external symbol _png_sig_cmp referenced in function _ReadDIB2_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\readpng.obj Camband
Error 314 error LNK2019: unresolved external symbol _png_create_read_struct referenced in function _ReadDIB2_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\readpng.obj Camband
Error 315 error LNK2019: unresolved external symbol _png_create_info_struct referenced in function _ReadDIB2_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\readpng.obj Camband
Error 317 error LNK2019: unresolved external symbol _png_read_info referenced in function _ReadDIB2_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\readpng.obj Camband
Error 318 error LNK2019: unresolved external symbol _png_set_palette_to_rgb referenced in function _ReadDIB2_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\readpng.obj Camband
Error 319 error LNK2019: unresolved external symbol _png_set_tRNS_to_alpha referenced in function _ReadDIB2_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\readpng.obj Camband
Error 320 error LNK2019: unresolved external symbol _png_set_bgr referenced in function _ReadDIB2_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\readpng.obj Camband
Error 321 error LNK2019: unresolved external symbol _png_set_gray_to_rgb referenced in function _ReadDIB2_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\readpng.obj Camband
Error 322 error LNK2019: unresolved external symbol _png_set_interlace_handling referenced in function _ReadDIB2_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\readpng.obj Camband
Error 323 error LNK2019: unresolved external symbol _png_set_strip_16 referenced in function _ReadDIB2_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\readpng.obj Camband
Error 324 error LNK2019: unresolved external symbol _png_read_update_info referenced in function _ReadDIB2_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\readpng.obj Camband
Error 325 error LNK2019: unresolved external symbol _png_read_image referenced in function _ReadDIB2_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\readpng.obj Camband
Error 326 error LNK2019: unresolved external symbol _png_destroy_read_struct referenced in function _ReadDIB2_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\readpng.obj Camband
Error 327 error LNK2019: unresolved external symbol _png_init_io referenced in function _ReadDIB2_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\readpng.obj Camband
Error 329 error LNK2019: unresolved external symbol _png_get_valid referenced in function _ReadDIB2_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\readpng.obj Camband
Error 330 error LNK2019: unresolved external symbol _png_get_rowbytes referenced in function _ReadDIB2_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\readpng.obj Camband
Error 331 error LNK2019: unresolved external symbol _png_get_image_width referenced in function _ReadDIB2_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\readpng.obj Camband
Error 332 error LNK2019: unresolved external symbol _png_get_image_height referenced in function _ReadDIB2_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\readpng.obj Camband
Error 333 error LNK2019: unresolved external symbol _png_get_bit_depth referenced in function _ReadDIB2_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\readpng.obj Camband
Error 334 error LNK2019: unresolved external symbol _png_get_color_type referenced in function _ReadDIB2_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\readpng.obj Camband
Error 316 error LNK2001: unresolved external symbol _png_create_info_struct c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\scrnshot.obj Camband
Error 328 error LNK2001: unresolved external symbol _png_init_io c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\scrnshot.obj Camband
Error 335 error LNK2019: unresolved external symbol _png_create_write_struct referenced in function _SaveWindow_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\scrnshot.obj Camband
Error 336 error LNK2019: unresolved external symbol _png_write_info referenced in function _SaveWindow_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\scrnshot.obj Camband
Error 337 error LNK2019: unresolved external symbol _png_set_packing referenced in function _SaveWindow_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\scrnshot.obj Camband
Error 338 error LNK2019: unresolved external symbol _png_write_image referenced in function _SaveWindow_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\scrnshot.obj Camband
Error 339 error LNK2019: unresolved external symbol _png_write_end referenced in function _SaveWindow_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\scrnshot.obj Camband
Error 340 error LNK2019: unresolved external symbol _png_destroy_write_struct referenced in function _SaveWindow_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\scrnshot.obj Camband
Error 341 error LNK2019: unresolved external symbol _png_set_IHDR referenced in function _SaveWindow_PNG c:\Users\a0866523\documents\visual studio 2012\Projects\Camband\Camband\scrnshot.obj Camband
EpicMan is offline   Reply With Quote
Old April 8, 2014, 23:34   #104
EpicMan
Swordsman
 
Join Date: Dec 2009
Location: Dallas, Texas, USA
Posts: 356
EpicMan is on a distinguished road
OK, after copying the dlls to the executable directory I could get a window running, but with the same issues as Mark is having - Title is (3 Asian characters)d, ASCII art looks wonky, and no menu, though the .rc file is included in the project and looks OK when I open it in Visual Studio.

I notice that win-layout.c has a reference to Angband.h that is commented out, and un-commenting it causes a bunch of compile-time errors. Maybe the reference is needed for the menu to work; I'll see if I can fix the errors and keep the reference on.

Nope, externs.h blows up if I do that, so go back.

Changing AddFontResourceEx to AddFontResourceExA on line 1420 of main-win.c causes the title screen to look good. Menu still missing and window titles are still not displaying correctly, even though debugging shows the data being passed around looks normal.

Last edited by EpicMan; April 9, 2014 at 00:32.
EpicMan is offline   Reply With Quote
Old April 10, 2014, 15:22   #105
EpicMan
Swordsman
 
Join Date: Dec 2009
Location: Dallas, Texas, USA
Posts: 356
EpicMan is on a distinguished road
The strange characters in the window titles is because the widechar version of CreateWindowEx() is being called in main-win.c:init_windows(), but the titles are string literals (i.e. 1-byte chars). In this case I cannot simply call CreateWindowExA() (it causes a crash).

I fixed this by changing angband_term_name[]'s type to wchar_t. This required prepending an 'L' in front of the string literals, i.e. "term-1" becomes L"term-1".

I can start the game using control-N but the main view's font size is massive and unplayable. If I could get the menu working I could change it.
EpicMan is offline   Reply With Quote
Old April 10, 2014, 18:03   #106
EpicMan
Swordsman
 
Join Date: Dec 2009
Location: Dallas, Texas, USA
Posts: 356
EpicMan is on a distinguished road
Missing menu solved!

I now have a menu on the main window!

The issue was the same as the window titles - it was passing the 1-byte char array "ANGBAND" but was interpreting it as wide chars. Passing L"ANGBAND" fixes the issue.

Font being used to show the map is still odd, probably also related, since the path seems to be lost when you try to choose a font.
EpicMan is offline   Reply With Quote
Old December 10, 2014, 03:20   #107
shadow
Rookie
 
Join Date: Oct 2014
Posts: 13
shadow is on a distinguished road
OK, I'm on OSX. Looks like I built successfully with:

make -f Makefile.osx

But trying to run the executable errors out with this message:

2014-12-09 21:12:38.286 angband[5826:507] No Info.plist file in application bundle or no NSPrincipalClass in the Info.plist file, exiting
shadow is offline   Reply With Quote
Old December 10, 2014, 03:25   #108
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 8,864
Derakon is on a distinguished road
To be clear, when you say "run the executable", are you double-clicking Angband.app? Or doing "open Angband.app" from the command line? There's an executable file buried within the program package, but I'm not sure it'd work properly if you tried to do "./angband" on the command line.
Derakon is offline   Reply With Quote
Old December 10, 2014, 04:38   #109
shadow
Rookie
 
Join Date: Oct 2014
Posts: 13
shadow is on a distinguished road
Quote:
Originally Posted by Derakon View Post
To be clear, when you say "run the executable", are you double-clicking Angband.app? Or doing "open Angband.app" from the command line? There's an executable file buried within the program package, but I'm not sure it'd work properly if you tried to do "./angband" on the command line.
...

OK, yeah, that would be the problem. Alright, I've got it working, thanks.

I suppose I'm more or less on my own if I want to get this thing into an xcode project...
shadow is offline   Reply With Quote
Old December 12, 2014, 18:19   #110
EpicMan
Swordsman
 
Join Date: Dec 2009
Location: Dallas, Texas, USA
Posts: 356
EpicMan is on a distinguished road
Quote:
Originally Posted by EpicMan View Post
I now have a menu on the main window!

The issue was the same as the window titles - it was passing the 1-byte char array "ANGBAND" but was interpreting it as wide chars. Passing L"ANGBAND" fixes the issue.

Font being used to show the map is still odd, probably also related, since the path seems to be lost when you try to choose a font.
By the way, the root cause of these character issues was that the Visual Studio project had a default characterset setting under project properties that had defaulted to wchar (or UTF-somewthing, I don't remember now). Changing the character set default to "unspecified" fixed all of the character display issues I had.
EpicMan 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 Angband on MS-DOS Zababa Development 8 May 27, 2011 17:36
Compiling Angband 3.0.9 w/ xcode on OSX Iemortal Vanilla 8 April 16, 2011 16:41
Compiling Z+Angband under Windows Altefcat Variants 8 December 11, 2008 09:44
compiling vanilla angband on msvc++ 9 express hugh Vanilla 6 March 17, 2008 15:49
Trouble compiling angband 3.0.9 on linux RastaRuedi Vanilla 2 August 1, 2007 17:28


All times are GMT +1. The time now is 16:58.


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