[Error] Compiling the svn under windows

Technical and coding related questions.

Moderator: Board moderators

Post Reply
bloodyshade
Newbie
Posts: 2
Joined: Tue Mar 02, 2010 1:09 am

[Error] Compiling the svn under windows

Post by bloodyshade »

Hi guys, new here :)

So I'm trying to build crossfire32.exe under windows, but I'm getting some problems.
First I had some trouble with several files, because they were more or less non-windows friendly, at least for MSVC.

So I changed what was needed and got it almost to the end.
What I changed were just minimal stuff, like defining strcasecmp to strcmpi and renaming the include <strings.h> to string.h.
Created the svnversion.h file by hand and etc.

But now I'm getting linking problems, and I'm not very good sorting these out hehe.
I'm using the FullDebug build with the debugging removed, since some of the sbr files were not being generated.
(Right now I guess it would be okay to enable it since all the files are actually compiling)

I'm under Windows XP 32bits using MS Visual Studio 2008. And a rev from earlier today.

I'm pasting the linking problems below:

Code: Select all

Linking...
c_party.obj : error LNK2019: unresolved external symbol _party_confirm_password referenced in function _confirm_party_password
login.obj : error LNK2001: unresolved external symbol _party_confirm_password
c_party.obj : error LNK2019: unresolved external symbol _party_find referenced in function _confirm_party_password
login.obj : error LNK2001: unresolved external symbol _party_find
c_party.obj : error LNK2019: unresolved external symbol _party_join referenced in function _receive_party_password
login.obj : error LNK2001: unresolved external symbol _party_join
plugins.obj : error LNK2001: unresolved external symbol _party_join
c_party.obj : error LNK2019: unresolved external symbol _party_get_leader referenced in function _command_party
c_party.obj : error LNK2019: unresolved external symbol _party_get_next referenced in function _command_party
plugins.obj : error LNK2001: unresolved external symbol _party_get_next
c_party.obj : error LNK2019: unresolved external symbol _party_get_first referenced in function _command_party
plugins.obj : error LNK2001: unresolved external symbol _party_get_first
c_party.obj : error LNK2019: unresolved external symbol _party_get_password referenced in function _command_party
login.obj : error LNK2001: unresolved external symbol _party_get_password
player.obj : error LNK2001: unresolved external symbol _party_get_password
plugins.obj : error LNK2001: unresolved external symbol _party_get_password
c_party.obj : error LNK2019: unresolved external symbol _party_set_password referenced in function _command_party
login.obj : error LNK2001: unresolved external symbol _party_set_password
c_party.obj : error LNK2019: unresolved external symbol _party_leave referenced in function _command_party
player.obj : error LNK2001: unresolved external symbol _party_leave
server.obj : error LNK2001: unresolved external symbol _party_leave
savebed.obj : error LNK2001: unresolved external symbol _party_leave
c_party.obj : error LNK2019: unresolved external symbol _party_form referenced in function _command_party
login.obj : error LNK2001: unresolved external symbol _party_form
c_party.obj : error LNK2019: unresolved external symbol _party_send_message referenced in function _command_party
commands.obj : error LNK2001: unresolved external symbol _command_knowledge
commands.obj : error LNK2001: unresolved external symbol _command_quest
init.obj : error LNK2019: unresolved external symbol _free_quest referenced in function _free_server
plugins.obj : error LNK2019: unresolved external symbol _quest_was_completed referenced in function _cfapi_player_quest
plugins.obj : error LNK2019: unresolved external symbol _quest_set_player_state referenced in function _cfapi_player_quest
plugins.obj : error LNK2019: unresolved external symbol _quest_get_player_state referenced in function _cfapi_player_quest
plugins.obj : error LNK2019: unresolved external symbol _quest_end referenced in function _cfapi_player_quest
plugins.obj : error LNK2019: unresolved external symbol _quest_start referenced in function _cfapi_player_quest
server.obj : error LNK2019: unresolved external symbol _party_obsolete_parties referenced in function _do_specials
book.obj : error LNK2019: unresolved external symbol _knowledge_read referenced in function _book_type_apply
.\FullDebug/crossfire32.exe : fatal error LNK1120: 21 unresolved externals
Build log was saved at "file://c:\crossfire\server\make_win32\FullDebug\BuildLog.htm"
crossfire32 - 36 error(s), 1644 warning(s)
Hope somebody can help me sort this problem out. The libs and the python_plugin are compiling fine, with some warnings.

Thank you all.
Ryo
Forum Fanatic
Posts: 752
Joined: Mon May 19, 2003 9:16 pm
Location: Paris, France

Post by Ryo »

Hello.

Fun, I checked the Windows state of the code a few days ago :)


If you are using Microsoft's Visual Studio, for the linking issues, three files are missing from the project: "server/party.c", "server/quest.c" and "server/knowledge.c". Adding those should link properly.


With the ancient version of MSVC I use, I had a few issues you apparently don't have, so I'm interested in the version you are using to build :)
bloodyshade
Newbie
Posts: 2
Joined: Tue Mar 02, 2010 1:09 am

Post by bloodyshade »

Ryo wrote:Hello.

Fun, I checked the Windows state of the code a few days ago :)


If you are using Microsoft's Visual Studio, for the linking issues, three files are missing from the project: "server/party.c", "server/quest.c" and "server/knowledge.c". Adding those should link properly.


With the ancient version of MSVC I use, I had a few issues you apparently don't have, so I'm interested in the version you are using to build :)
Hmm, didn't think of that, perhaps the files weren't included in the project during the conversion.

About the version, it is VC2008 as I said :)

I'll try adding those files by hand in the project and recompiling, in case they aren't already there.

Thanks for the info, will post my results back later today.

Bye.

----
EDIT: Adding the files to the project enabled me able to finish compiling it just fine :) thanks a bunch
I believe the other problems I had are related to the constant including of Microsoft stuff breaking the ANSI standard library with each upgrade of MSVC hehe.

EDIT2: After building the archetypes and copying the files to share, the server still crashed upon start, with full debug on, it points out it's an assertion error:

Code: Select all

File: f:\dd\vctools\crt_bld\self_x86\crt\src\setvbuf.c
Line: 64
Expression: ((2 <= size) && (size <= INT_MAX))
From what I see, there are two setvbuf calls in the sources, in server/common/init.c and server/common/logger.c
From the error, it seems the problem is caused because the function is passing a buffer size 0 to the function, and it seems to expect a buffer size of at least 2.

So I fixed the calls to have a default size of 2 instead of 0 and it compiled and executed.

I realized that I also had to copy wizhelp and i18n folders from lib to share.
Now I'm getting errors like this, with an assertion crash in the end:

Code: Select all

[Error]   Couldn't find archetype mace_2
[Error]
 for formula the Devourersype mace_2
Full crossfire.log is posted here: http://codepad.org/0Ag6i8dy

Is there anything else I need to copy somewhere?
(I also realized that I'm missing crossfire.0 and crossfire.1 in my share folder, they were not generated with the collect perl script.)

Thanks.

EDIT3: Okay, Ragnor helped me out and I could get past the file-reading problems.
I found out that I need to run server/lib/adm/collect_images.pl to generate crossfire.0 and crossfire.1, now my new problem is:

Code: Select all

10/03/04 20:55:31 [Error]   read_client_images: Did not read desired amount of data, wanted 335, got 0
IMAGE 00000 335 arch/system/bug.111
Any ideas?

EDIT4: Okay, could get rid of all my errors here, seems all I had to do was convert the files in server/share to unix format so the code would read them properly. The server is working fine now.

We can close this topic. Thanks.
Post Reply