C++ compile issue

c++, gcc

Solution

Both `std::memset` and `std::strerror` are declared in the `<cstring>` header, you need to `#include` that one.

And GCC does not have a `-mt` option.

Problem

``` meme@ubuntu:~/Data$ g++ UDPEchoServer.cpp PracticalSocket.cpp -o udpskserv -lsocket -lnsl -mt ``` I trying to compile at my compiler ubuntu and i receive this error ``` cc1plus: error: unrecognized command line option ‘-mt’ ``` May i ask what is -mt , i try google but can't find any information. If I try omit the -mt parameter i get this error ``` PracticalSocket.cpp: In constructor ‘SocketException::SocketException(const string&, bool)’: PracticalSocket.cpp:33:38: error: ‘strerror’ was not declared in this scope PracticalSocket.cpp: In function ‘void fillAddr(const string&, short unsigned int, sockaddr_in&)’: PracticalSocket.cpp:47:32: error: ‘memset’ was not declared in this scope PracticalSocket.cpp: In member function ‘void Socket::setLocalPort(short unsigned int)’: PracticalSocket.cpp:119:42: error: ‘memset’ was not declared in this scope PracticalSocket.cpp: In static member function ‘static short unsigned int Socket::resolveService(const string&, const string&)’: PracticalSocket.cpp:153:32: error: ‘atoi’ was not declared in this scope PracticalSocket.cpp: In member function ‘void UDPSocket::disconnect()’: PracticalSocket.cpp:291:40: error: ‘memset’ was not declared in this scope ```

Original source

Related problems