C++类声明并包含 gsoap 项目中的问题

发布于 2024-10-08 03:34:25 字数 1195 浏览 3 评论 0原文

我使用以下命令编译 gsoap 项目中的文件。
我的项目中几乎所有文件都是由 gsoap 工具生成的,我是 C++ 新手,所以我不能告诉太多。

总而言之,我需要了解我的项目是否可以编译。我需要其他标志吗?

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

当前的错误是:

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

第 10 行是:

AuftraegeImportSoap11BindingProxy::AuftraegeImportSoap11BindingProxy()

文件以此 include 开头,

#include "soapAuftraegeImportSoap11BindingProxy.h"

但在头文件中没有该类的声明。没有其他地方。另请参阅更多错误:

soapAuftraegeImportSoap11BindingProxy.cpp:10: 错误: 'AuftraegeImportSoap11BindingProxy' 尚未声明 soapAuftraegeImportSoap11BindingProxy.cpp:10: 错误:ISO C++ 禁止声明没有类型的“AuftraegeImportSoap11BindingProxy” soapAuftraegeImportSoap11BindingProxy.cpp:在函数“int AuftraegeImportSoap11BindingProxy()”中: soapAuftraegeImportSoap11BindingProxy.cpp:11: 错误: 'AuftraegeImportSoap11BindingProxy_init' 未在此范围内声明 soapAuftraegeImportSoap11BindingProxy.cpp:在全局范围内: soapAuftraegeImportSoap11BindingProxy.cpp:14:错误:“AuftraegeImportSoap11BindingProxy”不是类或命名空间

希望我的问题对您有意义。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寄居者 2024-10-15 03:34:25

为了解决这个问题,我发布了我的 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) 
lt;

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

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)

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) 
lt;

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

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)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文