gSOAP을 사용하여 C++로 작성된 서버 측을 만들고 있습니다. "Server.h"파일에 간단한 "sum"함수를 작성했습니다. /Users/pc/Desktop/Server.h과 내가 가진 이러한 파일 :gSOAP을 사용하여 C++ 서버를 만드는 방법은 무엇입니까?
soapServerService.h
soapServerService.cpp
soapServerProxy.h
soapServerProxy.cpp
Server.nsmap
soapStub.h
soapH.h
soapC.cpp
//gsoap ns service name: Server
//gsoap ns service namespace: urn:Server
//gsoap ns service style: rpc
//gsoap ns service encoding: encoded
int ns__sum(int a, int b, int *res);
은 그 때 나는 soapcpp2 -i -s C이 명령을 사용하여 "Server.h"를 생성 그런 다음이 코드 시도 :
#include "Server.nsmap"
#include "soapServerService.h"
int main()
{
ServerService server();
server.serve();
return 0;
}
int ServerService::sum(int a, int b, int *res)
{
*res = a + b;
return SOAP_OK;
}
을하지만이 같은 일부 오류가 있습니다
을 비 클래스 형 'ServerService()
그 의미와 내가 무엇을해야 할입니다'서버 '에서'역할 '멤버
요청?
함수 서브가 있습니까? – Valgrind1691
예. 나는 그것을 검사했다. –