Results 1 to 12 of 12

Thread: don’t use but need to run application?

  1. #1
    Join Date
    Nov 2010
    Posts
    31
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default don’t use but need to run application?

    I write my qt application don’t use qtwebkit, qtsql, qtxml, qtnetwork, I build successful but when create standard alone application and run then have error : unable to locate component qtsql4.dll not found. When I add qtsql4.dll then have error unable to locate component
    qtxml4.dll not found,…. final, I add all 4 dll follow: qtwebkit4.dll, qtsql4.dll, qtxml4.dll, qtnetwork4.dll then application run successful.Why in my code don’t use these libraries but when run still need them?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: don’t use but need to run application?

    Maybe you enabled all those libraries in your project file? What does it look like?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Nov 2010
    Posts
    31
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: don’t use but need to run application?

    my cmakelists.txt as follow:

    CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

    PROJECT(GN500)
    SET(VERSION 1.0.0)

    INCLUDE(InstallRequiredSystemLibraries)

    SET(VERSION_MAJOR 1)
    SET(VERSION_MINOR 0)
    SET(VERSION_PATCH 0)

    FIND_PACKAGE(Qt4 REQUIRED)
    INCLUDE(${QT_USE_FILE})

    #SET(QT_USE_QTSQL false)
    #SET(QT_USE_QTWEBKIT false)
    #SET(QT_USE_QTXML false)
    #SET(QT_USE_QTNETWORK false)

    FILE(GLOB ${PROJECT_NAME}_HDRS *.h)
    FILE(GLOB ${PROJECT_NAME}_MOC_SRCS *.h)
    FILE(GLOB ${PROJECT_NAME}_SRCS *.cpp)
    FILE(GLOB ${PROJECT_NAME}_RCCS *.qrc)

    QT4_WRAP_CPP(${PROJECT_NAME}_MOCS ${${PROJECT_NAME}_MOC_SRCS})
    QT4_ADD_RESOURCES(${PROJECT_NAME}_RCC_SRCS ${${PROJECT_NAME}_RCCS})

    source_group("Resource Files" FILES ${${PROJECT_NAME}_RCCS})
    source_group("Generated Files" FILES ${${PROJECT_NAME}_MOCS} ${${PROJECT_NAME}_RCC_SRCS})

    IF (WIN32)
    IF (MSVC)
    SET (${PROJECT_NAME}_SRCS ${${PROJECT_NAME}_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/appico.rc)
    ELSE(MSVC)
    IF (NOT WINDRES)
    FIND_PROGRAM(WINDRES windres)
    IF (NOT WINDRES)
    MESSAGE(FATAL_ERROR "windres not found - aborting")
    ENDIF (NOT WINDRES)
    ENDIF (NOT WINDRES)
    ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/icon.o
    COMMAND ${WINDRES} -I${CMAKE_CURRENT_SOURCE_DIR} -i${CMAKE_CURRENT_SOURCE_DIR}/appico.rc
    -o ${CMAKE_CURRENT_BINARY_DIR}/icon.o )
    SET(${PROJECT_NAME}_SRCS ${${PROJECT_NAME}_SRCS ${CMAKE_CURRENT_BINARY_DIR}/icon.o)
    ENDIF (MSVC)
    ENDIF (WIN32)

    IF (WIN32)
    SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
    ENDIF (WIN32)

    add_definitions("-Ddisplay_export=__declspec(dllimport)")
    #link_libraries(${CMAKE_SOURCE_DIR}/display/build2008)
    #find_library(lib NAMES display ${CMAKE_SOURCE_DIR}/display/build2008)
    #include_directories(${CMAKE_SOURCE_DIR}/display)

    INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/display)
    ADD_SUBDIRECTORY(${PROJECT_SOURCE_DIR}/display)


    ADD_EXECUTABLE(${PROJECT_NAME} ${${PROJECT_NAME}_SRCS} ${${PROJECT_NAME}_HDRS} ${${PROJECT_NAME}_MOCS} ${${PROJECT_NAME}_RCC_SRCS})
    #SET(EXTRA_LIBS ${EXTRA_LIBS} display)

    TARGET_LINK_LIBRARIES(${PROJECT_NAME}
    ${QT_QTMAIN_LIBRARY}
    ${QT_QTCORE_LIBRARY}
    ${QT_QTGUI_LIBRARY}
    ${QT_QT3SUPPORT_LIBRARY}
    ${QT_QTSVG_LIBRARY}
    display
    )

    SET(CPACK_PACKAGE_NAME "GN500")
    SET(CPACK_PACKAGE_VENDOR "tt80 Software")
    SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Phan mem mo phong khi tai GN500")
    SET(CPACK_PACKAGE_CONTACT "Phong Tin Hoc - Trung tam 80")

    SET(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
    SET(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
    SET(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
    SET(CPACK_GENERATOR NSIS)

    set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
    "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}
    CreateDirectory '\\\$SMPROGRAMS\\\\${PROJECT_NAME}\\\"'
    CreateShortCut \\\$SMPROGRAMS\\\\${PROJECT_NAME}\\\\${PROJECT_NAM E}.lnk\\\ \\\$INSTDIR\\\\bin\\\\${PROJECT_NAME}.exe\\\"
    CreateShortCut \\\$SMPROGRAMS\\\\${PROJECT_NAME}\\\\Uninstall.lnk \\\ \\\$INSTDIR\\\\Uninstall.exe\\\"
    CreateShortCut \\\$DESKTOP\\\\${PROJECT_NAME}.lnk\\\ \\\$INSTDIR\\\\bin\\\\${PROJECT_NAME}.exe\\\"
    ")

    message(${CPACK_NSIS_EXTRA_INSTALL_COMMANDS})

    set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
    "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}
    Delete '\\\$SMPROGRAMS\\\\${PROJECT_NAME}\\\\${PROJECT_NA ME}.lnk\\\"'
    Delete \\\$SMPROGRAMS\\\\${PROJECT_NAME}\\\\Uninstall.lnk \\\"
    RmDir \\\$SMPROGRAMS\\\\${PROJECT_NAME}\\\"
    Delete \\\$DESKTOP\\\\${PROJECT_NAME}.lnk\\\"
    ")

    message(${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS})


    INSTALL(TARGETS GN500 DESTINATION bin)
    INSTALL(FILES ${QT_BINARY_DIR}/QtCore4.dll DESTINATION bin)
    INSTALL(FILES ${QT_BINARY_DIR}/QtGui4.dll DESTINATION bin)
    INSTALL(FILES ${QT_BINARY_DIR}/QtSvg4.dll DESTINATION bin)
    INSTALL(FILES ${QT_BINARY_DIR}/Qt3Support4.dll DESTINATION bin)
    INSTALL(FILES ${QT_BINARY_DIR}/QtSql4.dll DESTINATION bin)
    INSTALL(FILES ${QT_BINARY_DIR}/QtXml4.dll DESTINATION bin)
    INSTALL(FILES ${QT_BINARY_DIR}/QtNetwork4.dll DESTINATION bin)
    INSTALL(FILES ${QT_BINARY_DIR}/QtWebKit4.dll DESTINATION bin)
    INSTALL(FILES ${PROJECT_SOURCE_DIR}/appico.ico DESTINATION bin)
    INSTALL(FILES ${PROJECT_SOURCE_DIR}/GN500.chm DESTINATION bin)
    INSTALL(FILES ${PROJECT_SOURCE_DIR}/hh.exe DESTINATION bin)

    INCLUDE(CPack)

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: don’t use but need to run application?

    And if you uncomment these?

    #SET(QT_USE_QTSQL false)
    #SET(QT_USE_QTWEBKIT false)
    #SET(QT_USE_QTXML false)
    #SET(QT_USE_QTNETWORK false)
    and comment related entries in the INSTALL section?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Nov 2010
    Posts
    31
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: don’t use but need to run application?

    I will receive error: unable to locate component qxml4.dll not found, for example. I also don't understand this!

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: don’t use but need to run application?

    What does your project file look like now?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Nov 2010
    Posts
    31
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: don’t use but need to run application?

    I forgot, I use 1 library is display with cmakelists.txt as follow:

    cmake_minimum_required(VERSION 2.8)
    project(display)
    find_package(Qt4 REQUIRED)
    include(${QT_USE_FILE})
    set(QT_USE_QTCORE true)
    set(QT_USE_QTGUI true)

    FILE(GLOB display_HDRS *.h)
    FILE(GLOB display_MOC_SRCS *.h)
    FILE(GLOB display_SRCS *.cpp)
    SET(display_RCCS QDisplay.qrc)

    QT4_WRAP_CPP(display_MOCS ${display_MOC_SRCS})
    QT4_ADD_RESOURCES(display_RCC_SRCS ${display_RCCS})

    source_group("Generated Files" FILES ${display_MOCS} ${display_RCC_SRCS})
    source_group("Resource Files" FILES ${display_RCCS})

    #add_definitions("-DQCORE_EXPORT=__declspec(dllimport)")
    add_definitions("-Ddisplay_export=__declspec(dllexport)")

    link_directories(C:/Qt/4.8.0/lib)

    #set(CMAKE_DEBUG_POSTFIX d)

    add_library(display
    ${display_SRCS}
    ${display_HDRS}
    ${display_MOCS}
    ${display_RCC_SRCS}
    )

    target_link_libraries(display
    ${QT_QTCORE_LIBRARY}
    ${QT_QTGUI_LIBRARY}
    ${QT_QTSVG_LIBRARY}
    )

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: don’t use but need to run application?

    Could you answer my question, please?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Nov 2010
    Posts
    31
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: don’t use but need to run application?

    I don't clear understand your quesion, please ask again! my project have many files...

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: don’t use but need to run application?

    I'm asking to post your cmake project file again after incorporating changes I told you to do in post #4.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. #11
    Join Date
    Nov 2010
    Posts
    31
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: don’t use but need to run application?

    ok, cmakelists.txt look as follow:
    CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

    PROJECT(GN500)
    SET(VERSION 1.0.0)

    INCLUDE(InstallRequiredSystemLibraries)

    SET(VERSION_MAJOR 1)
    SET(VERSION_MINOR 0)
    SET(VERSION_PATCH 0)

    FIND_PACKAGE(Qt4 REQUIRED)
    INCLUDE(${QT_USE_FILE})

    SET(QT_USE_QTSQL false)
    SET(QT_USE_QTWEBKIT false)
    SET(QT_USE_QTXML false)
    SET(QT_USE_QTNETWORK false)

    FILE(GLOB ${PROJECT_NAME}_HDRS *.h)
    FILE(GLOB ${PROJECT_NAME}_MOC_SRCS *.h)
    FILE(GLOB ${PROJECT_NAME}_SRCS *.cpp)
    FILE(GLOB ${PROJECT_NAME}_RCCS *.qrc)

    QT4_WRAP_CPP(${PROJECT_NAME}_MOCS ${${PROJECT_NAME}_MOC_SRCS})
    QT4_ADD_RESOURCES(${PROJECT_NAME}_RCC_SRCS ${${PROJECT_NAME}_RCCS})

    source_group("Resource Files" FILES ${${PROJECT_NAME}_RCCS})
    source_group("Generated Files" FILES ${${PROJECT_NAME}_MOCS} ${${PROJECT_NAME}_RCC_SRCS})

    IF (WIN32)
    IF (MSVC)
    SET (${PROJECT_NAME}_SRCS ${${PROJECT_NAME}_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/appico.rc)
    ELSE(MSVC)
    IF (NOT WINDRES)
    FIND_PROGRAM(WINDRES windres)
    IF (NOT WINDRES)
    MESSAGE(FATAL_ERROR "windres not found - aborting")
    ENDIF (NOT WINDRES)
    ENDIF (NOT WINDRES)
    ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/icon.o
    COMMAND ${WINDRES} -I${CMAKE_CURRENT_SOURCE_DIR} -i${CMAKE_CURRENT_SOURCE_DIR}/appico.rc
    -o ${CMAKE_CURRENT_BINARY_DIR}/icon.o )
    SET(${PROJECT_NAME}_SRCS ${${PROJECT_NAME}_SRCS ${CMAKE_CURRENT_BINARY_DIR}/icon.o)
    ENDIF (MSVC)
    ENDIF (WIN32)

    IF (WIN32)
    SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
    ENDIF (WIN32)

    add_definitions("-Ddisplay_export=__declspec(dllimport)")
    #link_libraries(${CMAKE_SOURCE_DIR}/display/build2008)
    #find_library(lib NAMES display ${CMAKE_SOURCE_DIR}/display/build2008)
    #include_directories(${CMAKE_SOURCE_DIR}/display)

    INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/display)
    ADD_SUBDIRECTORY(${PROJECT_SOURCE_DIR}/display)


    ADD_EXECUTABLE(${PROJECT_NAME} ${${PROJECT_NAME}_SRCS} ${${PROJECT_NAME}_HDRS} ${${PROJECT_NAME}_MOCS} ${${PROJECT_NAME}_RCC_SRCS})
    #SET(EXTRA_LIBS ${EXTRA_LIBS} display)

    TARGET_LINK_LIBRARIES(${PROJECT_NAME}
    ${QT_QTMAIN_LIBRARY}
    ${QT_QTCORE_LIBRARY}
    ${QT_QTGUI_LIBRARY}
    ${QT_QT3SUPPORT_LIBRARY}
    ${QT_QTSVG_LIBRARY}
    display
    )

    SET(CPACK_PACKAGE_NAME "GN500")
    SET(CPACK_PACKAGE_VENDOR "tt80 Software")
    SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Phan mem mo phong khi tai GN500")
    SET(CPACK_PACKAGE_CONTACT "Phong Tin Hoc - Trung tam 80")

    SET(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
    SET(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
    SET(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
    SET(CPACK_GENERATOR NSIS)

    set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
    "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}
    CreateDirectory '\\\$SMPROGRAMS\\\\${PROJECT_NAME}\\\"'
    CreateShortCut \\\$SMPROGRAMS\\\\${PROJECT_NAME}\\\\${PROJECT_NAM E}.lnk\\\ \\\$INSTDIR\\\\bin\\\\${PROJECT_NAME}.exe\\\"
    CreateShortCut \\\$SMPROGRAMS\\\\${PROJECT_NAME}\\\\Uninstall.lnk \\\ \\\$INSTDIR\\\\Uninstall.exe\\\"
    CreateShortCut \\\$DESKTOP\\\\${PROJECT_NAME}.lnk\\\ \\\$INSTDIR\\\\bin\\\\${PROJECT_NAME}.exe\\\"
    ")

    message(${CPACK_NSIS_EXTRA_INSTALL_COMMANDS})

    set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
    "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}
    Delete '\\\$SMPROGRAMS\\\\${PROJECT_NAME}\\\\${PROJECT_NA ME}.lnk\\\"'
    Delete \\\$SMPROGRAMS\\\\${PROJECT_NAME}\\\\Uninstall.lnk \\\"
    RmDir \\\$SMPROGRAMS\\\\${PROJECT_NAME}\\\"
    Delete \\\$DESKTOP\\\\${PROJECT_NAME}.lnk\\\"
    ")

    message(${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS})


    INSTALL(TARGETS GN500 DESTINATION bin)
    INSTALL(FILES ${QT_BINARY_DIR}/QtCore4.dll DESTINATION bin)
    INSTALL(FILES ${QT_BINARY_DIR}/QtGui4.dll DESTINATION bin)
    INSTALL(FILES ${QT_BINARY_DIR}/QtSvg4.dll DESTINATION bin)
    INSTALL(FILES ${QT_BINARY_DIR}/Qt3Support4.dll DESTINATION bin)
    #INSTALL(FILES ${QT_BINARY_DIR}/QtSql4.dll DESTINATION bin)
    #INSTALL(FILES ${QT_BINARY_DIR}/QtXml4.dll DESTINATION bin)
    #INSTALL(FILES ${QT_BINARY_DIR}/QtNetwork4.dll DESTINATION bin)
    #INSTALL(FILES ${QT_BINARY_DIR}/QtWebKit4.dll DESTINATION bin)
    INSTALL(FILES ${PROJECT_SOURCE_DIR}/appico.ico DESTINATION bin)
    INSTALL(FILES ${PROJECT_SOURCE_DIR}/GN500.chm DESTINATION bin)
    INSTALL(FILES ${PROJECT_SOURCE_DIR}/hh.exe DESTINATION bin)

    INCLUDE(CPack)

  12. #12
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: don’t use but need to run application?

    The Qt3 support library, that your project specifically links, requires the Qt XML, SQL, and Network libraries. The question is, does your project really require the Qt3 support library? As far as I can tell no other library requires QtWebKit.

Similar Threads

  1. Replies: 4
    Last Post: 12th June 2012, 00:44
  2. Replies: 0
    Last Post: 12th July 2011, 08:20
  3. Why QGLFramebufferObject in QGraphicsItem don’t work?
    By Student3000 in forum Qt Programming
    Replies: 1
    Last Post: 23rd September 2010, 20:12
  4. I just don´t get the MySQL Driver Compiled
    By alex04721 in forum Installation and Deployment
    Replies: 24
    Last Post: 8th March 2010, 17:20
  5. Replies: 3
    Last Post: 6th January 2010, 16:55

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.