Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2016

undefined symbol when importing binded C++ class

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Not Evaluated
    • None
    • 5.15.4
    • Shiboken
    • None
    • manylinux_2_28 docker
    • Linux/X11

    Description

      I have a class defined like that:

      class BINDINGS_API Doc
      {
          friend class DocPrivate;
          public:
              Doc();
              Doc(std::shared_ptr<Lima::AnalysisContent> analysis); 
              virtual ~Doc();
              Doc(const Doc& a);
              Doc& operator=(const Doc& a);
              // virtual Doc* clone();
              Token& operator[](int i);
              int len();
              std::string text();
              // std::vector<Token> span(int i, int j);
          private:
              DocPrivate* m_d;
      };
      

      Its binding is defined like that:

      <value-type name="Doc">
      </value-type>
      

      When importing the resulting python module, I get

      ImportError: /home/gael/.virtualenvs/lima/lib/python3.8/site-packages/aymaralima/lima.so: undefined symbol: _Z8init_DocP7_object 

       

      Which demangles to init_Doc(_object*).

       

      Note that the constructor Doc(std::shared_ptr<Lima::AnalysisContent> analysis);  is not imported as the Lima* things are not defined in the binding. This is intended.

      Attachments

        Activity

          People

            kleint Friedemann Kleint
            kleag Gael de Chalendar
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: