[solved]Can qrencode be build with Qt for android/ios apps ? If so how?



  • Hi,
    I want to generate qr codes in my qt app that is supposed to run both on android and ios.I have found qrencode which is written in pure c but I can't figure out how to build it to work with my qt app on a windows machine. My kit is Android for armeabi-v7a(GCC 4.9 ,Qt 5.4.1) and I am developping this on** a x86 64 bit windows 7 machine**. Is there a way I can generate .a files that I can link against with mingw?.If so how?

    Thanks for your time.


  • Lifetime Qt Champion

    Hi,

    It doesn't look like the build system of qrencode generates any particular code file , so what you can do is include the source code directly in your project so you'll built it directly for each platform.

    Hope it helps



  • Thanks for the reply ,I have done that and have been getting undefined references and thought I had been doing something wrong.Now I am going to look into it again with more confidence :-) .


  • Lifetime Qt Champion

    What error did you got ?



  • It was undefined references on some functions.Adding the files to the project( through the .pro file) and applying minor changes I was able to build it (tested on msvc and mingw).The STATIC keyword as shown here

    '''
    __STATIC void MQRraw_free(MQRRawCode *raw);
    '''

    was causing syntax errors( I don't know what it is meant for ) simply removing it and removing ''inline'' from this statement:
    '''
    static inline int modnn(RS *rs, int x){
    '''

    in the rscode.c the code build successfuly. Should also mention that I was able to generate QR code by referring to this so



  • I have bundled the qrencode library into a Qt project for ease of use. The code is available for anyone interested.


  • Lifetime Qt Champion

    Thanks for sharing but if I may, your repository should not contain object files nor build output. You should also have a direct link to the QRencoder library for it to be easier to find.



  • @SGaist
    Thanks for the input.Taken care of .It is way cleaner now :-)


  • Lifetime Qt Champion

    You're welcome !

    You can also remove the .pro.user file, it's only relevant for your computer setup



  • @musimbate Thanks for sharing code on github ;) it saved me a lot of work.


Log in to reply
 

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