2017-10-07 8 views
1

우분투 16.04에서 ChatScipt v7.55를 컴파일하려고합니다. 내가 make server 명령을 사용할 때, 나는이 오류가 :오류 : 'TCP_NODELAY'가이 범위에서 선언되지 않았습니다.

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 

이 명령의 전체 결과입니다

************ 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 

어떤 문제가 내가 그것을 어떻게 해결할 수 있습니까?

답변

0

위의 숫자에 #include <netinet/tcp.h>을 더하여이 문제를 해결했습니다. evserver.cpp 파일