Eu resolvi o problema adicionando #include <netinet/tcp.h>
em cima do arquivo "evserver.cpp"
Estou tentando compilar o ChatScipt v7.55 no Ubuntu 16.04. Mas quando eu uso o comando make server
, recebo este erro:
evserver.cpp: In function ‘int settcpnodelay(int)’:
evserver.cpp:263:40: error: ‘TCP_NODELAY’ was not declared in this scope
return setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (void*) &on, sizeof(on));
^
Makefile:110: recipe for target 'evserver.o' failed
make: *** [evserver.o] Error 1
Este é o resultado completo do comando:
************ LINUX VERSION ************
g++ -c -std=c++11 -Wall -funsigned-char -Wno-write-strings -Wno-char-subscripts -Wno-strict-aliasing -DLOCKUSERFILE=1 -DEVSERVER=1 -DEVSERVER_FORK=1 -DDISCARDPOSTGRES=1 -DDISCARDMONGO=1 -DDISCARDMYSQL=1 -Ievserver evserver.cpp -o evserver.o
evserver.cpp: In function ‘int settcpnodelay(int)’:
evserver.cpp:263:40: error: ‘TCP_NODELAY’ was not declared in this scope
return setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (void*) &on, sizeof(on));
^
Makefile:110: recipe for target 'evserver.o' failed
make: *** [evserver.o] Error 1
Qual é o problema e como posso corrigi-lo?
Tags error-handling compiling tcp delay