Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old October 24, 2020, 00:00   #11
backwardsEric
Apprentice
 
Join Date: Aug 2019
Posts: 96
backwardsEric is on a distinguished road
Quote:
Originally Posted by slimehunter View Post
That worked! Thank you!!
I'm also getting a few other errors similar to the previous one, but I'll see if I can work around these. Here are the other errors for reference:

Code:
Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol _FreeDIB referenced in function _Term_xtra_win_react	angband_win_test2	\main-win.obj	1	
Error	LNK2019	unresolved external symbol _ReadDIB2_PNG referenced in function _init_graphics	angband_win_test2	\main-win.obj	1	
Error	LNK2019	unresolved external symbol _default_layout_win referenced in function _load_prefs	angband_win_test2	\main-win.obj	1	
Error	LNK2019	unresolved external symbol _SaveWindow_PNG referenced in function _process_menus	angband_win_test2	\main-win.obj	1	
Error	LNK2019	unresolved external symbol _main referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ)	angband_win_test2	\MSVCRTD.lib(exe_main.obj)	1
For all but the last one, did you add the .c and .h files from src\win to the project? FreeDIB(), ReadDIB2_PNG, default_layout_win(), and SaveWindow_PNG() are defined in those files (src\win\readdib.c , src\win\readpng.c , src\win\win-layout.c , and src\win\scrnshot.c ).

The last one is likely due to the choice of the project type. This question and the posted answers at StackOverflow, https://stackoverflow.com/questions/...nction-int-cde , may help with that.
backwardsEric is offline   Reply With Quote
Old October 24, 2020, 06:33   #12
slimehunter
Rookie
 
Join Date: Oct 2020
Posts: 4
slimehunter is on a distinguished road
Quote:
Originally Posted by backwardsEric View Post
For all but the last one, did you add the .c and .h files from src\win to the project? FreeDIB(), ReadDIB2_PNG, default_layout_win(), and SaveWindow_PNG() are defined in those files (src\win\readdib.c , src\win\readpng.c , src\win\win-layout.c , and src\win\scrnshot.c ).

The last one is likely due to the choice of the project type. This question and the posted answers at StackOverflow, https://stackoverflow.com/questions/...nction-int-cde , may help with that.
Wow, facepalm. That works, it's built now. Thank you! I feel embarrassed now, but I'm realized I think I skipped it when following the step-by-step guide because when I realized steps 9-11 were unnecessary to build/pointing to the wrong directories, my brain just glossed over step 12 too.

Anyway, thank you again. I'm on my way to poking around with the code now.


Edit: Funny story, it turns out that running the executable that was built results in this weird error message
Code:
---------------------------
牅潲r
---------------------------
慃湮瑯映湩⁤敲畱物摥搠物捥潴祲਺汉扩\
---------------------------
OK   
---------------------------
From which google translate gives me:
Code:
---------------------------
牅潲r
---------------------------
慃湮瑯映湩Knock on the leftovers 摥搠物捥潴祲han expansion\
---------------------------
OK
---------------------------

Last edited by slimehunter; October 24, 2020 at 20:06.
slimehunter is offline   Reply With Quote
Old October 25, 2020, 08:10   #13
backwardsEric
Apprentice
 
Join Date: Aug 2019
Posts: 96
backwardsEric is on a distinguished road
Quote:
Originally Posted by slimehunter View Post
Edit: Funny story, it turns out that running the executable that was built results in this weird error message
Code:
---------------------------
牅潲r
---------------------------
慃湮瑯映湩敲畱物摥搠物捥潴祲਺汉扩\
---------------------------
OK   
---------------------------
From what I see in Microsoft's documentation, the Win32 API switches from expecting ANSI encoded strings to 16-bit encoded character strings if the UNICODE preprocessor macro is set. It looks like the project settings in src\win\vs2019 don't set that macro. Is it possible that when you set up your project that it set UNICODE by default? That could explain the garbled message and getting rid of UNICODE and then recompiling would get you an executable that produced interpretable messages.

Besides the SOUND preprocessor macro you ran into earlier, another macro that appears in the src\win\vs2019 project settings but isn't mentioned in angband_visual_studio_step_by_step.txt is USE_PRIVATE_PATHS - that affects where things like the save file and high score file are placed. For the record, here are the preprocessor macros set in src\win\vs2019\Angband.vcxproj :

Code:
SOUND;USE_PRIVATE_PATHS;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;
backwardsEric is offline   Reply With Quote
Old October 28, 2020, 06:45   #14
slimehunter
Rookie
 
Join Date: Oct 2020
Posts: 4
slimehunter is on a distinguished road
Quote:
Originally Posted by backwardsEric View Post
From what I see in Microsoft's documentation, the Win32 API switches from expecting ANSI encoded strings to 16-bit encoded character strings if the UNICODE preprocessor macro is set. It looks like the project settings in src\win\vs2019 don't set that macro. Is it possible that when you set up your project that it set UNICODE by default? That could explain the garbled message and getting rid of UNICODE and then recompiling would get you an executable that produced interpretable messages.

Besides the SOUND preprocessor macro you ran into earlier, another macro that appears in the src\win\vs2019 project settings but isn't mentioned in angband_visual_studio_step_by_step.txt is USE_PRIVATE_PATHS - that affects where things like the save file and high score file are placed. For the record, here are the preprocessor macros set in src\win\vs2019\Angband.vcxproj :

Code:
SOUND;USE_PRIVATE_PATHS;WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;
...Oh heck, I didn't even realize that ANSI was required. That was it!
I just set the character set project option to multi byte from unicode and that seemed to fix the exe.

Thank you!
slimehunter 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 16:08.


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