C++ class declaration and include issues in gsoap

2019-09-07 08:26发布

问题:

I compile a file in a gsoap project with the following command.
Almost all files in my project are generated by the gsoap tools and i am new to C++ so i cant tell very much about it.

All in all i need to understand if my project could compile at all. Do i need other flags?

gcc -c  -I/usr/include/gsoap soapAuftraegeImportSoap11BindingProxy.cpp

the current error is:

soapAuftraegeImportSoap11BindingProxy.cpp:10: error: 'AuftraegeImportSoap11BindingProxy' has not been declared

this line 10 is:

AuftraegeImportSoap11BindingProxy::AuftraegeImportSoap11BindingProxy()

the file starts with this include:

#include "soapAuftraegeImportSoap11BindingProxy.h"

but in the header file there is no declaration of the class. And nowhere else. See also further errors:

soapAuftraegeImportSoap11BindingProxy.cpp:10: error: 'AuftraegeImportSoap11BindingProxy' has not been declared soapAuftraegeImportSoap11BindingProxy.cpp:10: error: ISO C++ forbids declaration of 'AuftraegeImportSoap11BindingProxy' with no type soapAuftraegeImportSoap11BindingProxy.cpp: In function 'int AuftraegeImportSoap11BindingProxy()': soapAuftraegeImportSoap11BindingProxy.cpp:11: error: 'AuftraegeImportSoap11BindingProxy_init' was not declared in this scope soapAuftraegeImportSoap11BindingProxy.cpp: At global scope: soapAuftraegeImportSoap11BindingProxy.cpp:14: error: 'AuftraegeImportSoap11BindingProxy' is not a class or namespace

Hopefully my question makes sense to you.

回答1:

just to close this issue , i post my makefile

C=g++
CCPLUS=g++
CFLAGS=-c  #-Wall


### gsoap 
INCL=-I/usr/include/gsoap
LIBS= -L/usr/lib/gsoap
LINK= -lgsoap -lgsoap++ -lgsoapck -lgsoapck++ -lgsoapssl -lgsoapssl++
OLINK= -lgsoap++

#OBJ=soapServer.o soapServerLib.o soapC.o

.SUFFIXES: .o .cpp

.cc.o:
        @rm -f $@
        $(CC) $(CFLAGS) $(INCL) $(INC) $<

.cpp.o:
        @rm -f $@
        $(CC) $(CFLAGS) $(INCL) $(INC)  $<

default:    client

clean:
        rm -r *.o 

cleanall:
        rm soap* *.xml *.nsmap *.h *.cgi 


default:    all
all:    client server

client: KundenWebServiceClient


server: KundenWebServiceServer
        cp KundenWebServiceServer /usr/lib/cgi-bin/

proxy: KundenWebService.h
        soapcpp2 -x -L -C -i -I/usr/include/gsoap KundenWebService.h
        rm *12*

service: KundenWebService.h
        soapcpp2 -x -L -S -i -I/usr/include/gsoap KundenWebService.h
        rm *12*

KundenWebService.h: KundenWebService.wsdl
        wsdl2h KundenWebService.wsdl

###


KundenWebServiceClient: KundenWebServiceClient.o soapKundenWebServiceSoap11BindingProxy.o soapC.o getrow.o
        $(CC)  -o KundenWebServiceClient KundenWebServiceClient.o soapKundenWebServiceSoap11BindingProxy.o soapC.o getrow.o $(LIBS) $(OLINK)


KundenWebServiceServer: KundenWebServiceServer.o soapKundenWebServiceSoap11BindingService.o soapC.o
        $(CC)  -o KundenWebServiceServer KundenWebServiceServer.o soapKundenWebServiceSoap11BindingService.o soapC.o $(OLINK)