Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Include CR95HF dll in Qt Quick
QtWS25 Last Chance

Include CR95HF dll in Qt Quick

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
dlllibraryusb
11 Posts 2 Posters 4.2k Views
  • 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.
  • S Offline
    S Offline
    Salydan
    wrote on 24 Apr 2017, 07:17 last edited by
    #1

    Hi everybody,

    I would like to connect a CR95HF reader in USB on my computer and use it with a Qt Quick application (A CR95HF reader is a NFC reader and it will allow me to write and read in a EEPROM in NFC). For that I have 3 files: CR95HF.dll, CR95HF.h and CR95HF.lib.
    I tried to add the .dll on my .pro and include the .h in my "main.cpp". All the files are on my project's folder.
    In my .pro I have:

    LIBS += -L"CR95HF.dll"
    

    and in my .h:

    #include "CR95HFDLL.h"
    

    but when I try to use a function I have these messages

    undefined reference to 'function_name()@0'
    error: ld returned 1 exit status
    

    Could you help me to solve this probleme ?

    Thank you for your help
    Have a good day

    Simon

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 24 Apr 2017, 08:44 last edited by
      #2

      Hi,

      -L is to give additional paths to the linker to search in for libraries.

      Also, you don't like against .dll files, these are share libraries. On Windows you link against .lib files if using a VS compiler.

      You should rather have something like LIBS += -L$$PWD -lCR95HF in your .pro file.

      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
      1
      • S Offline
        S Offline
        Salydan
        wrote on 24 Apr 2017, 08:58 last edited by
        #3

        Thank you for your quick response.
        Few minutes ago I tried with the import library tool in Qt.
        I also create a DLL folder and put all the files inside. So now I have

        win32:CONFIG(release, debug|release): LIBS += -L$$PWD/DLL/ -lCR95HF
        else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/DLL/ -lCR95HF
        else:unix: LIBS += -L$$PWD/DLL/ -lCR95HF
        

        It's close to your solution but the problem still the same...

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 24 Apr 2017, 09:08 last edited by
          #4

          What compiler are you using ?
          What is the architecture of your application ? 32 or 64 bit ?

          Same questions for your CR95HF library..

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          S 1 Reply Last reply 24 Apr 2017, 09:12
          0
          • S SGaist
            24 Apr 2017, 09:08

            What compiler are you using ?
            What is the architecture of your application ? 32 or 64 bit ?

            Same questions for your CR95HF library..

            S Offline
            S Offline
            Salydan
            wrote on 24 Apr 2017, 09:12 last edited by
            #5

            @SGaist My compiler is the Qt 5.8.0 MinGW 32 bit.
            The architecture is 32 bit also.
            My library is coming from STmicroelectronics so I have no idea of the used tool to compile and create it...

            1 Reply Last reply
            0
            • S Offline
              S Offline
              Salydan
              wrote on 24 Apr 2017, 12:12 last edited by
              #6

              @SGaist In your opinion the problem is caming from the compiler ?

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 24 Apr 2017, 21:35 last edited by
                #7

                Yes, on Windows you can't mix and match C++ libraries built with different compilers. The only current exception is VS2017 which is compatible with VS2015.

                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
                1
                • S Offline
                  S Offline
                  Salydan
                  wrote on 25 Apr 2017, 06:36 last edited by
                  #8

                  So I have to install the correct compiler on my computer and compile my Qt project with the good one ?

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 25 Apr 2017, 09:55 last edited by
                    #9

                    If it's indeed a C++ library, then yes, you have to get the matching version of Visual Studio because the documentation only mentions VS for development however not which version. You should try asking ST for more details.

                    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
                    1
                    • S Offline
                      S Offline
                      Salydan
                      wrote on 25 Apr 2017, 12:50 last edited by
                      #10

                      Thank you for your help, thanks to your help I solved my problem. In first I have completely uninstall Qt and install again with the MSCV2013 compiler. After that I installed Visual studio community 2013 and that solve my problem.

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 25 Apr 2017, 15:18 last edited by
                        #11

                        You're welcome !

                        Since you have it working now, please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)

                        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
                        0

                        5/11

                        24 Apr 2017, 09:12

                        • Login

                        • Login or register to search.
                        5 out of 11
                        • First post
                          5/11
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved