Problems compiling 1.7.7 pl 15 NT PennMUSH server

Posted by Kronus on Mon 30 Jun 2003 02:43 PM — 13 posts, 38,054 views.

#0
I am having compiling the newest version of PennMUSH. I followed the instructions in win32 folder, but I get the following errors.

attrib.obj : error LNK2001: unresolved external symbol _chunk_create
attrib.obj : error LNK2001: unresolved external symbol _chunk_delete
attrib.obj : error LNK2001: unresolved external symbol _chunk_derefs
db.obj : error LNK2001: unresolved external symbol _chunk_derefs
attrib.obj : error LNK2001: unresolved external symbol _chunk_fetch
attrib.obj : error LNK2001: unresolved external symbol _chunk_migration
cmds.obj : error LNK2001: unresolved external symbol _chunk_stats
game.obj : error LNK2001: unresolved external symbol _chunk_num_swapped
game.obj : error LNK2001: unresolved external symbol _chunk_init
./game/pennmush.exe : fatal error LNK1120: 8 unresolved externals
Error executing link.exe.

pennmush.exe - 10 error(s), 2 warning(s)

I don't know what this all means. Anyone have any idea on a fix or something I'm doing wrong?
Thanks in advance.
Australia Forum Administrator #1
I haven't tried that version, but try doing a search for "chunk_create", find which file it is in and make sure that is part of the project. Sometimes they add new source files and forget to update the project file. Sounds like all those routines are in the same file.
#2
It looks like "chuck_create" appears in the chunk.h, chunk.c, and attrib.c. And all of those appear to be in the project. I'm not sure what else to look for. Any more ideas? :) Thanks again for taking your time to help me out.
Australia Forum Administrator #3
The implementation can't really be in two .c files - make sure the chunk.c file is actually being compiled and included in the project.

If no luck still, I'll try to compile it myself.
#4
Ok I think I have it now. I think it was one of my own functions interfearing with it. Thanks again.
#5
It seems I was wrong. It didn't fix it. For some odd reason it compiled last time, but I haven't been able to repeat it again. I keep getting the same error as before:

Linking...
attrib.obj : error LNK2001: unresolved external symbol _chunk_create
attrib.obj : error LNK2001: unresolved external symbol _chunk_delete
attrib.obj : error LNK2001: unresolved external symbol _chunk_derefs
db.obj : error LNK2001: unresolved external symbol _chunk_derefs
attrib.obj : error LNK2001: unresolved external symbol _chunk_fetch
attrib.obj : error LNK2001: unresolved external symbol _chunk_migration
cmds.obj : error LNK2001: unresolved external symbol _chunk_stats
game.obj : error LNK2001: unresolved external symbol _chunk_num_swapped
game.obj : error LNK2001: unresolved external symbol _chunk_init
wiz.obj : error LNK2001: unresolved external symbol _kill_info_slave
./game/pennmush.exe : fatal error LNK1120: 9 unresolved externals
Error executing link.exe.

I don't know whats up, could it be my MSV C++?? Any ideas?

Sorry for the redundancy.
USA #6
What are the includes for the source files that are returning the bad objects? It may be that you ran into something like I have a few times now that MS - in the infinite brilliance - chose not to support in the VC++ compiler.
Australia Forum Administrator #7
Are you sure the file that defines those routines (probably chunk.c) is actually in the project? Not just sitting there on disk, but in the project window on the left.
#8
Alright, I added the chuck.c (which is what I did before to fix it, now that I remember.) But I still get the following error.

Linking...
wiz.obj : error LNK2001: unresolved external symbol _kill_info_slave
./game/pennmush.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

pennmush.exe - 2 error(s), 0 warning(s)

I can't find _kill_info_slave in ANY of the included files. Any ideas on that? Thanks again for your time!
Australia Forum Administrator #9
Strip the leading underscore, and use the "find in files" to search all the .c and .h files for "kill_info_slave" - it has to be there somewhere or it wouldn't be wanting to link against it.
#10
This is what came up:

Searching for 'kill_info_slave'...
Cannot open file 'C:\DOCUMENTS AND SETTINGS\JOANTHAN\DESKTOP\PENNMUSH\pennmush.ncb'.
C:\DOCUMENTS AND SETTINGS\JOANTHAN\DESKTOP\PENNMUSH\pennmush.plg(86):wiz.obj : error LNK2001: unresolved external symbol _kill_info_slave
C:\DOCUMENTS AND SETTINGS\JOANTHAN\DESKTOP\PENNMUSH\src\bsd.c(414):void kill_info_slave(void);
C:\DOCUMENTS AND SETTINGS\JOANTHAN\DESKTOP\PENNMUSH\src\bsd.c(743): kill_info_slave();
C:\DOCUMENTS AND SETTINGS\JOANTHAN\DESKTOP\PENNMUSH\src\bsd.c(2070):kill_info_slave(void)
C:\DOCUMENTS AND SETTINGS\JOANTHAN\DESKTOP\PENNMUSH\src\wiz.c(78):void kill_info_slave(void);
C:\DOCUMENTS AND SETTINGS\JOANTHAN\DESKTOP\PENNMUSH\src\wiz.c(2027): kill_info_slave();
6 occurrence(s) have been found.

Both the wiz.c and the bsd.c are apart of the project. So I don't know what else to do. Heh, thank you all so much for your time.
Australia Forum Administrator #11
In bsd.c around line 2070 I would check to see if there is an #ifdef around it.
#12
This was the block before:

void
_kill_info_slave(void)
{
WAIT_TYPE my_stat;
Pid_t pid;
struct timeval pad;

if (info_slave_state != 0) {
if (info_slave_pid > 0) {
do_rawlog(LT_ERR, "kill: killing info_slave_pid %d", info_slave_pid);

block_a_signal(SIGCHLD);

closesocket(info_slave);
kill(info_slave_pid, 15);
/* Have to wait long enough for the info_slave to actually
die. This will hopefully be enough time. */
pad.tv_sec = 0;
pad.tv_usec = 100;
select(0, NULL, NULL, NULL, &pad);

#ifdef HAS_WAITPID
pid = waitpid(info_slave_pid, &my_stat, WNOHANG);
#else
pid = wait3(&my_stat, WNOHANG, 0);
#endif
info_slave_pid = -1;
unblock_a_signal(SIGCHLD);
}
info_slave_state = 0;
}
}

#endif

And this is the block afterwards:

void
#ifdef _kill_info_slave(void)
{
WAIT_TYPE my_stat;
Pid_t pid;
struct timeval pad;

if (info_slave_state != 0) {
if (info_slave_pid > 0) {
do_rawlog(LT_ERR, "kill: killing info_slave_pid %d", info_slave_pid);

block_a_signal(SIGCHLD);

closesocket(info_slave);
kill(info_slave_pid, 15);
/* Have to wait long enough for the info_slave to actually
die. This will hopefully be enough time. */
pad.tv_sec = 0;
pad.tv_usec = 100;
select(0, NULL, NULL, NULL, &pad);

#ifdef HAS_WAITPID
pid = waitpid(info_slave_pid, &my_stat, WNOHANG);
#else
pid = wait3(&my_stat, WNOHANG, 0);
#endif
info_slave_pid = -1;
unblock_a_signal(SIGCHLD);
}
info_slave_state = 0;
}
}

#endif

I now get the following error:
Compiling...
bsd.c
C:\Documents and Settings\Joanthan\Desktop\pennmush\src\bsd.c(4682) : fatal error C1004: unexpected end of file found
Error executing cl.exe.

pennmush.exe - 1 error(s), 0 warning(s)

Did I put it in the right place?