I am trying to build Angband with Visual Studio in hopes of creating my own variant, but I am not a coder only a mod merger maker. I followed the instructions in the visual studio step by step file as best I could, but I am getting 34 errors. They are all unresolved external symbol errors involving pngs. I don't know what to do about them.
34 unresolved external symbol_png errors
Collapse
X
-
Tags: None
-
-
I would recheck steps 4 and 6 from Visual Studio step by step instructions since those affect if it will find the PNG library. Also make sure you are building for 32-bit x86. The versions of libpng.dll and zlib1.dll packaged with Angband are for 32-bit x86 and so, unless you want to find replacements for them, you need to target a 32-bit x86 environment in Visual Studio.Comment
-
Thanks, I think it is step 6. I downloaded Visual Studio 2022 and I can't find a match for Object/library modules under the Link tab. The closest I see are Additional Library Directories under General in the Linker tab, Add Module to Assembly under Input in the Linker tab, and Import Library under Advanced in the Linker tab. Problem is I've tried all 3 and it still gives the errors.
EDIT: I did replace what might have originally been in those settings though rather than adding to the front of the line. Is that my problem?
I am building for Win32 x86 (It actually was x64. Changed it and still getting the errors though) and I checked the directory for the files, and they are both there.Comment
-
Microsoft's instructions for linking with a DLL in Visual Studio 2022 appear to be here, https://learn.microsoft.com/en-us/cp...?view=msvc-170 . libpng12.dll and zlib1.dll are DLLs that are not built by the project so, based on those instructions, you would:
1. Copy the DLLs to the output folder of the project.
2. Right-click on the project node in Solution Explorer and then choose Properties.
3. In the VC++ Directories property page, add the path to the LIB file, src/win/lib within the Angband directories to Library Directories. Then, add the path to the library header files, src/win/include within the Angband directories, to Include Directories. If just specifying the terminal part of the path, src/win/lib or src/win/include, does not work, I'd try giving the full path, i.e. <full path to top-level Angband directory>/src/win/lib or <full path to top-level Angband directory>/src/win/include.
4. In the Linker->Input property page, add the names of the LIB files to Additional Dependencies. Given that the library path was specified in (3) you would add zlib1.lib libpng.lib msimg32.lib winmm.lib to the additional dependencies.Comment
-
Ok, followed instructions, had to add full paths. Got through several errors. Finally got stuck on this error: cannot open file 'winmm.libkernel32.lib'.
EDIT: Actually, adding a semi-colon to the end of winmm.lib seems to have resolved that. Now I have 2:
unresolved external symbol _main referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ)
1 unresolved externalsLast edited by Elfin Jedi; October 12, 2025, 05:11.Comment
-
That is likely because your project is targeting the "Console" subsystem rather than "Windows". See the last part of https://learn.microsoft.com/en-us/cp...?view=msvc-170 for how to change that for your project.Comment
-
Ok. I managed to build it. Yay! Thanks! But now when I try to launch the executable it gives me this error in what I believe to be Chinese.
Edit: it seems to be from malware.Last edited by Elfin Jedi; October 12, 2025, 16:59.Comment
-
Check the "Character Set" option for the project. You want it to be "Use Multi-Byte Character Set". This link mentions where it's located in Visual Studio 2019, https://stackoverflow.com/questions/...-character-set . I did not find something that says where it is in Visual Studio 2022.Comment
-
-
The Windows front-end expects a copy of the lib folder in the same directory as the executable (see init_stuff() in main-win.c for the relevant code). For Angband releases where the Windows version is cross-compiled, scripts/pkg_win is used to create a zip file where that is the case. For your own development, you could make a copy (or link if that's possible on Windows) the lib folder and all of its contents from the Angband source tree to where Visual Studio put the compiled executable (looks like C:\Users\Owner\source\repos\VarAngband from the error message. you quoted).Comment
-
-
Where are the colors defined for the race flag ATTR_FLICKER? It is crashing with the color: B (Light Blue).Comment
-
The colors used for color cycling are set in lib/gamedata/visuals.txt. There are some hard-wired limits for the number of cycle groups, cycles per group, and colors per cycle in ui-visuals.c. In a very quick look at that code, I suspect that exceeding those limits could cause a crash rather than simply generating an error message while parsing visuals.txt. The default color table is defined in z-color.c.Comment
-
ok. I am trying to convert the Sangband/Unangband monsters to Vanilla levels. I added Blue Faerie which had the flag ATTR_METAL which doesn't seem to exist in Vanilla, so I used ATTR_FLICKER. Would just adding monsters that flicker add to the number of cycle groups, cycles per group, or colors per cycle?
At first, I thought the crashes were related to having NEVER_BLOW and still being able to move. But I started noticing it was crashing even when the blue faeries were asleep and always after the first move after spotting them. That is what led me to the ATTR_FLICKER thing and commenting it out fixed the crash. But I am still confused about the why/how of it crashing.
Edit: I did read the files. Cycle groups seemed to be the only one that could be affected, but I assume that meant the number of different colors that had a flicker pattern assigned. There were quite a few of those though, more than 8.Last edited by Elfin Jedi; October 13, 2025, 01:06.Comment
Comment