[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Notes about compiling MUSHclient source under MVC++ .NET 2005
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

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

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


Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Tue 03 Apr 2007 08:43 PM (UTC)

Amended on Tue 03 Apr 2007 08:52 PM (UTC) by Zeno

Message
Getting a few more errors here compared to 2003. I think most of these seem easy enough to fix. I think all of the errors in 2003 apply to this.


New errors: (let me know if any fixes can be improved)


No idea if this is due to my options, or what. Just a warning though:
cl : Command line warning D9035 : option 'Fr' has been deprecated and will be removed in a future release
cl : Command line warning D9036 : use 'FR' instead of 'Fr'


Probably just needs to make it a bool:
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	s:\mc\mushclient\doc.h	2381


Not sure about this. Maybe it's the function return type:
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	s:\mc\mushclient\debugworldinputdlg.h	28-30


Make it an int:
error C2065: 'i' : undeclared identifier	s:\mc\mushclient\doc.cpp	4193


Make it a long:
error C2065: 'i' : undeclared identifier	s:\mc\mushclient\evaluate.cpp	925


Not sure if this is the same problem, but the last fix was already applied:
error C2440: 'static_cast' : cannot convert from 'UINT (__thiscall CStaticLink::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint)'	\mushclient\statlink.cpp	27


Make it a bool:
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	\mushclient\statlink.cpp	125


Make it an int:
error C2065: 'j' : undeclared identifier	\mushclient\utilities.cpp	1001


No idea:
Error	90	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	\mushclient\globalprefs.cpp	38

Error	91	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	\mushclient\globalprefs.cpp	686

Error	94	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	\mushclient\prefspropertypages.cpp	84


Make it an int:
Error	104	error C2065: 'i' : undeclared identifier	\mushclient\prefspropertypages.cpp	7693


Unsure:
Error	120	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	mushclient\debugworldinputdlg.cpp	142

Error	121	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	\mushclient\debugworldinputdlg.cpp	147

Error	122	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	\mushclient\debugworldinputdlg.cpp	152


All ints:
Error	123	error C2065: 'i' : undeclared identifier	\mushclient\highlightphrasedlg.cpp	158

Error	127	error C2065: 'i' : undeclared identifier	\mushclient\testrslt.cpp	103

Error	136	error C2065: 'i' : undeclared identifier	\mushclient\triggdlg.cpp	555

Error	138	error C2065: 'i' : undeclared identifier	\mushclient\mditabs.cpp	173

Error	140	error C2065: 'i' : undeclared identifier	\mushclient\mushview.cpp	1452


No idea:
Error	139	error C2065: 'wnd' : undeclared identifier	\mushclient\mditabs.cpp	327

Error	142	error C2065: 'stylepos' : undeclared identifier	\mushclient\mushview.cpp	3150

Error	150	error C2440: '=' : cannot convert from 'const char *' to 'char *'	\mushclient\textview.cpp	1700


Gonna try and fix most of these before I post more errors.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Nick Gammon   Australia  (21,607 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Tue 03 Apr 2007 09:39 PM (UTC)

Amended on Tue 03 Apr 2007 09:49 PM (UTC) by Nick Gammon

Message
Quote:

C++ does not support default-int s:\mc\mushclient\doc.h 2381


Yep, funny that slipped through:


CString GetArgument (const CArgumentList & ArgumentList, 
                     CString strName, 
                     const int iPosition, 
                     const bool bLowerCase = false);


Plus, change the actual function in mxputils.cpp.

Quote:

Maybe it's the function return type:

C++ does not support default-int s:\mc\mushclient\debugworldinputdlg.h 28-30


Yes, agreed:


  void AddAnsiSpecial (const char * sName, const int iCode);
  void AddMXPSpecial (const char * sName, const int iCode);
  void AddOtherSpecial (const char * sName, const int iCode);


Plus, change the functions themselves in DebugWorldInputDlg.cpp.


Quote:

'i' : undeclared identifier s:\mc\mushclient\doc.cpp 4193


It is declared further up - in my version the "int i" would persist, they must have changed that:


 void CMUSHclientDoc::RemoveChunk (void)
   {

// remove JUMP_SIZE lines

  for (int i = 0; i < JUMP_SIZE; i++)
    {
    delete m_LineList.GetHead ();   // delete contents of head iten
    m_LineList.RemoveHead ();
    }

// shuffle positions backwards

  for (i = 0; i < (m_maxlines / JUMP_SIZE); i++)
    m_pLinePositions [i] = m_pLinePositions [i + 1];


So it would need to read, to be compatible with earlier versions:


 void CMUSHclientDoc::RemoveChunk (void)
   {
   int i;

// remove JUMP_SIZE lines

  for (i = 0; i < JUMP_SIZE; i++)
    {
    delete m_LineList.GetHead ();   // delete contents of head iten
    m_LineList.RemoveHead ();
    }

// shuffle positions backwards

  for (i = 0; i < (m_maxlines / JUMP_SIZE); i++)
    m_pLinePositions [i] = m_pLinePositions [i + 1];

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,607 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Tue 03 Apr 2007 09:48 PM (UTC)
Message
Quote:

'i' : undeclared identifier s:\mc\mushclient\evaluate.cpp 925


The same thing happened as before, I would move the "long i" out of the "for" loop and hope it persists outside the loop. Not sure if it does. It wouldn't in Lua:


    long i;
    for (i = 1; i < MAX_WILDCARDS; i++)
      {
      COleVariant v (alias_item->wildcards [i].c_str ());
      sa.PutElement (&i, &v);
      }
    // i should be MAX_WILDCARDS (10) now ;)
    COleVariant v (alias_item->wildcards [0].c_str ()); // the whole matching line
    sa.PutElement (&i, &v);


Quote:

cannot convert from 'UINT (__thiscall CStaticLink::* )(CPoint)' to
'LRESULT (__thiscall CWnd::* )(CPoint)'
\mushclient\statlink.cpp 27


In statlink.h, change the prototype to:


afx_msg LRESULT	OnNcHitTest(CPoint point);


In statlink.cpp, change the function to:


LRESULT CStaticLink::OnNcHitTest(CPoint point)
{
	return HTCLIENT;
}



- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,607 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Tue 03 Apr 2007 09:51 PM (UTC)

Amended on Tue 03 Apr 2007 09:52 PM (UTC) by Nick Gammon

Message
Quote:

'j' : undeclared identifier \mushclient\utilities.cpp 1001


Take the "int j" out of the for loop, eg.


      int j;
      for (j = 0; VirtualKeys [j].iVirtualKey; j++)
        {
        if (strPart.CompareNoCase (VirtualKeys [j].sKeyName) == 0)
          {
          if (key != 0)
            ThrowErrorException ("You cannot specify two keystrokes");

          key = VirtualKeys [j].iVirtualKey;
          break;
          }
        } // end of finding key name

      if (VirtualKeys [j].iVirtualKey == 0)
        ThrowErrorException ("Keystoke %s unknown", (LPCTSTR) strPart);



The important thing is to not only add a declaration, but to remove the one inside the for loop, otherwise it will not behave.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,607 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Tue 03 Apr 2007 10:10 PM (UTC)
Message
Quote:

missing type specifier - int assumed.
Note: C++does not support default-int \mushclient\globalprefs.cpp 38


Change the prototype and function to read:


int __stdcall BrowseCallbackProc(


Ditto for \mushclient\prefspropertypages.cpp 84

Quote:

error C2065: 'i' : undeclared identifier \mushclient\prefspropertypages.cpp 7693


Again, move the "int i" out of the loop (before the earlier 'for').


Quote:

mushclient\debugworldinputdlg.cpp 142 / 147 / 152


Put "void" in front of the function names as suggested before for the prototype.

Quote:

All ints:

Error 123 error C2065: 'i' : undeclared identifier \mushclient\highlightphrasedlg.cpp 158

... etc.


Again, I haven't looked at all of these but I would move the declaration from the original for loop, so it is outside all for loops.

Quote:

error C2065: 'wnd' : undeclared identifier \mushclient\mditabs.cpp 327


Move the "HWND wnd" declaration out of the for loop.

Quote:

error C2065: 'stylepos' : undeclared identifier \mushclient\mushview.cpp 3150


Ditto for "POSITION stylepos".

Quote:

cannot convert from 'const char *' to 'char *' \mushclient\textview.cpp 1700


Change to:


    const char * end;


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,607 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Tue 03 Apr 2007 10:15 PM (UTC)
Message
In case anyone is reading this and thinks this shows that MUSHclient is "riddled with bugs", all these messages are basically compiler warnings about syntactical aspects that have been tightened up over the last few years. None will affect program operation as such.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #6 on Wed 04 Apr 2007 12:34 AM (UTC)
Message
The for loop variables were actually a bug in Microsoft's implementation of the standard, if I remember correctly. The loop variable declared in the initializer part is supposed to be local to the for loop, as in Lua. The earlier versions did not respect that, and so the variable persisted.

This is something that happens with gcc, too, incidentally; a lot of programs that compiled with gcc 3.3 simply will not compile with gcc 4 or "worse yet" 4.1.

But, the compilers are just doing their job, enforcing proper usage of the language. The fact that the bug fixes require oftentimes significant changes to existing programs is kind of irritating sometimes... :-)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #7 on Thu 05 Apr 2007 07:48 PM (UTC)

Amended on Thu 05 Apr 2007 08:38 PM (UTC) by Zeno

Message
Here are the rest. They're all easy to fix, but I'll post them here in case other people run into the problem as well.
Error	78	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	\mushclient\statlink.cpp	125
Error	117	error C2065: 'j' : undeclared identifier	mushclient\utilities.cpp	2369
Error	122	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	mushclient\globalprefs.cpp	686
Error	140	error C2065: 'i' : undeclared identifier	mushclient\prefspropertypages.cpp	7795
Error	153	error C2065: 'i' : undeclared identifier	mushclient\testrslt.cpp	103
Error	162	error C2065: 'i' : undeclared identifier	mushclient\triggdlg.cpp	555
Error	164	error C2065: 'i' : undeclared identifier	mushclient\mditabs.cpp	173
Error	165	error C2065: 'i' : undeclared identifier	mushclient\mushview.cpp	1452
Error	176	error C2065: 'i' : undeclared identifier	mushclient\xml_load_world.cpp	1731
Error	177	error C2664: 'WideCharToMultiByte' : cannot convert parameter 3 from 'unsigned short *' to 'LPCWSTR'	mushclient\xml_serialize.cpp	113
Error	179	error C2664: 'WideCharToMultiByte' : cannot convert parameter 3 from 'unsigned short *' to 'LPCWSTR'	mushclient\xmlparse.cpp	197
Error	180	error C2664: 'WideCharToMultiByte' : cannot convert parameter 3 from 'unsigned short *' to 'LPCWSTR'	mushclient\xmlparse.cpp	202
Error	188	error C2593: 'operator +=' is ambiguous	mushclient\methods.cpp	2590
Error	189	error C2065: 'pos' : undeclared identifier	mushclient\methods.cpp	3119
Error	197	error C2065: 'p' : undeclared identifier	mushclient\methods.cpp	7382
Error	200	error C2065: 'iCount' : undeclared identifier	mushclient\methods.cpp	8293


I'll let you know if there are any I'm not sure how to fix.

I'm also getting this:
Error	27	error BK1506 : cannot open file '.\WinDebug\pcre.sbr': No such file or directory	BSCMAKE

[EDIT] Fixed the pcre.sbr problem by turning on Browse Info (/FR).

Linker error:
Error	3	error LNK2019: unresolved external symbol "bool const __cdecl optboolean(struct lua_State *,int,bool)" (?optboolean@@YA?B_NPAUlua_State@@H_N@Z) referenced in function "int __cdecl filepicker(struct lua_State *)" (?filepicker@@YAHPAUlua_State@@@Z)	lua_utils.obj

Has to do with this line:
int bSave = optboolean(L, 5, 0);

But I would think it would know which fn to use because of overloading.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Nick Gammon   Australia  (21,607 posts)  [Biography] bio   Forum Administrator
Date Reply #8 on Fri 06 Apr 2007 08:03 AM (UTC)
Message
I don't know if it can convert 0 to false.

Better change the 0 to false then it should compile.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (21,607 posts)  [Biography] bio   Forum Administrator
Date Reply #9 on Sat 07 Apr 2007 04:29 AM (UTC)
Message
In the end I changed the prototype and function to:


const bool optboolean (lua_State *L, const int narg, const int def);


Also I found one place where it was called with "true", so I changed it to 1.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #10 on Tue 10 Apr 2007 08:28 PM (UTC)

Amended on Tue 10 Apr 2007 08:31 PM (UTC) by Zeno

Message
I tested the latest source release, there's a few more needed to compile error-free in 2005.

Error	176	error C2065: 'i' : undeclared identifier	mushclient\xml_load_world.cpp	2057

Error	197	error C2065: 'iCount' : undeclared identifier	mushclient\methods.cpp	8424

Error	212	error BK1506 : cannot open file '.\windebug\pcre.sbr': No such file or directory	BSCMAKE


Of course the fixes are obvious, and as far as the last one I'm not so sure about that one. It can probably be ignored, I'm guessing it's a setting with my 2005 version.

Hm, I'm still getting the linker error as well:
Error	148	error LNK2019: unresolved external symbol "bool const __cdecl optboolean(struct lua_State *,int,int)" (?optboolean@@YA?B_NPAUlua_State@@HH@Z) referenced in function "int __cdecl filepicker(struct lua_State *)" (?filepicker@@YAHPAUlua_State@@@Z)	lua_utils.obj

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Nick Gammon   Australia  (21,607 posts)  [Biography] bio   Forum Administrator
Date Reply #11 on Tue 10 Apr 2007 09:43 PM (UTC)
Message
Maybe change, in filepicker in lua_utils.cpp:


bool bSave = optboolean (L, 5, 0);


Return type was int before.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Ked   Russia  (524 posts)  [Biography] bio
Date Reply #12 on Sun 10 Jun 2007 05:24 PM (UTC)
Message
The linker error still persists in version 4.08. Seems that the problem is that lua_methods.cpp defines optboolean as static, while it is declared in lua_helpers.h without the "static" keyword. I solved the problem for myself by removing the keyword from the definition in lua_methods.
[Go to top] top

Posted by Nick Gammon   Australia  (21,607 posts)  [Biography] bio   Forum Administrator
Date Reply #13 on Sun 10 Jun 2007 10:33 PM (UTC)
Message
OK, changed as you suggested.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] 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.


9,965 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]