Execute make file in Windows if project build on Linux



  • I have an issue with the creating an executable file for windows, I have created a a project with UI on Linux, and after that I want to build the project on Windows using the mekfile from linux. I have tried: qmake Makefile but it show only one error a couple of times: "Extra charachters after test epression". How I can create an exe file in Windows?

    #############################################################################

    Makefile for building: QT_build

    Generated by qmake (3.0) (Qt 5.5.1)

    Project: QT_build.pro

    Template: app

    #############################################################################

    MAKEFILE = Makefile.Release

    ####### Compiler, tools and options

    CC = gcc
    CXX = g++
    DEFINES = -DUNICODE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN
    CFLAGS = -pipe -fno-keep-inline-dllexport -O2 -Wall -Wextra $(DEFINES)
    CXXFLAGS = -pipe -fno-keep-inline-dllexport -O2 -frtti -Wall -Wextra -fexceptions -mthreads $(DEFINES)
    INCPATH = -I. -I. -ID:\work\QT\5.5\mingw492_32\include -ID:\work\QT\5.5\mingw492_32\include\QtGui -ID:\work\QT\5.5\mingw492_32\include\QtANGLE -ID:\work\QT\5.5\mingw492_32\include\QtCore -Irelease -ID:\work\QT\5.5\mingw492_32\mkspecs\win32-g++
    LINKER = g++
    LFLAGS = -Wl,-s -Wl,-subsystem,windows -mthreads
    LIBS = -lmingw32 -LD:/work/QT/5.5/mingw492_32/lib -lqtmain -lshell32 -lQt5Gui -lQt5Core
    QMAKE = C:\Users\Mandruk\Desktop\QT_build\qmake.exe
    IDC = idc
    IDL = midl
    ZIP = zip -r -9
    DEF_FILE =
    RES_FILE =
    COPY = copy /y
    SED = $(QMAKE) -install sed
    COPY_FILE = copy /y
    COPY_DIR = xcopy /s /q /y /i
    DEL_FILE = del
    DEL_DIR = rmdir
    MOVE = move
    CHK_DIR_EXISTS= if not exist
    MKDIR = mkdir
    INSTALL_FILE = copy /y
    INSTALL_PROGRAM = copy /y
    INSTALL_DIR = xcopy /s /q /y /i

    ####### Output directory

    OBJECTS_DIR = release

    ####### Files

    SOURCES =
    OBJECTS =

    DIST = ui_loginform.h
    ui_registerform.h
    QMAKE_TARGET = QT_build
    DESTDIR = release\ #avoid trailing-slash linebreak
    TARGET = QT_build.exe
    DESTDIR_TARGET = release\QT_build.exe

    ####### Implicit rules

    .SUFFIXES: .cpp .cc .cxx .c

    .cpp.o:
    $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

    .cc.o:
    $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

    .cxx.o:
    $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<

    .c.o:
    $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<

    ####### Build rules

    first: all
    all: Makefile.Release $(DESTDIR_TARGET)

    $(DESTDIR_TARGET): $(OBJECTS)
    $(LINKER) $(LFLAGS) -o $(DESTDIR_TARGET) $(OBJECTS) $(LIBS)

    qmake: FORCE
    @$(QMAKE) -o Makefile.Release QT_build.pro

    qmake_all: FORCE

    dist:
    $(ZIP) QT_build.zip $(SOURCES) $(DIST) QT_build.pro D:\work\QT\5.5\mingw492_32\mkspecs\features\spec_pre.prf D:\work\QT\5.5\mingw492_32\mkspecs\qdevice.pri D:\work\QT\5.5\mingw492_32\mkspecs\features\device_config.prf D:\work\QT\5.5\mingw492_32\mkspecs\qconfig.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_3dcollision.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_3dcollision_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_3dcore.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_3dcore_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_3dinput.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_3dinput_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_3dlogic.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_3dlogic_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_3dquick.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_3dquick_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_3dquickrenderer.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_3dquickrenderer_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_3drenderer.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_3drenderer_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_axbase.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_axbase_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_axcontainer.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_axcontainer_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_axserver.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_axserver_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_bluetooth.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_bluetooth_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_bootstrap_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_clucene_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_concurrent.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_concurrent_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_core.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_core_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_dbus.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_dbus_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_declarative.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_declarative_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_designer.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_designer_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_designercomponents_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_enginio.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_enginio_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_gui.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_gui_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_help.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_help_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_location.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_location_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_multimedia.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_multimedia_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_multimediawidgets.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_multimediawidgets_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_network.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_network_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_nfc.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_nfc_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_opengl.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_opengl_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_openglextensions.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_openglextensions_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_platformsupport_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_positioning.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_positioning_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_printsupport.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_printsupport_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_qml.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_qml_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_qmldevtools_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_qmltest.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_qmltest_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_qtmultimediaquicktools_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_quick.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_quick_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_quickparticles_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_quickwidgets.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_quickwidgets_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_script.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_script_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_scripttools.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_scripttools_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_sensors.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_sensors_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_serialport.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_serialport_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_sql.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_sql_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_svg.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_svg_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_testlib.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_testlib_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_uiplugin.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_uitools.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_uitools_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_webchannel.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_webchannel_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_webkit.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_webkit_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_webkitwidgets.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_webkitwidgets_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_websockets.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_websockets_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_widgets.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_widgets_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_winextras.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_winextras_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_xml.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_xml_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_xmlpatterns.pri D:\work\QT\5.5\mingw492_32\mkspecs\modules\qt_lib_xmlpatterns_private.pri D:\work\QT\5.5\mingw492_32\mkspecs\features\qt_functions.prf D:\work\QT\5.5\mingw492_32\mkspecs\features\qt_config.prf D:\work\QT\5.5\mingw492_32\mkspecs\features\win32\qt_config.prf D:\work\QT\5.5\mingw492_32\mkspecs\win32-g++\qmake.conf D:\work\QT\5.5\mingw492_32\mkspecs\features\spec_post.prf D:\work\QT\5.5\mingw492_32\mkspecs\features\exclusive_builds.prf D:\work\QT\5.5\mingw492_32\mkspecs\features\default_pre.prf D:\work\QT\5.5\mingw492_32\mkspecs\features\win32\default_pre.prf D:\work\QT\5.5\mingw492_32\mkspecs\features\resolve_config.prf D:\work\QT\5.5\mingw492_32\mkspecs\features\exclusive_builds_post.prf D:\work\QT\5.5\mingw492_32\mkspecs\features\default_post.prf D:\work\QT\5.5\mingw492_32\mkspecs\features\build_pass.prf D:\work\QT\5.5\mingw492_32\mkspecs\features\win32\rtti.prf D:\work\QT\5.5\mingw492_32\mkspecs\features\precompile_header.prf D:\work\QT\5.5\mingw492_32\mkspecs\features\warn_on.prf D:\work\QT\5.5\mingw492_32\mkspecs\features\qt.prf D:\work\QT\5.5\mingw492_32\mkspecs\features\resources.prf D:\work\QT\5.5\mingw492_32\mkspecs\features\moc.prf D:\work\QT\5.5\mingw492_32\mkspecs\features\win32\opengl.prf D:\work\QT\5.5\mingw492_32\mkspecs\features\win32\windows.prf D:\work\QT\5.5\mingw492_32\mkspecs\features\testcase_targets.prf D:\work\QT\5.5\mingw492_32\mkspecs\features\exceptions.prf D:\work\QT\5.5\mingw492_32\mkspecs\features\yacc.prf D:\work\QT\5.5\mingw492_32\mkspecs\features\lex.prf QT_build.pro D:/work/QT/5.5/mingw492_32/lib/qtmain.prl D:/work/QT/5.5/mingw492_32/lib/Qt5Gui.prl D:/work/QT/5.5/mingw492_32/lib/Qt5Core.prl NO_PCH_SOURCES RESOURCES HEADERS SOURCES OBJECTIVE_SOURCES YACCSOURCES YACCSOURCES LEXSOURCES

    clean: compiler_clean

    distclean: clean
    -$(DEL_FILE) $(DESTDIR_TARGET)
    -$(DEL_FILE) Makefile.Release

    mocclean: compiler_moc_header_clean compiler_moc_source_clean

    mocables: compiler_moc_header_make_all compiler_moc_source_make_all

    check: first

    compiler_no_pch_compiler_make_all:
    compiler_no_pch_compiler_clean:
    compiler_rcc_make_all:
    compiler_rcc_clean:
    compiler_moc_header_make_all:
    compiler_moc_header_clean:
    compiler_moc_source_make_all:
    compiler_moc_source_clean:
    compiler_yacc_decl_make_all:
    compiler_yacc_decl_clean:
    compiler_yacc_impl_make_all:
    compiler_yacc_impl_clean:
    compiler_lex_make_all:
    compiler_lex_clean:
    compiler_clean:

    ####### Compile

    ####### Install

    install: FORCE

    uninstall: FORCE

    FORCE:


  • Lifetime Qt Champion

    Hi,

    Don't try to re-use Makefiles from Linux on Windows. You have your .pro file so open your project with Qt Creator and built it there.