Modifying a Qt windows32 bit project so it can be compiled for windows 64 bit using visual studio 2012



  • Hi all I am working on a project that was previously done for win 32 bit platforms and I want to modify it so it can be run on Windows64 bit machines .I believe I have to make changes in the pro file of the project but I don't know how to proceed with these compiler options.

    Here is a section of my .pro file
    @TARGET = "Open-Sankore"
    TEMPLATE = app

    THIRD_PARTY_PATH=../Sankore-ThirdParty

    CONFIG -= flat
    CONFIG += debug_and_release
    no_include_pwd

    VERSION_MAJ = 2
    VERSION_MIN = 00
    VERSION_TYPE = r # a = alpha, b = beta, r = release, other => error
    VERSION_PATCH = 00

    VERSION = "$${VERSION_MAJ}.$${VERSION_MIN}.$${VERSION_TYPE}.$${VERSION_PATCH}"
    VERSION = $$replace(VERSION, "\.r", "")

    LONG_VERSION = "$${VERSION}.$${SVN_VERSION}"
    macx:OSX_VERSION = "$${VERSION} (r$${SVN_VERSION})"

    VERSION_RC = $$VERSION_MAJ,$$VERSION_MIN,$$VERSION_TYPE,$$VERSION_PATCH
    VERSION_RC = $$replace(VERSION_RC, "a", "160") # 0xA0
    VERSION_RC = $$replace(VERSION_RC, "b", "176") # 0xB0
    VERSION_RC = $$replace(VERSION_RC, "r", "240") # 0xF0

    QT += webkit
    QT += svg
    QT += network
    QT += phonon
    QT += xml
    QT += script
    QT += xmlpatterns

    INCLUDEPATH += src

    include($$THIRD_PARTY_PATH/libs.pri)
    include(src/adaptors/adaptors.pri)
    include(src/api/api.pri)
    include(src/board/board.pri)
    include(src/core/core.pri)
    include(src/document/document.pri)
    include(src/domain/domain.pri)
    include(src/frameworks/frameworks.pri)
    include(src/gui/gui.pri)
    include(src/network/network.pri)
    include(src/pdf/pdf.pri)
    include(src/podcast/podcast.pri)
    include(src/tools/tools.pri)
    include(src/desktop/desktop.pri)
    include(src/web/web.pri)
    include(src/transition/transition.pri)
    include(src/interfaces/interfaces.pri)
    include(src/customWidgets/customWidgets.pri)

    DEPENDPATH += src/pdf-merger
    INCLUDEPATH += src/pdf-merger
    include(src/pdf-merger/pdfMerger.pri)

    #plugins
    include(plugins/plugins.pri)
    INCLUDEPATH += plugins/cffadaptor/src

    #ThirdParty
    DEPENDPATH += $$THIRD_PARTY_PATH/quazip/
    INCLUDEPATH += $$THIRD_PARTY_PATH/quazip/
    include($$THIRD_PARTY_PATH/quazip/quazip.pri)
    DEPENDPATH += $$THIRD_PARTY_PATH/trolltech/singleapplication
    INCLUDEPATH += $$THIRD_PARTY_PATH/trolltech/singleapplication
    include($$THIRD_PARTY_PATH/trolltech/singleapplication/qtsingleapplication.pri)

    FORMS += resources/forms/mainWindow.ui
    resources/forms/preferences.ui
    resources/forms/brushProperties.ui
    resources/forms/documents.ui
    resources/forms/blackoutWidget.ui
    resources/forms/trapFlash.ui
    resources/forms/youTubePublishingDialog.ui
    resources/forms/webPublishing.ui
    resources/forms/capturePublishing.ui
    resources/forms/intranetPodcastPublishingDialog.ui

    UB_ETC.files = resources/etc
    UB_I18N.files = resources/i18n/*.qm
    UB_LIBRARY.files = resources/library
    UB_FONTS.files = resources/fonts
    UB_THIRDPARTY_INTERACTIVE.files = thirdparty/interactive

    DEFINES += NO_THIRD_PARTY_WARNINGS
    DEFINES += UBVERSION="\"$${LONG_VERSION}"\"
    UBVERSION_RC=$$VERSION_RC
    ALPHA_BETA_STR = $$find(VERSION, "[ab]")
    count(ALPHA_BETA_STR, 1):DEFINES += PRE_RELEASE
    BUILD_DIR = build

    macx:BUILD_DIR = $$BUILD_DIR/macx
    win32:BUILD_DIR = $$BUILD_DIR/win32
    linux-g++*:BUILD_DIR = $$BUILD_DIR/linux

    CONFIG(debug, debug|release):BUILD_DIR = $$BUILD_DIR/debug
    CONFIG(release, debug|release) {
    BUILD_DIR = $$BUILD_DIR/release
    CONFIG += warn_off
    }

    DESTDIR = $$BUILD_DIR/product
    OBJECTS_DIR = $$BUILD_DIR/objects
    MOC_DIR = $$BUILD_DIR/moc
    RCC_DIR = $$BUILD_DIR/rcc
    UI_DIR = $$BUILD_DIR/ui

    win32 {
    RC_FILE = resources/win/sankore.rc
    CONFIG += qaxcontainer
    exists(console):CONFIG += console
    QMAKE_CXXFLAGS += /MP
    QMAKE_CXXFLAGS_RELEASE += /Od /Zi
    QMAKE_LFLAGS_RELEASE += /DEBUG
    UB_LIBRARY.path = $$DESTDIR
    UB_I18N.path = $$DESTDIR/i18n
    UB_ETC.path = $$DESTDIR
    UB_THIRDPARTY_INTERACTIVE.path = $$DESTDIR/library
    system(md $$replace(BUILD_DIR, /, \))
    system(echo "$$VERSION" > $$BUILD_DIR/version)
    system(echo "$$LONG_VERSION" > $$BUILD_DIR/longversion)
    system(echo "$$SVN_VERSION" > $$BUILD_DIR/svnversion)

    }

    macx {
    LIBS += -framework Foundation
    LIBS += -lcrypto
    #commented because Sankore crashes on JavaScript. It seems to backends dependencies.
    #LIBS += -framework AppKit
    #LIBS += -framework WebKit

    CONFIG(release, debug|release):CONFIG += x86

    [03-02-2011] We must use the 32bit version for the moment

    because the Quicktime components used by this application

    are not yet available in 64bits.

    CONFIG(debug, debug|release):CONFIG += x86

    QMAKE_MAC_SDK = "/Developer/SDKs/MacOSX10.6.sdk"
    QMAKE_MACOSX_DEPLOYMENT_TARGET = "10.5"

    VERSION_RC_PATH = "$$BUILD_DIR/version_rc"

    Embed version into executable for breakpad

    QMAKE_LFLAGS += -sectcreate
    __DATA
    __version
    $$VERSION_RC_PATH

    QMAKE_CXXFLAGS_RELEASE += -gdwarf-2
    -mdynamic-no-pic

    QMAKE_CFLAGS += -fopenmp
    QMAKE_CXXFLAGS += -fopenmp
    QMAKE_LFLAGS += -fopenmp

    CONTENTS_DIR = "Contents"
    RESOURCES_DIR = "Contents/Resources"
    FRAMEWORKS_DIR = "Contents/Frameworks"

    UB_ETC.files = "resources/etc"
    UB_ETC.path = "$$RESOURCES_DIR"
    UB_LIBRARY.files = "resources/library"
    UB_LIBRARY.path = "$$RESOURCES_DIR"
    UB_FONTS.files = "resources/fonts"
    UB_FONTS.path = "$$RESOURCES_DIR"
    UB_THIRDPARTY_INTERACTIVE.files = $$files($$THIRD_PARTY_PATH/interactive/)
    UB_THIRDPARTY_INTERACTIVE.path = "$$RESOURCES_DIR/library/interactive"
    UB_MACX_ICNS.files = $$files(resources/macx/
    .icns)
    UB_MACX_ICNS.path = "$$RESOURCES_DIR"
    UB_MACX_EXTRAS.files = "resources/macx/Save PDF to Open-Sankore.workflow"
    UB_MACX_EXTRAS.path = "$$RESOURCES_DIR"
    UB_I18N.path = $$DESTDIR/i18n # not used

    exists(resources/i18n/sankore_en.qm) {
    TRANSLATION_en.files = resources/i18n/sankore_en.qm
    resources/i18n/Localizable.strings
    TRANSLATION_en.path = "$$RESOURCES_DIR/en.lproj"
    QMAKE_BUNDLE_DATA += TRANSLATION_en@

    Thanks.


  • Lifetime Qt Champion

    Hi,

    Use the qmake from your 64bit Qt and also check that all third party linked libraries are pointing to the respective 64bit version. That should be all for now



  • Thanks SGaist for the quick reply,
    I have done the first part of your suggestion(Use the qmake from your 64bit Qt) but hadn't thought about the third party libraries.So far I am getting an error telling me that uitools are deprecated and that I should use CONFIG += axcontainer instead of CONFIG += qaxcontainer.
    Also shouldn't win32 {........} be changed to something like win64 {........}**? Excuse me if this is dumb as I have never built for 64 bit systems.
    Thanks for your time.


  • Lifetime Qt Champion

    IFAIK (but I may be wrong) there is no win64 scope.
    I use the CONFIG function to look up if there is x86 or x86_64 and act accordingly


Log in to reply
 

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