Questions about tiny mud server

Posted by Dr_who on Fri 02 Jul 2010 04:29 PM — 4 posts, 23,508 views.

#0
I have a questions about compiling tinymud server version 2_2.

I have tried typing make at the command line, and I get a long list of compile errors. According to the readme file included with the software, you can also type:
gcc tinymudserver.cpp -o tinymudserver -g -Wall at the command line to try to get it to compile. However, this method also produces compile errors (at least for me). Perhapse I have something wrong with my build environment.

I have tried pulling files into netbeans one at a time to try to help me identify the problems and get it to compile. Most of the errors I've found appear to stem from the lack of putting std:: in front of string declarations.

So far, I have gotten nearly everything cleared up. However, I still have one error where netbeans states that it cannot resolve the identifier MAKE_STRING used in player.h.

No matter what I try, I cannot get the compiler to recognize MAKE_STRING from the following code:

// output to player (any type)
template<typename T>
tPlayer & operator<< (const T & i)
{
outbuf += MAKE_STRING (i);
return *this;
};

Can someone please offer some suggestions?

Thanks in advance.
USA #1
What kind of error messages are you getting?
#2
After a little digging in the code, I found the definition of MAKE_STRING in the utils.h file. So, I included utils.h in the player.h file, and I thought all would be good.

When I went to compile the code, I got the following error however:

utils.h: In function ‘void LoadSet(std::ifstream&, T&)’:
In file included from player.h:19,
utils.h:37: error: no matching function for call to ‘getline(std::basic_ifstream<char, std::char_traits<char> >&, std::string&)’

The code snippet from utils.h is as follows:

// load a set of flags from a single line in the input stream "f"
template <class T>
void LoadSet (ifstream & f, T & s)
{
s.clear ();
string sLine;
getline (f, sLine); // get one line
istringstream is (sLine); // convert back to stream
string flag; // each flag name

while (!is.eof ()) // read that stream
{
is >> flag; // read flag
s.insert (flag); // and insert it
} // end of getting each item
} // end of LoadSet

I'm really new to c++, but so far as I know I'm using g++ version 4.4 if that helps.


Any help would be appreciated. Thanks.
#3
Well, this is an update...

After poking about a bit, I found this thread on tinymudserver

http://www.gammon.com.au/forum/?id=4496

I found out there is a version 2.3. I downloaded that, and made the includes to make the transform error go away.

Everything compiles now and I can connect via telnet.

I guess we can mark this as solved.