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. Using function from the external library

Using function from the external library

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 729 Views 1 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.
  • hardikgarg19H Offline
    hardikgarg19H Offline
    hardikgarg19
    wrote on last edited by
    #1

    Hello,
    I am using an external C library in Qt project. I have included the lib in the .pro file and header file is also included in the project. Qt is able to auto-detect the function name as well. There are no build errors. But, the app crashes while I try to run the code.

    Below is the compiler output:
    "Starting C:\Qt\Projects\ISG\Legacy\build-Test1-Desktop_Qt_5_11_0_MSVC2015_32bit-Release\release\Test1.exe...
    The program has unexpectedly finished.
    The process was ended forcefully.
    C:/Qt/Projects/ISG/Legacy/build-Test1-Desktop_Qt_5_11_0_MSVC2015_32bit-Release/release/Test1.exe crashed."

    How can I solve this issue?

    1 Reply Last reply
    1
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      if you start it with f5 for debug, does it crash before even reaching main() ?

      1 Reply Last reply
      0
      • hardikgarg19H Offline
        hardikgarg19H Offline
        hardikgarg19
        wrote on last edited by
        #3

        @mrjj Thank you for your reply.
        I can not use the debug mode as I don't have the debug dll for the library.
        I am getting the message as cannot open file "libraryName.lib".

        mrjjM 1 Reply Last reply
        1
        • hardikgarg19H hardikgarg19

          @mrjj Thank you for your reply.
          I can not use the debug mode as I don't have the debug dll for the library.
          I am getting the message as cannot open file "libraryName.lib".

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @hardikgarg19
          Hi
          The reason i ask is that it crashes before main if its due to issues with the DLL.
          in the folder for the library, there is both a LIB and DLL file so its
          a dynamic library ?

          Can you show your .pro file just for check.

          • cannot open file "libraryName.lib".
            In the compiler output or where ?
          hardikgarg19H 1 Reply Last reply
          2
          • mrjjM mrjj

            @hardikgarg19
            Hi
            The reason i ask is that it crashes before main if its due to issues with the DLL.
            in the folder for the library, there is both a LIB and DLL file so its
            a dynamic library ?

            Can you show your .pro file just for check.

            • cannot open file "libraryName.lib".
              In the compiler output or where ?
            hardikgarg19H Offline
            hardikgarg19H Offline
            hardikgarg19
            wrote on last edited by
            #5

            @mrjj Yes, its a dynamic library. The problem is solved now. My dll and lib files were in different folders. Now, I have copied the dll into the lib folder and I am able to run the app.
            Thank you so much for your help @mrjj.

            1 Reply Last reply
            2

            • Login

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