代码之家  ›  专栏  ›  技术社区  ›  Majdi

gSoap QT未定义引用

  •  0
  • Majdi  · 技术社区  · 11 年前

    我正在尝试使用gSOAP创建一个c++/QT服务器/客户端

    这是我的Test.h文件

    //gsoap ns service name:    ColisageMutexService
    //gsoap ns service style:   rpc
    //gsoap ns service encoding:    literal
    //gsoap ns service location:    http://localhost:1444
    //gsoap ns schema namespace: urn:ColisageMutex
    class FamilleProduit
    {
    private:
        int Id;
        std::string Libelle;
    public:
        FamilleProduit();
        ~FamilleProduit();
        int getId();
        void setId(int value);
        std::string getLibelle();
        void setLibelle(std::string value);
    };
    
    //gsoap ns service method-action: ajouterByType ""
    
    int ns__ajouterByType ( FamilleProduit familleproduit, bool * result);
    
    //gsoap ns service method-action: ajouterByLibelle ""
    
    int ns__ajouterByLibelle ( std::string libelle, bool * result);
    

    我跑了 oapcpp2.exe -I -pTest Test.h 我将生成的代码与我的项目集成,但问题是编译器总是给我带来错误

    error: undefined reference to `ns__ajouterByType(soap*, FamilleProduit, bool*)
    

    error: undefined reference to `ns__ajouterByLibelle(soap*, std::string, bool*)
    

    即使我在主要部分中添加了这两个函数的实现

    1 回复  |  直到 11 年前
        1
  •  0
  •   Majdi    11 年前

    问题在于我忘了把方法付诸实施

    struct soap* soap
    

    在方法的定义中