External Lib works in release mode but doesn't work in debug mode



  • Good Morning,

    I included an external lib in a Qt-GUI-Program. I am able to use the functions in release mode, but if I choose debug mode, then my program crashes with the following message:

    ntdll!RtlpWaitforCriticalSection
    Name ot the signal: SIGSEGV
    Meaning: Segmentation fault

    I tested the lib in Eclipse wich worked fine. Afterwards I created a Qt-Console-Program, where release- AND debug-mode worked fine. So, I think it is something with the GUI-Project debug mode.

    Can anyone help me?



  • Hi Jason198224,
    Welcome to DevNet.
    First thing that comes to my mind try Clean All->Run qmake->Rebuild All



  • Hi qxoz,

    thanks for the fast answer. I tried Clean All and Rebuild All before with no effect...

    The Lib is included in the .pro file as follows:

    @win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Include/ -lmylib
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Include/ -lmylib
    else:symbian: LIBS += -lmylib
    else:unix: LIBS += -L$$PWD/Include/ -lmylib@

    The lib, dll and its header is stored in the include path:

    @INCLUDEPATH += $$PWD/Include
    DEPENDPATH += $$PWD/Include@

    I also put the dll and lib into debug and release path.

    Greetings,
    Jason



  • Do you have a different versions of mylib for debug and release modes?
    but you link bouth time to same lib. You should link debug mylib for debug mode.
    And one more thing, Clean All and Rebuild All gives no effect without Run qmake step ).



  • I have got one mylib.lib but two different mylib.dll files (debug and release). I tried both, but debugging didn't work...
    Thanks for the hint with run qmake, but i tried this too and nothing changed.
    What is confusing here for me, is that the lib/dll works fine with qt console applications in debug and release mode, but qt gui application makes problems.



  • It is strange that lib/dll works with console. Every dll should have its own lib.
    Can you show your lib's *.pro file?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.