Can I include a C library in a Qt Android application?



  • Basically, I want to include some C or C++ libraries into my Qt project, and then build for both Windows and Android. Without the library I'm currently able to build with no problems.


  • Qt Champions 2016

    @SaundersB

    Hi
    You can start here
    http://doc.qt.io/qtcreator/creator-project-qmake-libraries.html
    http://doc.qt.io/qt-5/third-party-libraries.html
    This is for adding it to your main app.

    Also read the "build me" information for the lib. You must be able to build it yourself to be able to cross compile it
    for both and/win. So this step comes first.

    Not sure it answers what you ask. Its very open.



  • More Information

    I'm attempting to develop a cross-platform application for both Window x86 desktop, and an Android application. I have successfully integrated the .lib file into Windows desktop application with Qt Creator. I have some .so library files, but I believe those files are Java library files.

    End Goals

    I'd either like to compile a Linux version of libraries for use in C++ with Qt Creator, or include the .so files for use with Java. The only thing that troubles me with the latter is being able to switch between libraries in the same code base. Plus, I'm not sure how to include Java code in a Qt project for Android.

    Primarily, keeping everything in C++ for both Windows and Android is preferred.

    Would I need to build the library in Qt Creator? Or is that for convenience?


  • Lifetime Qt Champion

    Hi,

    .so files are dynamic libraries on Linux not Java libraries. You can link to your libraries following the same links provided by @mrjj.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.