Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Library doesn't open
Forum Updated to NodeBB v4.3 + New Features

Library doesn't open

Scheduled Pinned Locked Moved General and Desktop
36 Posts 7 Posters 5.6k Views 3 Watching
  • 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.
  • Pablo J. RoginaP Pablo J. Rogina

    @manuja I've just created a basic Qt GUI application, I hope you can grab code snippets from Bitbucket (sorry no time for a full Git repository).

    The application just displays a main window, nothing fancy, but by doing that most of the Bitscope functions you posted previously are called from QMainWindow constructor, so that proves Qt was able to build and run the application.

    As @SGaist mentioned please pay attention to what Bitscope version you're using (I mistakenly used x64 version initially, reinstalling i386 made the way with my environment: Win 7, Qt 4.7.4 and MinGW 32 bit)

    manujaM Offline
    manujaM Offline
    manuja
    wrote on last edited by
    #12

    @Pablo-J.-Rogina Thank you very much!!!
    I'll try this. I actually tried the same library functions in a C++ console application on Codeblocks and they worked fine. I'll try with your code. Thanks again :-)

    1 Reply Last reply
    0
    • Pablo J. RoginaP Pablo J. Rogina

      @manuja I've just created a basic Qt GUI application, I hope you can grab code snippets from Bitbucket (sorry no time for a full Git repository).

      The application just displays a main window, nothing fancy, but by doing that most of the Bitscope functions you posted previously are called from QMainWindow constructor, so that proves Qt was able to build and run the application.

      As @SGaist mentioned please pay attention to what Bitscope version you're using (I mistakenly used x64 version initially, reinstalling i386 made the way with my environment: Win 7, Qt 4.7.4 and MinGW 32 bit)

      A Offline
      A Offline
      AlexFi
      wrote on last edited by
      #13

      Hello I have problems to use functions of bitlib.lib.
      I created a project without Qt, a c++ application, in qt-creator 4.9.2 (Community) version and build with the Qt 5.13.0 MinGW 64-bit and qmaxe.exe. It works for the function BL_Initialize() and every function with the return type void. But the others are not working and i get undefined reference to BL_Delay for example. Mabye someone had the same problem and can help me.

      Thanks in advance for a solution

      Alex

      //ConnectBitScope.pro
      TEMPLATE = app
      CONFIG += console c++11
      CONFIG -= app_bundle
      CONFIG -= qt
      
      SOURCES += \
              main.cpp
      HEADERS += \bitlib.h \
          bitlib.h
      
      
      INCLUDEPATH +=C:/BitScope64/Library
      LIBS += -LC:/BitScope64/Library -BitLib
      
      
      
      //main.cpp
      #include <iostream>
      #include <bitlib.h>
      using namespace std;
      
      #define MY_DEVICES 1                            /* open one device only */
      #define MY_PROBE_FILE ""                        /* default probe file if unspecified */
      
      #define MY_DEVICE 0
      #define MY_CHANNEL 0
      #define MY_MODE BL_MODE_FAST
      #define MY_RATE 1000000                         /* capture sample rate */
      #define MY_SIZE 4                               /* number of samples to capture */
      
      int main()
      {
          cout << "Hello World!" << endl;
         void BL_Initialize();
         
         /* optional, default BL_ZERO */
         // BL_Delay(BL_ZERO);                          /* optional, default BL_ZERO */
         // BL_Rate(MY_RATE);                           /* optional, default BL_MAX_RATE */
         // BL_Size(MY_SIZE);                           /* optional, default BL_MAX_SIZE */
         // BL_Select(BL_SELECT_CHANNEL,MY_CHANNEL);    /* choose the channel */
         // BL_Trigger(BL_ZERO,BL_TRIG_RISE);           /* optional when untriggered */
         // BL_Select(BL_SELECT_SOURCE,BL_SOURCE_POD);  /* use the POD input */
         // BL_Range(BL_Count(BL_COUNT_RANGE));         /* maximum range */
        //  BL_Offset(BL_ZERO);                         /* optional, default 0 */
        //  BL_Enable(true);
          return 0;
      }
      
      //bitlib.h
      /* bitlib.h -- BitScope Library Version 2.0 FG12CLBR
       *
       *     http://bitscope.com/software/library/guide/2.0/
       *
       * Copyright (C) 2018 BitScope Designs http://bitscope.com
       *
       * You may use this library software for any purpose, or distribute it
       * or derivative works in any form subject to the terms of the BitScope
       * Library Software Licence V1.1.
       */
      #ifndef _BITLIB_H
      #define _BITLIB_H
      
      #if !defined(__cplusplus) 
      #ifndef _bool_
      #define _bool_
      typedef unsigned int bool;
      #endif
      #ifndef TRUE
      #define TRUE 1
      #endif
      #ifndef FALSE
      #define FALSE 0
      #endif
      #endif
      
      #ifdef __cplusplus
      extern "C" {
      #endif
      
       /* magic values */
      
      #define BL_MAX_RATE 0       /* request the maximum rate */
      #define BL_MAX_TIME 0       /* request the maximum time */
      #define BL_MAX_SIZE 0       /* request the maximum size */
      #define BL_TRACE_FORCED 0   /* trace without (waiting for) trigger */ 
      #define BL_TRACE_FOREVER -1 /* trace without timeout (possibly forever) */
      #define BL_ZERO 0           /* zero volts (ground, reference, etc) */
      #define BL_ASK -1           /* request a prevailing value */
      
       /* select/report tokens */
      
          enum { BL_COUNT_DEVICE, BL_COUNT_ANALOG, BL_COUNT_LOGIC, BL_COUNT_RANGE };
          enum { BL_SELECT_DEVICE, BL_SELECT_CHANNEL, BL_SELECT_SOURCE };
          enum { BL_STATE_IDLE, BL_STATE_ACTIVE, BL_STATE_DONE, BL_STATE_ERROR };
          enum { BL_SOURCE_POD, BL_SOURCE_BNC, BL_SOURCE_X10, BL_SOURCE_X20, BL_SOURCE_X50, BL_SOURCE_ALT, BL_SOURCE_GND };
      	enum { BL_COUPLING_DC, BL_COUPLING_AC, BL_COUPLING_RF };
          enum { BL_MODE_FAST, BL_MODE_DUAL, BL_MODE_MIXED, BL_MODE_LOGIC, BL_MODE_STREAM };
      	enum { BL_TRIG_RISE, BL_TRIG_FALL, BL_TRIG_HIGH, BL_TRIG_LOW, BL_TRIG_NONE };
          enum { BL_VERSION_DEVICE, BL_VERSION_LIBRARY, BL_VERSION_BINDING, BL_VERSION_PLATFORM, BL_VERSION_FRAMEWORK, BL_VERSION_NETWORK };
      	enum { BL_SYNCHRONOUS, BL_ASYNCHRONOUS };
      
       /* Library API | Types */
          
          typedef int      ( BL_Acquire_t )         ( int, double * ); 
          typedef void     ( BL_Close_t )           ( void );
          typedef int      ( BL_Count_t )           ( int );
          typedef int      ( BL_Coupling_t )        ( int );
          typedef double   ( BL_Delay_t )           ( double ); 
          typedef bool     ( BL_Enable_t )          ( bool); 
          typedef int      ( BL_Error_t )           ( void );
          typedef bool     ( BL_Halt_t )            ( void );
          typedef char *   ( BL_ID_t )              ( void );
          typedef bool     ( BL_Index_t )           ( int );
          typedef void     ( BL_Initialize_t )      ( void );
          typedef double   ( BL_Intro_t )           ( double ); 
          typedef char *   ( BL_Log_t )             ( void );
          typedef int      ( BL_Mode_t )            ( int ); 
          typedef char *   ( BL_Name_t )            ( char * );
          typedef double   ( BL_Offset_t )          ( double );
          typedef int      ( BL_Open_t )            ( const char *, int );
          typedef double   ( BL_Range_t )           ( int );
          typedef bool     ( BL_Receive_t )         ( char *, int, int );
          typedef double   ( BL_Rate_t )            ( double );
          typedef int      ( BL_Select_t )          ( int, int );
          typedef void     ( BL_Send_t )            ( char *, int );
          typedef int      ( BL_Size_t )            ( int ); 
          typedef int      ( BL_State_t )           ( void ); 
          typedef double   ( BL_Time_t)             ( double );
          typedef bool     ( BL_Trace_t )           ( double, bool ); 
          typedef bool     ( BL_Trigger_t )         ( double, int );
          typedef char *   ( BL_Version_t )         ( int );
          
       /* Library API | Function Pointers */
          
          BL_Acquire_t BL_Acquire;
          BL_Close_t BL_Close;
          BL_Count_t BL_Count;
          BL_Coupling_t BL_Coupling;
          BL_Delay_t BL_Delay;
          BL_Enable_t BL_Enable;
          BL_Error_t BL_Error;
          BL_Halt_t BL_Halt;
          BL_ID_t BL_ID;
          BL_Initialize_t BL_Initialize;
          BL_Intro_t BL_Intro;
          BL_Log_t BL_Log;
          BL_Mode_t BL_Mode;
          BL_Name_t BL_Name;
          BL_Offset_t BL_Offset;
          BL_Open_t BL_Open;
          BL_Range_t BL_Range;
          BL_Rate_t BL_Rate;
          BL_Receive_t BL_Receive;
          BL_Select_t BL_Select;
          BL_Send_t BL_Send;
          BL_Index_t BL_Index;
          BL_Size_t BL_Size;
          BL_State_t BL_State;
          BL_Time_t BL_Time;
          BL_Trace_t BL_Trace;
          BL_Trigger_t BL_Trigger;
          BL_Version_t BL_Version;
              
      #ifdef __cplusplus
      }
      #endif
      
      #endif /* _BITLIB_H */
      
      
      jsulmJ 1 Reply Last reply
      0
      • A AlexFi

        Hello I have problems to use functions of bitlib.lib.
        I created a project without Qt, a c++ application, in qt-creator 4.9.2 (Community) version and build with the Qt 5.13.0 MinGW 64-bit and qmaxe.exe. It works for the function BL_Initialize() and every function with the return type void. But the others are not working and i get undefined reference to BL_Delay for example. Mabye someone had the same problem and can help me.

        Thanks in advance for a solution

        Alex

        //ConnectBitScope.pro
        TEMPLATE = app
        CONFIG += console c++11
        CONFIG -= app_bundle
        CONFIG -= qt
        
        SOURCES += \
                main.cpp
        HEADERS += \bitlib.h \
            bitlib.h
        
        
        INCLUDEPATH +=C:/BitScope64/Library
        LIBS += -LC:/BitScope64/Library -BitLib
        
        
        
        //main.cpp
        #include <iostream>
        #include <bitlib.h>
        using namespace std;
        
        #define MY_DEVICES 1                            /* open one device only */
        #define MY_PROBE_FILE ""                        /* default probe file if unspecified */
        
        #define MY_DEVICE 0
        #define MY_CHANNEL 0
        #define MY_MODE BL_MODE_FAST
        #define MY_RATE 1000000                         /* capture sample rate */
        #define MY_SIZE 4                               /* number of samples to capture */
        
        int main()
        {
            cout << "Hello World!" << endl;
           void BL_Initialize();
           
           /* optional, default BL_ZERO */
           // BL_Delay(BL_ZERO);                          /* optional, default BL_ZERO */
           // BL_Rate(MY_RATE);                           /* optional, default BL_MAX_RATE */
           // BL_Size(MY_SIZE);                           /* optional, default BL_MAX_SIZE */
           // BL_Select(BL_SELECT_CHANNEL,MY_CHANNEL);    /* choose the channel */
           // BL_Trigger(BL_ZERO,BL_TRIG_RISE);           /* optional when untriggered */
           // BL_Select(BL_SELECT_SOURCE,BL_SOURCE_POD);  /* use the POD input */
           // BL_Range(BL_Count(BL_COUNT_RANGE));         /* maximum range */
          //  BL_Offset(BL_ZERO);                         /* optional, default 0 */
          //  BL_Enable(true);
            return 0;
        }
        
        //bitlib.h
        /* bitlib.h -- BitScope Library Version 2.0 FG12CLBR
         *
         *     http://bitscope.com/software/library/guide/2.0/
         *
         * Copyright (C) 2018 BitScope Designs http://bitscope.com
         *
         * You may use this library software for any purpose, or distribute it
         * or derivative works in any form subject to the terms of the BitScope
         * Library Software Licence V1.1.
         */
        #ifndef _BITLIB_H
        #define _BITLIB_H
        
        #if !defined(__cplusplus) 
        #ifndef _bool_
        #define _bool_
        typedef unsigned int bool;
        #endif
        #ifndef TRUE
        #define TRUE 1
        #endif
        #ifndef FALSE
        #define FALSE 0
        #endif
        #endif
        
        #ifdef __cplusplus
        extern "C" {
        #endif
        
         /* magic values */
        
        #define BL_MAX_RATE 0       /* request the maximum rate */
        #define BL_MAX_TIME 0       /* request the maximum time */
        #define BL_MAX_SIZE 0       /* request the maximum size */
        #define BL_TRACE_FORCED 0   /* trace without (waiting for) trigger */ 
        #define BL_TRACE_FOREVER -1 /* trace without timeout (possibly forever) */
        #define BL_ZERO 0           /* zero volts (ground, reference, etc) */
        #define BL_ASK -1           /* request a prevailing value */
        
         /* select/report tokens */
        
            enum { BL_COUNT_DEVICE, BL_COUNT_ANALOG, BL_COUNT_LOGIC, BL_COUNT_RANGE };
            enum { BL_SELECT_DEVICE, BL_SELECT_CHANNEL, BL_SELECT_SOURCE };
            enum { BL_STATE_IDLE, BL_STATE_ACTIVE, BL_STATE_DONE, BL_STATE_ERROR };
            enum { BL_SOURCE_POD, BL_SOURCE_BNC, BL_SOURCE_X10, BL_SOURCE_X20, BL_SOURCE_X50, BL_SOURCE_ALT, BL_SOURCE_GND };
        	enum { BL_COUPLING_DC, BL_COUPLING_AC, BL_COUPLING_RF };
            enum { BL_MODE_FAST, BL_MODE_DUAL, BL_MODE_MIXED, BL_MODE_LOGIC, BL_MODE_STREAM };
        	enum { BL_TRIG_RISE, BL_TRIG_FALL, BL_TRIG_HIGH, BL_TRIG_LOW, BL_TRIG_NONE };
            enum { BL_VERSION_DEVICE, BL_VERSION_LIBRARY, BL_VERSION_BINDING, BL_VERSION_PLATFORM, BL_VERSION_FRAMEWORK, BL_VERSION_NETWORK };
        	enum { BL_SYNCHRONOUS, BL_ASYNCHRONOUS };
        
         /* Library API | Types */
            
            typedef int      ( BL_Acquire_t )         ( int, double * ); 
            typedef void     ( BL_Close_t )           ( void );
            typedef int      ( BL_Count_t )           ( int );
            typedef int      ( BL_Coupling_t )        ( int );
            typedef double   ( BL_Delay_t )           ( double ); 
            typedef bool     ( BL_Enable_t )          ( bool); 
            typedef int      ( BL_Error_t )           ( void );
            typedef bool     ( BL_Halt_t )            ( void );
            typedef char *   ( BL_ID_t )              ( void );
            typedef bool     ( BL_Index_t )           ( int );
            typedef void     ( BL_Initialize_t )      ( void );
            typedef double   ( BL_Intro_t )           ( double ); 
            typedef char *   ( BL_Log_t )             ( void );
            typedef int      ( BL_Mode_t )            ( int ); 
            typedef char *   ( BL_Name_t )            ( char * );
            typedef double   ( BL_Offset_t )          ( double );
            typedef int      ( BL_Open_t )            ( const char *, int );
            typedef double   ( BL_Range_t )           ( int );
            typedef bool     ( BL_Receive_t )         ( char *, int, int );
            typedef double   ( BL_Rate_t )            ( double );
            typedef int      ( BL_Select_t )          ( int, int );
            typedef void     ( BL_Send_t )            ( char *, int );
            typedef int      ( BL_Size_t )            ( int ); 
            typedef int      ( BL_State_t )           ( void ); 
            typedef double   ( BL_Time_t)             ( double );
            typedef bool     ( BL_Trace_t )           ( double, bool ); 
            typedef bool     ( BL_Trigger_t )         ( double, int );
            typedef char *   ( BL_Version_t )         ( int );
            
         /* Library API | Function Pointers */
            
            BL_Acquire_t BL_Acquire;
            BL_Close_t BL_Close;
            BL_Count_t BL_Count;
            BL_Coupling_t BL_Coupling;
            BL_Delay_t BL_Delay;
            BL_Enable_t BL_Enable;
            BL_Error_t BL_Error;
            BL_Halt_t BL_Halt;
            BL_ID_t BL_ID;
            BL_Initialize_t BL_Initialize;
            BL_Intro_t BL_Intro;
            BL_Log_t BL_Log;
            BL_Mode_t BL_Mode;
            BL_Name_t BL_Name;
            BL_Offset_t BL_Offset;
            BL_Open_t BL_Open;
            BL_Range_t BL_Range;
            BL_Rate_t BL_Rate;
            BL_Receive_t BL_Receive;
            BL_Select_t BL_Select;
            BL_Send_t BL_Send;
            BL_Index_t BL_Index;
            BL_Size_t BL_Size;
            BL_State_t BL_State;
            BL_Time_t BL_Time;
            BL_Trace_t BL_Trace;
            BL_Trigger_t BL_Trigger;
            BL_Version_t BL_Version;
                
        #ifdef __cplusplus
        }
        #endif
        
        #endif /* _BITLIB_H */
        
        
        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #14

        @alexfi Is there only one library file? Sometimes functionality is spread across several library files.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        A 1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #15

          @alexfi said in Library doesn't open:

          -BitLib

          This is wrong

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          A 1 Reply Last reply
          2
          • jsulmJ jsulm

            @alexfi Is there only one library file? Sometimes functionality is spread across several library files.

            A Offline
            A Offline
            AlexFi
            wrote on last edited by
            #16

            @jsulm
            There are two files available. The 64bit version and the 32bit version, I tried both and installed them into the C: programm folder.
            after I get the undefinded reference there error there was the collect2.exe error.

            1 Reply Last reply
            0
            • Christian EhrlicherC Christian Ehrlicher

              @alexfi said in Library doesn't open:

              -BitLib

              This is wrong

              A Offline
              A Offline
              AlexFi
              wrote on last edited by
              #17

              @christian-ehrlicher
              I tried -lBitLib before, but there was the error lBitlib not found. After I changed the to -BitLib it was found. I thought that was linux syntax. Mabe you can help me to get this run.
              I installed the library in the C: folder after that I include this two lines in the pro file. i also added the header file in the project

              INCLUDEPATH +=C:/BitScope64/Library
              
              LIBS += -LC:/BitScope64/Library -lBitLib
              
              

              then i receive cannot find lBitLib

              the structure of the library folder is following:

              ->Library
                 ->Document
                 bitlib.def
                 BitLib.dll
                 bitlib.h
                 BitLib.lib
                 BitLib.pas
              
              -BitLib.dll
              -BitScope.prb
              -BitServe.prb
              
              
              Pablo J. RoginaP aha_1980A 2 Replies Last reply
              0
              • A AlexFi

                @christian-ehrlicher
                I tried -lBitLib before, but there was the error lBitlib not found. After I changed the to -BitLib it was found. I thought that was linux syntax. Mabe you can help me to get this run.
                I installed the library in the C: folder after that I include this two lines in the pro file. i also added the header file in the project

                INCLUDEPATH +=C:/BitScope64/Library
                
                LIBS += -LC:/BitScope64/Library -lBitLib
                
                

                then i receive cannot find lBitLib

                the structure of the library folder is following:

                ->Library
                   ->Document
                   bitlib.def
                   BitLib.dll
                   bitlib.h
                   BitLib.lib
                   BitLib.pas
                
                -BitLib.dll
                -BitScope.prb
                -BitServe.prb
                
                
                Pablo J. RoginaP Offline
                Pablo J. RoginaP Offline
                Pablo J. Rogina
                wrote on last edited by
                #18

                @alexfi spolier alert: not tested! Could it be possible you need this? this is, telling the linker to use a library that doesn't follow the libNAME.so convention

                Upvote the answer(s) that helped you solve the issue
                Use "Topic Tools" button to mark your post as Solved
                Add screenshots via postimage.org
                Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                A 1 Reply Last reply
                0
                • Christian EhrlicherC Offline
                  Christian EhrlicherC Offline
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by
                  #19

                  It's msvc, so according to the docs it must be

                  LIBS += C:/BitScope64/Library/BitLib.lib

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  aha_1980A 1 Reply Last reply
                  2
                  • Pablo J. RoginaP Pablo J. Rogina

                    @alexfi spolier alert: not tested! Could it be possible you need this? this is, telling the linker to use a library that doesn't follow the libNAME.so convention

                    A Offline
                    A Offline
                    AlexFi
                    wrote on last edited by
                    #20

                    @pablo-j-rogina

                    I am not sure how to include this correct in my pro. file do you have an example or some explanations for this?

                    g++ -o build/bin/myapp _mylib.so other_source_files
                    

                    Thank you for your help!!!

                    @Christian-Ehrlicher
                    I tried this also, but I get the undefined reference.

                    Thank you also for your help!!!

                    i also changed the library files from 64bit to 32bit because of that

                    //qmake: qmake.exe ConnectBitScope.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
                    
                    Pablo J. RoginaP 1 Reply Last reply
                    0
                    • A AlexFi

                      @pablo-j-rogina

                      I am not sure how to include this correct in my pro. file do you have an example or some explanations for this?

                      g++ -o build/bin/myapp _mylib.so other_source_files
                      

                      Thank you for your help!!!

                      @Christian-Ehrlicher
                      I tried this also, but I get the undefined reference.

                      Thank you also for your help!!!

                      i also changed the library files from 64bit to 32bit because of that

                      //qmake: qmake.exe ConnectBitScope.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
                      
                      Pablo J. RoginaP Offline
                      Pablo J. RoginaP Offline
                      Pablo J. Rogina
                      wrote on last edited by
                      #21

                      @alexfi said in Library doesn't open:

                      do you have an example or some explanations for this?

                      have you checked the answers to that post? (hint: see #1...)

                      Upvote the answer(s) that helped you solve the issue
                      Use "Topic Tools" button to mark your post as Solved
                      Add screenshots via postimage.org
                      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                      1 Reply Last reply
                      0
                      • A AlexFi

                        @christian-ehrlicher
                        I tried -lBitLib before, but there was the error lBitlib not found. After I changed the to -BitLib it was found. I thought that was linux syntax. Mabe you can help me to get this run.
                        I installed the library in the C: folder after that I include this two lines in the pro file. i also added the header file in the project

                        INCLUDEPATH +=C:/BitScope64/Library
                        
                        LIBS += -LC:/BitScope64/Library -lBitLib
                        
                        

                        then i receive cannot find lBitLib

                        the structure of the library folder is following:

                        ->Library
                           ->Document
                           bitlib.def
                           BitLib.dll
                           bitlib.h
                           BitLib.lib
                           BitLib.pas
                        
                        -BitLib.dll
                        -BitScope.prb
                        -BitServe.prb
                        
                        
                        aha_1980A Offline
                        aha_1980A Offline
                        aha_1980
                        Lifetime Qt Champion
                        wrote on last edited by
                        #22

                        @alexfi said in Library doesn't open:

                        LIBS += -LC:/BitScope64/Library -lBitLib

                        I have done that several times and it used to work with MinGW and MSVC too. Can you show the linker command line from Compile Output?

                        Which MSVC version do you use?

                        The reason to prefer the -L/path/to/lib -llibname syntax is that Creator recognizes this and adds /path/to/lib to your Run Environment so your program finds the DLL automatically.

                        Qt has to stay free or it will die.

                        1 Reply Last reply
                        0
                        • Christian EhrlicherC Christian Ehrlicher

                          It's msvc, so according to the docs it must be

                          LIBS += C:/BitScope64/Library/BitLib.lib

                          aha_1980A Offline
                          aha_1980A Offline
                          aha_1980
                          Lifetime Qt Champion
                          wrote on last edited by
                          #23

                          @christian-ehrlicher I used that syntax before, but even MSVC can be feed with the Linux syntax (I guess qmake maps that), and that has advantages in Creator, see my last post.

                          Qt has to stay free or it will die.

                          A 1 Reply Last reply
                          0
                          • aha_1980A aha_1980

                            @christian-ehrlicher I used that syntax before, but even MSVC can be feed with the Linux syntax (I guess qmake maps that), and that has advantages in Creator, see my last post.

                            A Offline
                            A Offline
                            AlexFi
                            wrote on last edited by
                            #24

                            @aha_1980
                            I think this is the Compile Output you need:

                            
                            g++ -Wl,-subsystem,console -mthreads -o debug\ConnectBitScope.exe debug/main.o  -LC:\BitScope32\Library\BitLib.lib   
                            debug/main.o: In function `main':
                            C:\Users\adm-eep\Documents\ConnectBitScope\build-ConnectBitScope-Desktop_Qt_5_13_0_MinGW_64_bit-Debug/../ConnectBitScope/main.cpp:23: undefined reference to `BL_Open'
                            collect2.exe: error: ld returned 1 exit status
                            mingw32-make[1]: *** [Makefile.Debug:66: debug/ConnectBitScope.exe] Error 1
                            mingw32-make: *** [Makefile:38: debug] Error 2
                            mingw32-make[1]: Leaving directory 'C:/Users/adm-eep/Documents/ConnectBitScope/build-ConnectBitScope-Desktop_Qt_5_13_0_MinGW_64_bit-Debug'
                            

                            I use the MSVC 11.0

                            @Pablo-J-Rogina

                            I saw the example but i think this is for librarys with the ending .so I am no sure how to use this in my case

                            aha_1980A Pablo J. RoginaP 2 Replies Last reply
                            0
                            • A AlexFi

                              @aha_1980
                              I think this is the Compile Output you need:

                              
                              g++ -Wl,-subsystem,console -mthreads -o debug\ConnectBitScope.exe debug/main.o  -LC:\BitScope32\Library\BitLib.lib   
                              debug/main.o: In function `main':
                              C:\Users\adm-eep\Documents\ConnectBitScope\build-ConnectBitScope-Desktop_Qt_5_13_0_MinGW_64_bit-Debug/../ConnectBitScope/main.cpp:23: undefined reference to `BL_Open'
                              collect2.exe: error: ld returned 1 exit status
                              mingw32-make[1]: *** [Makefile.Debug:66: debug/ConnectBitScope.exe] Error 1
                              mingw32-make: *** [Makefile:38: debug] Error 2
                              mingw32-make[1]: Leaving directory 'C:/Users/adm-eep/Documents/ConnectBitScope/build-ConnectBitScope-Desktop_Qt_5_13_0_MinGW_64_bit-Debug'
                              

                              I use the MSVC 11.0

                              @Pablo-J-Rogina

                              I saw the example but i think this is for librarys with the ending .so I am no sure how to use this in my case

                              aha_1980A Offline
                              aha_1980A Offline
                              aha_1980
                              Lifetime Qt Champion
                              wrote on last edited by
                              #25

                              @alexfi said in Library doesn't open:

                              I use the MSVC 11.0

                              In that case, something is really weird set up - no wonder that it doesn't work.

                              Your compile output clearly shows the MinGW linker running.

                              Can you please show the screenshots of Tools > Options > Kits for Kits, Qt versions and compilers?

                              Regards

                              Qt has to stay free or it will die.

                              A 1 Reply Last reply
                              2
                              • A AlexFi

                                @aha_1980
                                I think this is the Compile Output you need:

                                
                                g++ -Wl,-subsystem,console -mthreads -o debug\ConnectBitScope.exe debug/main.o  -LC:\BitScope32\Library\BitLib.lib   
                                debug/main.o: In function `main':
                                C:\Users\adm-eep\Documents\ConnectBitScope\build-ConnectBitScope-Desktop_Qt_5_13_0_MinGW_64_bit-Debug/../ConnectBitScope/main.cpp:23: undefined reference to `BL_Open'
                                collect2.exe: error: ld returned 1 exit status
                                mingw32-make[1]: *** [Makefile.Debug:66: debug/ConnectBitScope.exe] Error 1
                                mingw32-make: *** [Makefile:38: debug] Error 2
                                mingw32-make[1]: Leaving directory 'C:/Users/adm-eep/Documents/ConnectBitScope/build-ConnectBitScope-Desktop_Qt_5_13_0_MinGW_64_bit-Debug'
                                

                                I use the MSVC 11.0

                                @Pablo-J-Rogina

                                I saw the example but i think this is for librarys with the ending .so I am no sure how to use this in my case

                                Pablo J. RoginaP Offline
                                Pablo J. RoginaP Offline
                                Pablo J. Rogina
                                wrote on last edited by
                                #26

                                @alexfi said in Library doesn't open:

                                librarys with the ending .so

                                you may want to try with .lib in your case

                                Upvote the answer(s) that helped you solve the issue
                                Use "Topic Tools" button to mark your post as Solved
                                Add screenshots via postimage.org
                                Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                                1 Reply Last reply
                                0
                                • aha_1980A aha_1980

                                  @alexfi said in Library doesn't open:

                                  I use the MSVC 11.0

                                  In that case, something is really weird set up - no wonder that it doesn't work.

                                  Your compile output clearly shows the MinGW linker running.

                                  Can you please show the screenshots of Tools > Options > Kits for Kits, Qt versions and compilers?

                                  Regards

                                  A Offline
                                  A Offline
                                  AlexFi
                                  wrote on last edited by
                                  #27

                                  @aha_1980 4_1568639741565_QT_version.JPG 3_1568639741565_Qbs.JPG 2_1568639741565_Kit.JPG 1_1568639741564_debugger.JPG 0_1568639741564_compiler.JPG

                                  @Pablo-J-Rogina
                                  I tried it like this :

                                  g++ -o$$PWD/ $$PWD/BitLib.lib
                                  
                                  but i get the "extra characters after test expression" error
                                  
                                  
                                  1 Reply Last reply
                                  1
                                  • Christian EhrlicherC Offline
                                    Christian EhrlicherC Offline
                                    Christian Ehrlicher
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #28

                                    @manuja said in Library doesn't open:

                                    LNK1104

                                    This shows that you used the msvc linker before

                                    BitLib.lib

                                    This shows that the library was build with msvc
                                    So if bitlib is a plain C library you can create a proper import lib with reimp & co (google is your friend) or you can try to link directly against the dll -> -lC:/BitScope64/Library/BitLib.dll - it should work with a recent MinGW version iirc.
                                    If it's a c++ library than you have to recompile it with g++ to get a proper import lib (BitLib.a)

                                    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                                    Visit the Qt Academy at https://academy.qt.io/catalog

                                    A 1 Reply Last reply
                                    1
                                    • Christian EhrlicherC Christian Ehrlicher

                                      @manuja said in Library doesn't open:

                                      LNK1104

                                      This shows that you used the msvc linker before

                                      BitLib.lib

                                      This shows that the library was build with msvc
                                      So if bitlib is a plain C library you can create a proper import lib with reimp & co (google is your friend) or you can try to link directly against the dll -> -lC:/BitScope64/Library/BitLib.dll - it should work with a recent MinGW version iirc.
                                      If it's a c++ library than you have to recompile it with g++ to get a proper import lib (BitLib.a)

                                      A Offline
                                      A Offline
                                      AlexFi
                                      wrote on last edited by
                                      #29

                                      @christian-ehrlicher
                                      okay, if i under stand you right i have to reimport the lib, because it is written in c BitScope Librarys and this Bitscope example in C .

                                      I tried this:

                                      LIBS += -lC:/BitScope64/Library/BitLib.dll - it 
                                      
                                      

                                      the direct link doesn't work if I use it like this because of the ending "- it".

                                      is the reimport something i do in my actual project or is external work?

                                      1 Reply Last reply
                                      0
                                      • Christian EhrlicherC Offline
                                        Christian EhrlicherC Offline
                                        Christian Ehrlicher
                                        Lifetime Qt Champion
                                        wrote on last edited by
                                        #30

                                        @alexfi said in Library doesn't open:

                                        because of the ending "- it".

                                        Where does this come from? Your library is named BitLib.dll ...

                                        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                                        Visit the Qt Academy at https://academy.qt.io/catalog

                                        A 1 Reply Last reply
                                        0
                                        • Christian EhrlicherC Christian Ehrlicher

                                          @alexfi said in Library doesn't open:

                                          because of the ending "- it".

                                          Where does this come from? Your library is named BitLib.dll ...

                                          A Offline
                                          A Offline
                                          AlexFi
                                          wrote on last edited by
                                          #31

                                          @christian-ehrlicher sorry my fault. I just didn't read the following sentence after your recommendation, but i also tried it without and it gave me back undefined reference. Now i try to find out how to reimport the lib.

                                          jsulmJ 1 Reply Last reply
                                          0

                                          • Login

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