Important: Please read the Qt Code of Conduct -

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.

  • Lifetime Qt Champion


    You can start here
    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


    .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