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, 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.
 Entire forum ➜ MUSHclient ➜ General ➜ Notes about compiling MUSHclient source under MVC++ .NET 2003

Notes about compiling MUSHclient source under MVC++ .NET 2003

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


Pages: 1 2  

Posted by Zeno   USA  (2,871 posts)  Bio
Date Mon 02 Apr 2007 02:14 AM (UTC)

Amended on Mon 02 Apr 2007 03:59 AM (UTC) by Zeno

Message
Setting up the workspace was a lot less painful than I thought, all I had to do was open the Project and VS updated it to work in 2003 (I thought I would have to import each file).

I'm gotten past a few things so far (location of Lua and zLib etc), but I'm not sure about this:
MUSHclient\source\mushclient\mcdatetime.h(141) : error C2065: 'AFX_OLE_DATETIME_HALFSECOND' : undeclared identifier

MUSHclient\source\mushclient\mcdatetime.h(147) : error C3861: 'AFX_OLE_DATETIME_HALFSECOND': identifier not found, even with argument-dependent lookup


stdafx.cpp
 WINVER not defined. Defaulting to 0x0501 (Windows XP and Windows .NET Server)

[EDIT] Info about WINVER here: http://www.delphifaq.com/faq/f931.shtml

From what I've Googled, it's part of Microsoft's lib or the sort. I'm not sure what I'm missing, but I'm still looking into it.
[EDIT] Seems to be in AFXDISP.H?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #1 on Mon 02 Apr 2007 02:34 AM (UTC)
Message


#define AFX_OLE_DATETIME_HALFSECOND (1.0 / (2.0 * (60.0 * 60.0 * 24.0)))


I don't know about WINVER, I can't see where it is used, but I found this define:


#ifndef WINVER
#define WINVER 0x0400 // default to Windows Version 4.0
#endif


- Nick Gammon

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

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #2 on Mon 02 Apr 2007 02:41 AM (UTC)

Amended on Mon 02 Apr 2007 02:54 AM (UTC) by Zeno

Message
Ah okay, I wasn't sure if I was missing an entire lib or just that define. I don't think WINVER will be a problem? I'll wait and see if it causes any problems at the end.

Getting some more errors here (thanks for helping):
MUSHclient\source\mushclient\OtherTypes.h(342) : error C2377: 'INPUT' : redefinition; typedef cannot be overloaded with any other symbol

        c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinUser.h(5023) : see declaration of 'INPUT'



Not sure about his one, perhaps WinUser did not have this definition in your version of VS?

What version of zLib is being used? I'm using the latest, but seen to be missing files:
infutil.c
c1 : fatal error C1083: Cannot open source file: 'MUSHclient\source\zlib\infutil.c': No such file or directory
infcodes.c
c1 : fatal error C1083: Cannot open source file: 'MUSHclient\source\zlib\infcodes.c': No such file or directory
infblock.c
c1 : fatal error C1083: Cannot open source file: 'MUSHclient\source\zlib\infblock.c': No such file or directory

Or wait... Importing the Project included these listed files but they do not exist. Hmm.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #3 on Mon 02 Apr 2007 03:18 AM (UTC)
Message
They were in another directory, to save you the trouble of finding the files they are available from here:

http://www.gammon.com.au/files/mushclient/src/zlib.zip

The md5sum is 22cdecbe6b8d41994202b710e601101f.

- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #4 on Mon 02 Apr 2007 03:19 AM (UTC)

Amended on Mon 02 Apr 2007 03:33 AM (UTC) by Nick Gammon

Message
Quote:

error C2377: 'INPUT' : redefinition;


They have evidently taken that word now.

I suggest doing a find-and-replace, case sensitive, and matching the exact word, to change INPUT to something like USER_INPUT (in my source).

Hmmm - USER_INPUT is already used, perhaps NOT_OUTPUT would be better.


// bit settings for "flags" below

const int COMMENT = 0x01;        // this is a comment from a script
const int USER_INPUT = 0x02;     // this is echoed user input
const int LOG_LINE = 0x04;       // this line is to be logged
const int BOOKMARK = 0x08;       // line is bookmarked
const int HORIZ_RULE = 0x10;     // line is a horizontal rule

const int INPUT = 0x03;         // for testing if line is an output line or not


Change last line, and all references to NOT_OUTPUT:


const int NOT_OUTPUT = 0x03;         // for testing if line is an output line or not


However usually I used INPUT in the "not" sense, so "not NOT_OUTPUT" looks a bit strange.

Maybe a better word is NOTE_OR_INPUT.

- Nick Gammon

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

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #5 on Mon 02 Apr 2007 03:36 AM (UTC)

Amended on Mon 02 Apr 2007 03:38 AM (UTC) by Zeno

Message
USER_INPUT is already used it seems, so I used USR_INPUT.

With those zLib files, I'm getting this on each of the 3 files:
MUSHclient\source\zlib\infutil.c(89) : fatal error C1010: unexpected end of file while looking for precompiled header directive

I have a feeling I did something wrong.

Other than that, looks like I'm down to only 5 errors.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #6 on Mon 02 Apr 2007 03:41 AM (UTC)
Message
Quote:

unexpected end of file while looking for precompiled header directive


For those files edit them in the project view and change properties under C/C++ -> Precompiled Headers to "Not using precompiled headers".

- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #7 on Mon 02 Apr 2007 03:42 AM (UTC)
Message
Quote:

USER_INPUT is already used it seems, so I used USR_INPUT


I amended the post, maybe NOTE_OR_INPUT is better, considering that USER_INPUT is very close by.

- Nick Gammon

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

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #8 on Mon 02 Apr 2007 03:45 AM (UTC)

