Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ PennMUSH ➜ Compiling the server ➜ From Linux to Win32

From Linux to Win32

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Jamal   (20 posts)  Bio
Date Tue 02 Mar 2004 02:03 AM (UTC)
Message
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.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 02 Mar 2004 03:54 AM (UTC)
Message
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).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Jamal   (20 posts)  Bio
Date Reply #2 on Tue 02 Mar 2004 04:03 AM (UTC)
Message
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.
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #3 on Tue 02 Mar 2004 04:05 AM (UTC)

Amended on Tue 02 Mar 2004 04:08 AM (UTC) by Meerclar

Message
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.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #4 on Tue 02 Mar 2004 04:13 AM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Jamal   (20 posts)  Bio
Date Reply #5 on Tue 02 Mar 2004 04:36 AM (UTC)
Message
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.
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #6 on Tue 02 Mar 2004 11:28 AM (UTC)
Message
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.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Jamal   (20 posts)  Bio
Date Reply #7 on Tue 02 Mar 2004 08:43 PM (UTC)
Message
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.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #8 on Tue 02 Mar 2004 09:56 PM (UTC)
Message
First, strings.h is pretty small, you could take this and include it. Whether it helps or hinders I'm not sure.


/* 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.



- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Jamal   (20 posts)  Bio
Date Reply #9 on Tue 02 Mar 2004 11:52 PM (UTC)
Message
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.


Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #10 on Wed 03 Mar 2004 01:54 AM (UTC)
Message
I meant to put one in. Where it says:

#include <strings.h>

change it to the #ifndef I had (or, just comment it out).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Jamal   (20 posts)  Bio
Date Reply #11 on Wed 03 Mar 2004 03:05 AM (UTC)

Amended on Wed 03 Mar 2004 03:06 AM (UTC) by Jamal

Message
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 :)
Top

Posted by Jamal   (20 posts)  Bio
Date Reply #12 on Wed 03 Mar 2004 03:13 AM (UTC)
Message
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.
Top

Posted by Jamal   (20 posts)  Bio
Date Reply #13 on Wed 03 Mar 2004 04:38 AM (UTC)
Message
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
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


45,730 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.