Undefined references to QtSQL – Raspberry Pi

Sysprogs forums Forums VisualGDB Undefined references to QtSQL – Raspberry Pi

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #9445
    DYN
    Participant

    Hello,

    I am having trouble using the SQL module of the qt framework and keep getting undefined reference errors in my code.

    I have installed MySQL on the Pi using: sudo apt-get install libmysqlclient-dev mysql-client

    Then proceeded to synchronise the sysroot directory in the VisualGDB properties.
    Then I included the library name in the VisualGDB project properties, there isn’t a libmysql.a in my sysroot folders, only libmysqld.a and libmysqlclient.a.
    I placed mysqlclient in “Library names” field, without the lib prefix and .a extension and  =/usr/local/include =/usr/include/mysql in “library directories” but not sure if this is necessary.
    LDFLAGS is empty as I’m not sure what they do.

    I have checked these links for info but nothing seems to work for me.
    http://stackoverflow.com/questions/35645146/undefined-reference-to-mysql-while-using-cross-compiler-and-visualgdb?answertab=active#tab-top
    https://sysprogs.com/w/forums/topic/include-mysqlmysql-h-errorundefined-reference-to/

    Not sure what else to try,  I’m sure this can be easily resolved but kinda running out of ideas. I’m quite new to VisualGDB and cross-compilation in general.
    What am I missing ?
    Thanks in advance.

    • This topic was modified 8 years ago by DYN.
    • This topic was modified 8 years ago by DYN.
    #9449
    DYN
    Participant

    I feel dumb. Just needed to include Qt5Sql in the Library names field.

    #9452
    support
    Keymaster

    Hi,

    No problem. Library names can sometimes be confusing. Generally searching for *.so and *.a files containing the missing function name usually finds the correct one quickly.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.