Linking Custom Libraries on Windows 7



  • Hello,
    I am working on a project that requires multiple modules to be implemented as libraries. I am using the Microsoft Visual toolkit.

    My library builds without errors, and I would like to statically link this library with my GUI project. I've added these lines to my GUI's .pro file:
    @INCLUDEPATH += $$PWD/../CttLibrary
    DEPENDPATH += $$PWD/../CttLibrary

    win32: LIBS += -L$$PWD/../CttLibrary-build-desktop-Qt_4_8_2_in_PATH__4_8_2__Debug/debug/ -lCttLibrary

    win32: PRE_TARGETDEPS += $$PWD/../CttLibrary-build-desktop-Qt_4_8_2_in_PATH__4_8_2__Debug/debug/CttLibrary.lib
    INCLUDEPATH += $$PWD/../CttLibrary-build-desktop-Qt_4_8_2_in_PATH__4_8_2__Debug/debug
    DEPENDPATH += $$PWD/../CttLibrary-build-desktop-Qt_4_8_2_in_PATH__4_8_2__Debug/debug@

    This lets me build the GUI project without problems, but when I try to run the program, I get this from the debugger:
    @ ModLoad: 0000000064790000 00000000647a5000 C:\Users\jwomble\Documents\JHUAPL\CttLibrary-build-desktop-Qt_4_8_2_in_PATH__4_8_2__Debug\debug\CttLibrary.dll
    sProcess exited (3221225781)
    eProcess crashed@

    The path to CttLibrary.dll is correct (but why is it trying to load the DLL if I'm statically linking?), and I've tried to copy the library into the executable's directory. What's going on?


Log in to reply
 

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