I'm trying to get a devsite running on my computer, which is running XP Home. The mainsite is runnng 1.7.6 p9 on Linux, and has quite a few HC Mods which I need to retain on the devsite. I can't seem to get it to compile right, any help would be much appreciated. Thanks.
From Linux to Win32
Posted by Jamal on Tue 02 Mar 2004 02:03 AM — 14 posts, 47,782 views.
We need a little more detail than that, for instance, which compiler are you using, and please copy and paste the actual error messages (or at least, some of them).
I'm using Visual C++, and the error message vary, I've been trying a bunch of things. One presistant one is a LNK2001 Errors. However, I think my efforts are more me just experiment. I'm really at a loss of how to begin.
Post the error messages you're getting and we can probly tell ya outright how to fix most of em.... most often its a makefile revision or an include change. There are also some few *nix functions that the brilliant minds at MS saw fit not to support in the VC++ compiler. Most notable is the lack of support for file/directory manipulation unless its coded in MS terms. I have a post on the DoT forums regarding this issue and my extreme frustration with it. Another thing to maybe consider is seting up CVS on the main server to make it easier to track file changes.
Yes, we still need to see the actual message. Eg. a LNK error sounds like a link error, but what is missing? We need to know more to help.
cmdlocal.obj : error LNK2001: unresolved external symbol _sql_query
cmdlocal.obj : error LNK2001: unresolved external symbol _sql_init
cmdlocal.obj : error LNK2001: unresolved external symbol _sql_shutdown
wiz.obj : error LNK2001: unresolved external symbol _kill_info_slave
econ.obj : error LNK2001: unresolved external symbol _strsep
econ_prod.obj : error LNK2001: unresolved external symbol _strsep
econ.obj : error LNK2001: unresolved external symbol _alloca
econ_prod.obj : error LNK2001: unresolved external symbol _alloca
The main site has sql implemented, but I'm not goign to run it. I removed the sql source file as well as commented out any code in other source files relating to the sql. That maybe be the problem, but when i add it I get other errors too. I think I maybe starting off on the wrong foot.
cmdlocal.obj : error LNK2001: unresolved external symbol _sql_init
cmdlocal.obj : error LNK2001: unresolved external symbol _sql_shutdown
wiz.obj : error LNK2001: unresolved external symbol _kill_info_slave
econ.obj : error LNK2001: unresolved external symbol _strsep
econ_prod.obj : error LNK2001: unresolved external symbol _strsep
econ.obj : error LNK2001: unresolved external symbol _alloca
econ_prod.obj : error LNK2001: unresolved external symbol _alloca
The main site has sql implemented, but I'm not goign to run it. I removed the sql source file as well as commented out any code in other source files relating to the sql. That maybe be the problem, but when i add it I get other errors too. I think I maybe starting off on the wrong foot.
One way or another, you are gonna have problems with sql if you dont have a local server running. My personal advice is to keep the sql file and leave the code intact and give us whatever error messages you get then. I have a strong suspicion it's going to be far easier to fix with sql intact than without.
Ok, I put back the mysql stuff and attempted a recompile. I got the following errors:
c:\pennmush\src\comm_variables.c(14) : fatal error C1083: Cannot open include file: 'strings.h': No such file or directory
econ.c
c:\pennmush\src\econ.c(9) : fatal error C1083: Cannot open include file: 'strings.h': No such file or directory
econ_prod.c
c:\pennmush\src\econ_prod.c(9) : fatal error C1083: Cannot open include file: 'strings.h': No such file or directory
econ_variables.c
c:\pennmush\src\econ_variables.c(9) : fatal error C1083: Cannot open include file: 'strings.h': No such file or directory
funlocal.c
c:\pennmush\src\funlocal.c(25) : fatal error C1083: Cannot open include file: 'mysql/mysql.h': No such file or directory
player.c
C:\pennmush\src\player.c(42) : error C2059: syntax error : 'type'
mysqlmush.c
c:\pennmush\src\mysqlmush.c(22) : fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
Error executing cl.exe.
'strings.h' and 'mysql/mysql.h' are two files I don't have, nor could I find them (or in the case mysql, the directory) when I looked on the server.
c:\pennmush\src\comm_variables.c(14) : fatal error C1083: Cannot open include file: 'strings.h': No such file or directory
econ.c
c:\pennmush\src\econ.c(9) : fatal error C1083: Cannot open include file: 'strings.h': No such file or directory
econ_prod.c
c:\pennmush\src\econ_prod.c(9) : fatal error C1083: Cannot open include file: 'strings.h': No such file or directory
econ_variables.c
c:\pennmush\src\econ_variables.c(9) : fatal error C1083: Cannot open include file: 'strings.h': No such file or directory
funlocal.c
c:\pennmush\src\funlocal.c(25) : fatal error C1083: Cannot open include file: 'mysql/mysql.h': No such file or directory
player.c
C:\pennmush\src\player.c(42) : error C2059: syntax error : 'type'
mysqlmush.c
c:\pennmush\src\mysqlmush.c(22) : fatal error C1083: Cannot open include file: 'mysql.h': No such file or directory
Error executing cl.exe.
'strings.h' and 'mysql/mysql.h' are two files I don't have, nor could I find them (or in the case mysql, the directory) when I looked on the server.
First, strings.h is pretty small, you could take this and include it. Whether it helps or hinders I'm not sure.
The other possibility is to remove the reference, eg.
As for mysql, can you clarify something? If the main site uses mysql, then how can you test on your home devsite without it? You may get it to compile, but if the server needs mysql, then you will run into problems running. If this is the case you need to download and install mysql. That is a free download, and is available for Windows.
If mysql isn't needed, then why is it in the server code in the first place? Just remove all references.
/* Copyright (C) 1991,92,96,97,99,2000,2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#ifndef _STRINGS_H
#define _STRINGS_H 1
/* We don't need and should not read this file if <string.h> was already
read. The one exception being that if __USE_BSD isn't defined, then
these aren't defined in string.h, so we need to define them here. */
#if !defined _STRING_H || !defined __USE_BSD
# include <features.h>
# define __need_size_t
# include <stddef.h>
__BEGIN_DECLS
/* Compare N bytes of S1 and S2 (same as memcmp). */
extern int bcmp (__const void *__s1, __const void *__s2, size_t __n)
__THROW __attribute_pure__;
/* Copy N bytes of SRC to DEST (like memmove, but args reversed). */
extern void bcopy (__const void *__src, void *__dest, size_t __n) __THROW;
/* Set N bytes of S to 0. */
extern void bzero (void *__s, size_t __n) __THROW;
/* Return the position of the first bit set in I, or 0 if none are set.
The least-significant bit is position 1, the most-significant 32. */
extern int ffs (int __i) __THROW __attribute__ ((const));
/* Find the first occurrence of C in S (same as strchr). */
extern char *index (__const char *__s, int __c) __THROW __attribute_pure__;
/* Find the last occurrence of C in S (same as strrchr). */
extern char *rindex (__const char *__s, int __c) __THROW __attribute_pure__;
/* Compare S1 and S2, ignoring case. */
extern int strcasecmp (__const char *__s1, __const char *__s2)
__THROW __attribute_pure__;
/* Compare no more than N chars of S1 and S2, ignoring case. */
extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n)
__THROW __attribute_pure__;
__END_DECLS
#endif /* string.h */
#endif /* strings.h */
The other possibility is to remove the reference, eg.
#ifndef WIN32
#include <strings.h>
#endif
As for mysql, can you clarify something? If the main site uses mysql, then how can you test on your home devsite without it? You may get it to compile, but if the server needs mysql, then you will run into problems running. If this is the case you need to download and install mysql. That is a free download, and is available for Windows.
If mysql isn't needed, then why is it in the server code in the first place? Just remove all references.
The main site uses SQL yes, however, my purpose for the devsite is the make modifications some of the existing hardcoded systems, none of which tap into SQL.
As added strings.h in and attempted a compile, but got the following error:
c:\pennmush\hdrs\strings.h(27) : fatal error C1083: Cannot open include file: 'features.h': No such file or directory
I commented that include out just to see what would happen, and got about 200 more errors on the next compile attempt, so I guess that's not going to do the trick in itself. Also, I didn't come across ani of those #ifndef Win32 chunks either.
As added strings.h in and attempted a compile, but got the following error:
c:\pennmush\hdrs\strings.h(27) : fatal error C1083: Cannot open include file: 'features.h': No such file or directory
I commented that include out just to see what would happen, and got about 200 more errors on the next compile attempt, so I guess that's not going to do the trick in itself. Also, I didn't come across ani of those #ifndef Win32 chunks either.
I meant to put one in. Where it says:
#include <strings.h>
change it to the #ifndef I had (or, just comment it out).
#include <strings.h>
change it to the #ifndef I had (or, just comment it out).
Ok, I did that, and it seems like I'm down to one error:
c:\pennmush\src\player.c(42) : error C2059: syntax error : 'type'
The block of code it lies in is:
#if (CRYPT_SYSTEM == 1) || (CRYPT_SYSTEM == 3)
#ifdef I_CRYPT
#include <crypt.h>
#else
extern char *crypt(const char *, const char *); <--- Line it points to
#endif
#endif
I think I may be almost there :)
c:\pennmush\src\player.c(42) : error C2059: syntax error : 'type'
The block of code it lies in is:
#if (CRYPT_SYSTEM == 1) || (CRYPT_SYSTEM == 3)
#ifdef I_CRYPT
#include <crypt.h>
#else
extern char *crypt(const char *, const char *); <--- Line it points to
#endif
#endif
I think I may be almost there :)
Also, I had to options.h for some reason. One had the CRYPT_SYSTEM defintion as 1, the other two. I removed the second option.h file, and tried compiling with both definitions. When I use two, I get the following LNK2001 errors:
cmdlocal.obj : error LNK2001: unresolved external symbol _sql_query
cmdlocal.obj : error LNK2001: unresolved external symbol _sql_init
cmdlocal.obj : error LNK2001: unresolved external symbol _sql_shutdown
econ.obj : error LNK2001: unresolved external symbol _strsep
econ_prod.obj : error LNK2001: unresolved external symbol _strsep
econ.obj : error LNK2001: unresolved external symbol _alloca
econ_prod.obj : error LNK2001: unresolved external symbol _alloca
wiz.obj : error LNK2001: unresolved external symbol _kill_info_slave
But I don't get the syntax error.
cmdlocal.obj : error LNK2001: unresolved external symbol _sql_query
cmdlocal.obj : error LNK2001: unresolved external symbol _sql_init
cmdlocal.obj : error LNK2001: unresolved external symbol _sql_shutdown
econ.obj : error LNK2001: unresolved external symbol _strsep
econ_prod.obj : error LNK2001: unresolved external symbol _strsep
econ.obj : error LNK2001: unresolved external symbol _alloca
econ_prod.obj : error LNK2001: unresolved external symbol _alloca
wiz.obj : error LNK2001: unresolved external symbol _kill_info_slave
But I don't get the syntax error.
Ok, after messing with it a bit, I've narrowed it to the following 5 errors.
econ.obj : error LNK2001: unresolved external symbol _strsep
econ_prod.obj : error LNK2001: unresolved external symbol _strsep
econ.obj : error LNK2001: unresolved external symbol _alloca
econ_prod.obj : error LNK2001: unresolved external symbol _alloca
./game/pennmush.exe : fatal error LNK1120: 2 unresolved externals
econ.obj : error LNK2001: unresolved external symbol _strsep
econ_prod.obj : error LNK2001: unresolved external symbol _strsep
econ.obj : error LNK2001: unresolved external symbol _alloca
econ_prod.obj : error LNK2001: unresolved external symbol _alloca
./game/pennmush.exe : fatal error LNK1120: 2 unresolved externals