PDA

View Full Version : Issues compiling with MSVC++ 2008


Kyle
October 23, 2010, 01:20
I made a project file, added WINDOWS as a define, messed around with some file structuring so all the includes were found properly, but I'm getting link errors...


1>------ Build started: Project: ang311, Configuration: Debug Win32 ------
1>Linking...
1>birth.obj : error LNK2019: unresolved external symbol _modify_stat_value referenced in function _get_stats
1>calcs.obj : error LNK2001: unresolved external symbol _modify_stat_value
1>cmd-obj.obj : error LNK2001: unresolved external symbol _player_can_read
1>cmd-obj.obj : error LNK2001: unresolved external symbol _player_can_cast
1>cmd5.obj : error LNK2001: unresolved external symbol _player_can_cast
1>cmd-obj.obj : error LNK2001: unresolved external symbol _player_can_study
1>cmd5.obj : error LNK2001: unresolved external symbol _player_can_study
1>main-win.obj : error LNK2019: unresolved external symbol __imp__PlaySoundA@12 referenced in function _Term_xtra_win_sound
1>C:\Users\Kyle\Documents\Visual Studio 2008\Projects\ang311\Debug\ang311.exe : fatal error LNK1120: 5 unresolved externals
1>Build log was saved at "file://c:\Users\Kyle\Documents\Visual Studio 2008\Projects\ang311\ang311\Debug\BuildLog.htm"
1>ang311 - 9 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Any suggestions?

I also added winmm.lib as an additional dependency, since I noticed it was in Makefile.nmake.... still no improvements.

Pete Mack
October 23, 2010, 04:24
I don't know about the SOUND stuffl; you can simply disable it in config.h
As far as the player_ things, that's because Visual Studio is terrible with duplicate file names. In this case, it's screwing up the inclusion of util.c in the player directory.
I've asked more than once to get the duplicate filenames removed (e.g. util-player.c, etc) with no luck.

ekolis
October 23, 2010, 04:40
You should be able to go to the properties of player/util.c and set it to compile to a different object file name, such as player-util.obj rather than the default of util.obj...

Kyle
October 23, 2010, 18:38
OK. So util.obj is being craeted twice and then the first one is probably being overwritten?

Update: I renamed player/util.c to player/player-util.c

and that fixed all the problems except the

main-win.obj : error LNK2019: unresolved external symbol __imp__PlaySoundA@12 referenced in function _Term_xtra_win_sound


If anyone has any knowledge on this I'd be super grateful. (I'm grateful already. :) )

Edit:
OK. So apparently I didn't save my changes when I included the dependency for winmm.lib

I put it in again and it compiled fine. Thanks the help!