How can I move my project from Linux to Windows?



  • Qt Creator 4.5.0, Qt 5.10.0

    I create project on Debian 9.2.3 x64 and the resulting program works fine. Now I want to run my program on Windows 10 Pro 1709 x64.
    I move project folder on Windows (in C:\qt project), but:

    • if I open the project as an existing- Qt Creator falls and closes

    • if I chose Import existing project- nothing happens

    • if I chose import qmake project- Qt Creator falls and closes

    How can I Import my project to Windows?



  • Hi @AlekseyB,
    Could you post your .pro file?

    Maybe it is possible that you use modules that are not available for Windows, because of a different version or an unix-only module (e.g. X11Extras).

    Try to delete all the Makefiles, .o files, etc. from the Debian OS before opening the project on Windows.


  • Qt Champions 2017

    Hi @AlekseyB:

    First of all, I assume you use QMake for building your project? Then please show us your .pro file, as @beecksche already said.

    I move project folder on Windows (in C:\qt project), but:

    Please avoid folders with spaces and other non-ASCII chars in it. This will lead to all kind of problems you can imagine.

    if I open the project as an existing- Qt Creator falls and closes

    Oops, that should work - it is the usual way to . In addition to what @beecksche suggests, please remove the .pro.user file also. It belongs to a specific Qt/QtCreator installation and cannot be shared.



  • @beecksche said in How can I move my project from Linux to Windows?:

    Hi @AlekseyB,
    Could you post your .pro file?

    My pro -file:

    #-------------------------------------------------
    #
    # Project created by QtCreator 2017-10-11T16:01:21
    #
    #-------------------------------------------------
    
    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    TARGET = Reseaches
    TEMPLATE = app
    
    # The following define makes your compiler emit warnings if you use
    # any feature of Qt which has been marked as deprecated (the exact warnings
    # depend on your compiler). Please consult the documentation of the
    # deprecated API in order to know how to port your code away from it.
    DEFINES += QT_DEPRECATED_WARNINGS
    
    # You can also make your code fail to compile if you use deprecated APIs.
    # In order to do so, uncomment the following line.
    # You can also select to disable deprecated APIs only up to a certain version of Qt.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    SOURCES += \
            main.cpp \
            mainwindow.cpp \
        CreateFilesForPaper/Development.cpp \
        MyLib/File.cpp \
        MyLib/Memory.cpp \
        MyLib/String.cpp \
        MyLib/FileSystems.cpp \
        GlobalVariable/GlobalData.cpp \
        MyLib/Interaction.cpp \
        CreateFilesForPaper/DlgCreateFilesForPaper.cpp \
        GlobalVariable/EventFilter.cpp \
        test.cpp
    
    HEADERS += \
            mainwindow.h \
        Signals/iSignal.h \
        Signals/Macd.h \
        CreateFilesForPaper/Data.h \
        MyLib/Allocator.h \
        MyLib/iExecuteTasksForDirectory.h \
        MyLib/iTaskWithAttempt.h \
        MyLib/ShortType.h \
        MyLib/SmartArray.h \
        MyLib/ThreadSafeArray.h \
        CreateFilesForPaper/Interface.h \
        CreateFilesForPaper/Development.h \
        MyLib/Memory.h \
        MyLib/File.h \
        MyLib/String.h \
        MyLib/FileSystems.h \
        Strategy/FactoryStrategy.h \
        Strategy/Strategy.h \
        GlobalVariable/GlobalData.h \
        GlobalVariable/TaskManager.h \
        MyLib/Interaction.h \
        CreateFilesForPaper/DlgCreateFilesForPaper.h \
        MyLib/ConverterStringToStruct.h \
        GlobalVariable/EventFilter.h \
        GlobalVariable/Event.h \
        test.h
    
    FORMS += \
            mainwindow.ui \
        CreateFilesForPaper/DlgCreateFilesForPaper.ui
    
    STATECHARTS +=
    


  • @beecksche said in How can I move my project from Linux to Windows?:

    Maybe it is possible that you use modules that are not available for Windows, because of a different version or an unix-only module (e.g. X11Extras).

    Try to delete all the Makefiles, .o files, etc. from the Debian OS before opening the project on Windows.

    I don't use any modules. I not found in the project folder "Makefiles, .o files, etc", only h, cpp, ui and pro- files.



  • @aha_1980 said in How can I move my project from Linux to Windows?:

    Hi @AlekseyB:

    First of all, I assume you use QMake for building your project?

    Yes. This is the parameters of the call to qmake:

    qmake /home/viktor/qt/Reseaches/Reseaches.pro -spec linux-icc-64 && /usr/bin/make qmake_all
    


  • @aha_1980 said in How can I move my project from Linux to Windows?:

    Hi @AlekseyB:

    I move project folder on Windows (in C:\qt project), but:

    Please avoid folders with spaces and other non-ASCII chars in it. This will lead to all kind of problems you can imagine.

    I delete all spaces in the path (and nothing non-ASCII) : without results.

    Oops, that should work - it is the usual way to . In addition to what @beecksche suggests, please remove the .pro.user file also. It belongs to a specific Qt/QtCreator installation and cannot be shared.

    I delete .pro.user file: without results.

    I replace all '/' on '\' simbols (because in Linux other separator of file- system): without results.


  • Moderators

    @AlekseyB Your QtCreator crashes? Did you try to create a default project in QtCreator and build/run it? It should actually not crash.



  • @AlekseyB
    First, as @jsulm says, nothing should "crash". Make sure your Windows Qt is all that the same versions as Linux, and that you can set up a tiny "hello world" without problem.

    Yes. This is the parameters of the call to qmake:

    qmake /home/viktor/qt/Reseaches/Reseaches.pro -spec linux-icc-64 && /usr/bin/make qmake_all

    What do you do for Windows? -spec linux-icc-64 does not look right for Windows, does it?


  • Qt Champions 2017

    @AlekseyB

    I replace all '/' on '' simbols (because in Linux other separator of file- system): without results.

    This is not necessary and will lead to problems. Don't do that.

    Otherwise your pro file looks good, I don't see anything that could lead to problems.

    One last thing comes to mind: on Linux foo.c and Foo.c are two different files, on Windows they are not.



  • @AlekseyB Your question was "how can I move my project to Windows?"
    The Answer is...

    1. If you want to use the Microsoft tools install the latest version of Visual Studio which will work with the version of Qt you used for your Linux project. Then install the Qt package for that.
      If you want to use the more Linux like tool set then download that together with the Qt package for windows that matches your Linux project.
    2. Make yourself a folder for you project on your windows machine and copy your Linux source code and pro file only, you don't need the pro.user file.
    3. Edit your pro file and add the stuff to make it work with the windows paths and libraries etc. You can use the conditional stuff in the pro file to separate the Linux stuff from the Windows stuff. See the Qt documentation for more on this.
    4. Build your project.
      There is nothing to it. I have my project building on Windows and Mac using the same sources and pro file, so you can do it too :-)

    You will benefit from building some Qt example project on you Windows set up and look at how the pro file differs from the Linux one.

    Good luck and enjoy.



  • @JonB said in How can I move my project from Linux to Windows?:

    What do you do for Windows? -spec linux-icc-64 does not look right for Windows, does it?

    This line from Linux system. On Windows it lool like this:
    qmake.exe C:\Project\Test\Test\Test.pro -spec win32-msvc "CONFIG+=debug" "CONFIG+=qml_debug" && <no Make step found> qmake_all

    I have created a simple project in the Windows and when compiling got the following error:

    15:33:21: Could not determine which "make" command to run. Check the "make" step in the build configuration.
    Error while building/deploying project Test (kit: Desktop Qt 5.10.0 MSVC2013 64bit)
    When executing step "qmake"
    


  • @AlekseyB
    So I know nothing about this, but as the message states, what is it you have in the make step of the build configuration of the Desktop kit?



  • @JonB said in How can I move my project from Linux to Windows?:

    So I know nothing about this, but as the message states, what is it you have in the make step of the build configuration of the Desktop kit

    I want to create an x64 application. But when I installing Qt Creator there is only x32 debugger MINGW.

    1. Do I have to create x64 applications to install: qmake x64, x64 compiler and debugger x64 also?
    2. Which of these three components determines x32/x64 received the application?
    3. Can they have different x32/x64?

  • Qt Champions 2017

    @AlekseyB
    Hi
    Qt dont supply 64 mingw version for windows.
    But its possible but takes quite some work
    https://stackoverflow.com/questions/38335424/how-to-use-mingw-64-with-qt-creator

    There is 64 for visual studio, so that might be an option. ?


Log in to reply
 

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