Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Using function from the external library



  • 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?


  • Lifetime Qt Champion

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



  • @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".


  • Lifetime Qt Champion

    @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 ?


  • @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.


Log in to reply