Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    General and Desktop
    qrenode
    3
    10
    3041
    Loading More Posts
    • 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.
    • musimbate
      musimbate last edited by musimbate

      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.

      Why join the navy if you can be a pirate?-Steve Jobs

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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

        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 Reply Quote 0
        • musimbate
          musimbate last edited by

          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 :-) .

          Why join the navy if you can be a pirate?-Steve Jobs

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            What error did you got ?

            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 Reply Quote 0
            • musimbate
              musimbate last edited by musimbate

              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

              Why join the navy if you can be a pirate?-Steve Jobs

              1 Reply Last reply Reply Quote 0
              • musimbate
                musimbate last edited by

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

                Why join the navy if you can be a pirate?-Steve Jobs

                1 Reply Last reply Reply Quote 1
                • SGaist
                  SGaist Lifetime Qt Champion last edited by

                  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.

                  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 Reply Quote 1
                  • musimbate
                    musimbate last edited by

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

                    Why join the navy if you can be a pirate?-Steve Jobs

                    F 1 Reply Last reply Reply Quote 1
                    • SGaist
                      SGaist Lifetime Qt Champion last edited by

                      You're welcome !

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

                      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 Reply Quote 0
                      • F
                        FrankiPL @musimbate last edited by

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

                        1 Reply Last reply Reply Quote 1
                        • First post
                          Last post