Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [Solved]Compilation error while using libSBML in project

[Solved]Compilation error while using libSBML in project

Scheduled Pinned Locked Moved Installation and Deployment
3 Posts 2 Posters 927 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Klayman
    wrote on last edited by
    #1

    Hello everyone!

    I have build libSBML statically , so there are three files in my lib folder: libsbml.a, libsbml.dll.a and libsbml.la

    My .pro file:

    @INCLUDEPATH += C:/libsbml-5.10.2/libsbml/include
    LIBPATH += C:/libsbml-5.10.2/libsbml/lib
    LIBS += -lsbml@

    When I'm trying to run this code:

    @SBMLDocument* document = readSBML(argv[1]);

    unsigned int errors = document->getNumErrors();
    cout << endl;
    cout << " filename: " << argv[1] << endl;
    cout << " error(s): " << errors << endl;
    cout << endl;
    if (errors > 0) document->printErrors(cerr);@

    so get some errors, like this:

    ./debug\main.o: In function Z5qMainiPPc': C:\Users\Klayman\Desktop\build-3dCube-Desktop_Qt_5_3_MinGW_32bit-Debug/../3dCube/main.cpp:62: undefined reference to readSBML'
    C:\Users\Klayman\Desktop\build-3dCube-Desktop_Qt_5_3_MinGW_32bit-Debug/../3dCube/main.cpp:64: undefined reference to SBMLDocument::getNumErrors() const' C:\Users\Klayman\Desktop\build-3dCube-Desktop_Qt_5_3_MinGW_32bit-Debug/../3dCube/main.cpp:69: undefined reference to SBMLDocument::printErrors(std::ostream&) const'
    collect2.exe: error: ld returned 1 exit status

    Please let me know if any idea.
    Thanks.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Sounds like the library is not found, it should rather be

      @
      LIBS += -LC:/libsbml-5.10.2/libsbml/lib
      LIBS += -lsbml
      @

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • K Offline
        K Offline
        Klayman
        wrote on last edited by
        #3

        Thank you! I found that I built library in wrong way...

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved