i just wanted to test my client against your server but codeblocks tells me this... and now i´m sad.
-------------- Build: Debug in Server (compiler: GNU GCC Compiler)---------------
g++ -std=c++11 -Wall -g -c /Users/tom/Documents/Dev/max/chat/Server/main.cpp -o obj/Debug/Server/main.o
/Users/tom/Documents/Dev/max/chat/Server/main.cpp:43:9: error: use of undeclared identifier 'gethostname'; did you mean 'gethostbyname2'?
if (gethostname(hostname, sizeof(hostname)) == -1) {
^~~~~~~~~~~
gethostbyname2
/usr/include/netdb.h:292:17: note: 'gethostbyname2' declared here
struct hostent *gethostbyname2(const char *, int);
^
/Users/tom/Documents/Dev/max/chat/Server/main.cpp:43:49: error: comparison between pointer and integer ('struct hostent *' and 'int')
if (gethostname(hostname, sizeof(hostname)) == -1) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~
2 errors generated.
Process terminated with status 1 (0 minute(s), 1 second(s))
2 error(s), 0 warning(s) (0 minute(s), 1 second(s))
||=== Build: Debug in Server (compiler: GNU GCC Compiler) ===|
/Users/tom/Documents/Dev/max/chat/Server/main.cpp|43|error: use of undeclared identifier 'gethostname'; did you mean 'gethostbyname2'?|
/usr/include/netdb.h|292|note: 'gethostbyname2' declared here|
/Users/tom/Documents/Dev/max/chat/Server/main.cpp|43|error: comparison between pointer and integer ('struct hostent *' and 'int')|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|