Amended on Mon 02 Apr 2007 03:46 AM (UTC) by Zeno

Message
Ah okay, thanks. I'm not used to VS, I only use it for classes. Other than that, I use gcc/g++.

Here are the remaining errors:
MUSHclient\source\mushclient\methods.cpp(2590): error C2593: 'operator +=' is ambiguous


MUSHclient\source\mushclient\sendvw.cpp(231): 
error C2440: 'static_cast' : cannot convert from 'void (__thiscall CSendView::* )(CMenu *)' to 'void (__thiscall CWnd::* )(CMenu *,UINT,BOOL)'


MUSHclient\source\mushclient\CHATSOCK.CPP(859): error C2593: 'operator =' is ambiguous


MUSHclient\source\mushclient\CHATSOCK.CPP(872): error C2593: 'operator =' is ambiguous


MUSHclient\source\mushclient\CHATSOCK.CPP(896): error C2593: 'operator +=' is ambiguous

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #9 on Mon 02 Apr 2007 03:49 AM (UTC)
Message
To explain about those bits, the lower-order bits of the line flags are:


const int COMMENT = 0x01;        // this is a comment from a script
const int USER_INPUT = 0x02;     // this is echoed user input


Thus, an output line is really 0x00.

To put it another way, if you take the flags from a line in the output buffer, and "and" it with 0x03, you would get one of 4 values (3 of which are used):


  • 0x00 - an output line
  • 0x01 - a note line (ie. world.Note etc.)
  • 0x02 - something the player typed (ie. a command)
  • 0x03 - not used


Thus there are various tests in the code along these lines:


if (!(flags & INPUT))  // input from MUD


What this is saying is that if "flags & 0x03" is zero, then it is an output line (input from the MUD - things are getting confusing here).

So, to test if "flags & 0x03" is an output line, we need to reverse the logic, to get a "true" out of it, hence:


if (!(flags & 0x03)) // this arrived from the MUD



- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #10 on Mon 02 Apr 2007 04:03 AM (UTC)
Message
Quote:

methods.cpp(2590): error C2593: 'operator +=' is ambiguous


Try casting to char:


for (p++ ; *p && *p != ')'; )
  str += (char) tolower (*p++);   // add to string


Quote:

error C2440: 'static_cast' : cannot convert from ...


Not sure about this, they appear to have changed the way the macro works. Try commenting it out for now and taking the hit of that part not working while we sort it out.


Quote:

CHATSOCK.CPP(859): error C2593: 'operator =' is ambiguous


This seems to be this line:


      strData = (unsigned char) iMessage;


Try casting it a second time:


      strData = (char) (unsigned char) iMessage;


Ditto for the other ones.

- Nick Gammon

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

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #11 on Mon 02 Apr 2007 04:11 AM (UTC)

Amended on Mon 02 Apr 2007 04:13 AM (UTC) by Zeno

Message
Casting it a second time didn't work for these lines:
strData =  (char) (unsigned char) iMessage & 0xFF;


strData += (char) (unsigned char) iLength & 0xFF;


Thanks though, those are the only errors left.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #12 on Mon 02 Apr 2007 04:12 AM (UTC)
Message
Quote:

MUSHclient\source\mushclient\sendvw.cpp(231):
error C2440: 'static_cast' : cannot convert ...


What might work is to change (in sendvw.cpp):


void CSendView::OnInitMenuPopup(CMenu* pMenu)
  {
  int i = 1;
  }


to:


void CSendView::OnInitMenuPopup(CMenu* pMenu, UINT nIndex, BOOL bSysMenu)
  {
  int i = 1;
  }


Also change (in sendvw.h):


	afx_msg void OnInitMenuPopup(CMenu* pMenu);


to:


	afx_msg void OnInitMenuPopup(CMenu* pMenu, UINT nIndex, BOOL bSysMenu);

- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #13 on Mon 02 Apr 2007 04:17 AM (UTC)

Amended on Mon 02 Apr 2007 04:18 AM (UTC) by Nick Gammon

Message
Quote:

strData = (char) (unsigned char) iMessage & 0xFF;


Try:


strData =  CString ( (unsigned char) iMessage & 0xFF);


Or maybe:


strData = (char) ((unsigned char) iMessage & 0xFF);


Or:


strData = (char) ((unsigned char) (iMessage & 0xFF));


- Nick Gammon

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

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #14 on Mon 02 Apr 2007 04:21 AM (UTC)

Amended on Mon 02 Apr 2007 04:23 AM (UTC) by Zeno

Message
Yep, 3rd one worked. I appear to be missing icons now.
.\MUSHclient.rc(5102) : error RC2135 : file not found: icons\Cdrom01.ico
.\MUSHclient.rc(5103) : error RC2135 : file not found: icons\Wrench.ico
.\MUSHclient.rc(5104) : error RC2135 : file not found: icons\Clock05.ico
.\MUSHclient.rc(5105) : error RC2135 : file not found: icons\Earth.ico
.\MUSHclient.rc(5106) : error RC2135 : file not found: icons\Graph08.ico
.\MUSHclient.rc(5107) : error RC2135 : file not found: icons\Handshak.ico
.\MUSHclient.rc(5108) : error RC2135 : file not found: icons\Mail16b.ico
.\MUSHclient.rc(5109) : error RC2135 : file not found: icons\Net01.ico
.\MUSHclient.rc(5110) : error RC2135 : file not found: icons\Point11.ico
.\MUSHclient.rc(5111) : error RC2135 : file not found: icons\Clip07.ico
.\MUSHclient.rc(5119) : error RC2135 : file not found: graphics\Colour logo copy.BMP


I have no icons or graphics folder.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
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.


55,687 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

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.