The compiler can't find toupper. That is not a problem because I can live without a translation to upper case as evidence that a message reached the server. I comment out that line, and the compiler runs error free and links a binary.

abl wrote:Beep() is a Windows function, but I'm running on Linux. I know how to make noise on Linux with echo, but I don't need that to see the program work. I comment out the lines with Beep() in them:

Yes, the Beep function is a Windows function and is used so you can hear that a keep alive is received. You can safely comment it out.

abl wrote:The compiler can't find toupper. That is not a problem because I can live without a translation to upper case as evidence that a message reached the server.

Actually the problem is that the compiler finds two overloads of "toupper()". One in <locale> with two arguments and one in <cctype> with one argument. When passing the "toupper()" function (function pointer) as argument to the "transform()" function the GNU compiler can't deduct that the version with one argument is meant while the Visual C++ compiler can. The solution is to wrap the call to toupper() in another function that has no conflict.

Thus add the following code to the "Server.hpp" file in the ASyncConnectionMt class:

abl wrote:terminate called after throwing an instance of 'std::length_error'

what(): basic_string::_S_create

terminate called after throwing an instance of 'std::bad_alloc'

what(): std::bad_alloc

Aborted

This is caused in how the GNU and Visual C++ compilers differ in handling the length of data types in 64bit code. With the transition to 64bit code Microsoft explicitly kept the length of integer data types the same for compatibility reasons. Thus under both 32 and 64 bit Visual C++ compilers and 32 bit GNU compiler the data type have the following lengths:

short = 16 bit

int = 32 bit

long = 32 bit

long long = 64 bit

But under Linux/GNU, the 64 bit compilers changed the length of data types to:

short = 16 bit

int = 32 bit

long = 64 bit

long long = 64 bit

This caused a problem in building the byte array from the message data for sending a message over the network because it assumed a long was 32 bit.

The solution is to find and replace all the "long"s in the "Message.hpp" file by 'int32_t' which is normally defined in <stdint.h> header file. But this header file is not included in Visual C++ 2008 and lower but luckily it is also defined in the boost libraries <boost/cstdint.hpp> so with boost applications it should also work under older Visual C++ version.

I hope I've answered your questions and that this solves your problems.