2014-06-18 5 views
0

나는 Github (https://github.com/cesanta/mongoose)의 몽구스 웹 서버를 따라 가고 있으며 websocket 샘플 코드를 테스트하고 싶습니다.몽구스 웹 소켓이 실행되지 않습니다

websocket.obj : error LNK2001: unresolved external symbol _find_embedded_file 
C:\ProjectFolder\WebsocketDemo.exe : fatal error LNK1120: 1 unresolved externals 

내가 뭔가를 놓친 건가 : 나는이 코드를 실행하면

enter image description here

불행하게도, 그것은 다음과 같은 오류를 반환

여기에 복사 한 코드는? 예제의 makefile

답변

0

을 ㄷ 파일 (이 누락 된 find_embedded_file 함수를 정의) 내부의 websocket.html을 임베디드 websocket_html.c를 생성하는 규칙이 있습니다없는 것을 설명한다. 당신이 websocket.html 파일에 대한 액세스 권한을 부여하려는 경우

websocket_html.c: websocket.html 
    perl mkdata.pl $< > [email protected] 

이는 DOCUMENT_ROOT 옵션을

mg_set_option(server, "document_root", "."); 
  • 하지 설정 websocket.c 샘플

    1. 수정을 완료 할 수 사용자 핸들러에서 html url을 처리하십시오.

      static int send_reply(struct mg_connection *conn) { 
          if (conn->is_websocket) { 
          ... 
          } else { 
           return MG_FALSE; // mongoose will open file specified by the url 
          } 
      }