Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
Misc error.
History
This error occurred while answering the Qt FAQ
How to cross-compile a Qt Creator project from Ubuntu to a windows executable?.
I started a clean GUI application and added the '-spec win32-g++'.
Downloads
Project information
Operating system: Ubuntu 10.04 LTS Lucid Lynx
IDE: Qt Creator 2.0.0
Project type: GUI application
Compiler: G++ 4.4.1
Libraries used:
- Qt: version 4.7.0 (32 bit)
#-------------------------------------------------
#
# Project created by QtCreator 2010-09-24T09:54:48
#
#-------------------------------------------------
QT += core gui
TARGET = CppMiscErrorUi_dialogHerror127
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
|
main.cpp
mainwindow.cpp
mainwindow.h
Observations
Qt Creator's compile output was:
Running build steps for project CppMiscErrorUi_dialogHerror127...
Configuration unchanged, skipping qmake step.
Starting: "/usr/bin/make" -w
make: Entering directory '/home/richel/qtsdk-2010.04/bin/Projects/Website/CppMiscErrorUi_dialogHerror127-build-desktop'
/usr/bin/make -f Makefile.Debug
make[1]: Entering directory '/home/richel/qtsdk-2010.04/bin/Projects/Website/CppMiscErrorUi_dialogHerror127-build-desktop'
/usr/bin/uic.exe ../CppMiscErrorUi_dialogHerror127/mainwindow.ui -o ui_mainwindow.h
make[1]: /usr/bin/uic.exe: Command not found
make[1]: Leaving directory '/home/richel/qtsdk-2010.04/bin/Projects/Website/CppMiscErrorUi_dialogHerror127-build-desktop'
make: Leaving directory '/home/richel/qtsdk-2010.04/bin/Projects/Website/CppMiscErrorUi_dialogHerror127-build-desktop'
make[1]: *** [ui_mainwindow.h] Error 127
make: *** [debug] Error 2
The process "/usr/bin/make" exited with code %2.
Error while building project CppMiscErrorUi_dialogHerror127 (target: Desktop)
When executing build step 'Make'
|
Note '/usr/bin/uic.exe: Command not found'. UIC is the Qt user interface compiler. The call to 'uic.exe' is
unexpected on a Ubuntu computer (as .exe denotes a Windows executable). A call to 'uic' from the Ubuntu
terminal succeeds.
Below is Makefile.Debug, where uic.exe is not called:
#############################################################################
# Makefile for building: CppMiscErrorUi_dialogHerror127
# Generated by qmake (2.01a) (Qt 4.6.2) on: Fri Sep 24 12:34:52 2010
# Project: ../CppMiscErrorUi_dialogHerror127/CppMiscErrorUi_dialogHerror127.pro
# Template: app
#############################################################################
####### Compiler, tools and options
CC = gcc
CXX = g++
DEFINES = -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_GUI_LIB -DQT_CORE_LIB
CFLAGS = -g -Wall $(DEFINES)
CXXFLAGS = -g -Wall $(DEFINES)
INCPATH = -I"/usr/include/qt4/QtCore" -I"/usr/include/qt4/QtGui" -I"/usr/include/qt4" -I"debug" -I"." -I"../CppMiscErrorUi_dialogHerror127" -I"." -I"/usr/share/qt4/mkspecs/win32-g++"
LINK = g++
LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
LIBS = -L"/usr/lib" -lQtGui -lQtCore
QMAKE = /usr/bin/qmake-qt4
IDC = /usr/bin/idc.exe
IDL = midl
ZIP = zip -r -9
DEF_FILE =
RES_FILE =
COPY = copy /y
COPY_FILE = $(COPY)
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_FILE)
INSTALL_PROGRAM = $(COPY_FILE)
INSTALL_DIR = $(COPY_DIR)
####### Output directory
OBJECTS_DIR = debug/
####### Files
SOURCES = ../CppMiscErrorUi_dialogHerror127/main.cpp \
../CppMiscErrorUi_dialogHerror127/mainwindow.cpp debug/moc_mainwindow.cpp
OBJECTS = debug/main.o \
debug/mainwindow.o \
debug/moc_mainwindow.o
DIST =
QMAKE_TARGET = CppMiscErrorUi_dialogHerror127
DESTDIR = debug/ #avoid trailing-slash linebreak
TARGET = CppMiscErrorUi_dialogHerror127.exe
DESTDIR_TARGET = debug/CppMiscErrorUi_dialogHerror127.exe
####### Implicit rules
.SUFFIXES: .cpp .cc .cxx .C .c
.cpp.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.cc.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.cxx.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.C.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
.c.o:
$(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
####### Build rules
first: all
all: Makefile.Debug $(DESTDIR_TARGET)
$(DESTDIR_TARGET): ui_mainwindow.h $(OBJECTS)
$(LINK) $(LFLAGS) -o $(DESTDIR_TARGET) $(OBJECTS) $(LIBS)
qmake: FORCE
@$(QMAKE) -spec /usr/share/qt4/mkspecs/win32-g++ -unix CONFIG+=debug -o Makefile.Debug ../CppMiscErrorUi_dialogHerror127/CppMiscErrorUi_dialogHerror127.pro
dist:
$(ZIP) CppMiscErrorUi_dialogHerror127.zip $(SOURCES) $(DIST) ../CppMiscErrorUi_dialogHerror127/CppMiscErrorUi_dialogHerror127.pro /usr/share/qt4/mkspecs/qconfig.pri /usr/share/qt4/mkspecs/features/qt_functions.prf /usr/share/qt4/mkspecs/features/qt_config.prf /usr/share/qt4/mkspecs/features/exclusive_builds.prf /usr/share/qt4/mkspecs/features/default_pre.prf /usr/share/qt4/mkspecs/features/debug.prf /usr/share/qt4/mkspecs/features/debug_and_release.prf /usr/share/qt4/mkspecs/features/default_post.prf /usr/share/qt4/mkspecs/features/build_pass.prf /usr/share/qt4/mkspecs/features/warn_on.prf /usr/share/qt4/mkspecs/features/qt.prf /usr/share/qt4/mkspecs/features/unix/thread.prf /usr/share/qt4/mkspecs/features/moc.prf /usr/share/qt4/mkspecs/features/resources.prf /usr/share/qt4/mkspecs/features/uic.prf /usr/share/qt4/mkspecs/features/yacc.prf /usr/share/qt4/mkspecs/features/lex.prf /usr/share/qt4/mkspecs/features/include_source_dir.prf HEADERS RESOURCES IMAGES SOURCES OBJECTIVE_SOURCES FORMS YACCSOURCES YACCSOURCES LEXSOURCES
clean: compiler_clean
-$(DEL_FILE) debug/main.o debug/mainwindow.o debug/moc_mainwindow.o
distclean: clean
-$(DEL_FILE) $(DESTDIR_TARGET)
-$(DEL_FILE) Makefile.Debug
mocclean: compiler_moc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
compiler_moc_header_make_all: debug/moc_mainwindow.cpp
compiler_moc_header_clean:
-$(DEL_FILE) debug/moc_mainwindow.cpp
debug/moc_mainwindow.cpp: ../CppMiscErrorUi_dialogHerror127/mainwindow.h
/usr/bin/moc.exe $(DEFINES) $(INCPATH) -D__GNUC__ -DWIN32 ../CppMiscErrorUi_dialogHerror127/mainwindow.h -o debug/moc_mainwindow.cpp
compiler_rcc_make_all:
compiler_rcc_clean:
compiler_image_collection_make_all: qmake_image_collection.cpp
compiler_image_collection_clean:
-$(DEL_FILE) qmake_image_collection.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all: ui_mainwindow.h
compiler_uic_clean:
-$(DEL_FILE) ui_mainwindow.h
ui_mainwindow.h: ../CppMiscErrorUi_dialogHerror127/mainwindow.ui
/usr/bin/uic.exe ../CppMiscErrorUi_dialogHerror127/mainwindow.ui -o ui_mainwindow.h
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: compiler_moc_header_clean compiler_uic_clean
####### Compile
debug/main.o: ../CppMiscErrorUi_dialogHerror127/main.cpp ../CppMiscErrorUi_dialogHerror127/mainwindow.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/main.o ../CppMiscErrorUi_dialogHerror127/main.cpp
debug/mainwindow.o: ../CppMiscErrorUi_dialogHerror127/mainwindow.cpp ../CppMiscErrorUi_dialogHerror127/mainwindow.h \
ui_mainwindow.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/mainwindow.o ../CppMiscErrorUi_dialogHerror127/mainwindow.cpp
debug/moc_mainwindow.o: debug/moc_mainwindow.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o debug/moc_mainwindow.o debug/moc_mainwindow.cpp
####### Install
install: FORCE
uninstall: FORCE
FORCE:
|
Contents of /home/richel/qtsdk-2010.04/qt/mkspecs/win32-g++/qmake.conh
#
# qmake configuration for win32-g++
#
# Written for MinGW
#
MAKEFILE_GENERATOR = MINGW
TEMPLATE = app
CONFIG += qt warn_on release link_prl copy_dir_files debug_and_release debug_and_release_target precompile_header
QT += core gui
DEFINES += UNICODE QT_LARGEFILE_SUPPORT
QMAKE_COMPILER_DEFINES += __GNUC__ WIN32
QMAKE_EXT_OBJ = .o
QMAKE_EXT_RES = _res.o
QMAKE_CC = gcc
QMAKE_LEX = flex
QMAKE_LEXFLAGS =
QMAKE_YACC = byacc
QMAKE_YACCFLAGS = -d
QMAKE_CFLAGS =
QMAKE_CFLAGS_DEPS = -M
QMAKE_CFLAGS_WARN_ON = -Wall
QMAKE_CFLAGS_WARN_OFF = -w
QMAKE_CFLAGS_RELEASE = -O2
QMAKE_CFLAGS_DEBUG = -g
QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
QMAKE_CXX = g++
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
QMAKE_CXXFLAGS_RTTI_ON = -frtti
QMAKE_CXXFLAGS_RTTI_OFF = -fno-rtti
QMAKE_CXXFLAGS_EXCEPTIONS_ON = -fexceptions -mthreads
QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -fno-exceptions
QMAKE_INCDIR =
QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS]
QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS]
QMAKE_RUN_CC = $(CC) -c $(CFLAGS) $(INCPATH) -o $obj $src
QMAKE_RUN_CC_IMP = $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
QMAKE_RUN_CXX = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $obj $src
QMAKE_RUN_CXX_IMP = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
QMAKE_LINK = g++
QMAKE_LINK_C = gcc
QMAKE_LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads -Wl
QMAKE_LFLAGS_EXCEPTIONS_OFF =
QMAKE_LFLAGS_RELEASE = -Wl,-s
QMAKE_LFLAGS_DEBUG =
QMAKE_LFLAGS_CONSOLE = -Wl,-subsystem,console
QMAKE_LFLAGS_WINDOWS = -Wl,-subsystem,windows
QMAKE_LFLAGS_DLL = -shared
QMAKE_LINK_OBJECT_MAX = 10
QMAKE_LINK_OBJECT_SCRIPT= object_script
QMAKE_LIBS =
QMAKE_LIBS_CORE = -lkernel32 -luser32 -lshell32 -luuid -lole32 -ladvapi32 -lws2_32
QMAKE_LIBS_GUI = -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lws2_32 -lole32 -luuid -luser32 -ladvapi32
QMAKE_LIBS_NETWORK = -lws2_32
QMAKE_LIBS_OPENGL = -lopengl32 -lglu32 -lgdi32 -luser32
QMAKE_LIBS_COMPAT = -ladvapi32 -lshell32 -lcomdlg32 -luser32 -lgdi32 -lws2_32
QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqtmain
!isEmpty(QMAKE_SH) {
MINGW_IN_SHELL = 1
QMAKE_DIR_SEP = /
QMAKE_QMAKE ~= s,\\\\,/,
QMAKE_COPY = cp
QMAKE_COPY_DIR = xcopy /s /q /y /i
QMAKE_MOVE = mv
QMAKE_DEL_FILE = rm
QMAKE_MKDIR = mkdir
QMAKE_DEL_DIR = rmdir
QMAKE_CHK_DIR_EXISTS = test -d
} else {
QMAKE_COPY = copy /y
QMAKE_COPY_DIR = xcopy /s /q /y /i
QMAKE_MOVE = move
QMAKE_DEL_FILE = del
QMAKE_MKDIR = mkdir
QMAKE_DEL_DIR = rmdir
QMAKE_CHK_DIR_EXISTS = if not exist
}
QMAKE_MOC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe
QMAKE_UIC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe
QMAKE_IDC = $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe
QMAKE_IDL = midl
QMAKE_LIB = ar -ru
QMAKE_RC = windres
QMAKE_ZIP = zip -r -9
QMAKE_STRIP = strip
QMAKE_STRIPFLAGS_LIB += --strip-unneeded
load(qt_config)
|
Contents of /home/richel/qtsdk-2010.04/qt/mkspecs/win32-g++/qplatformdefs.h
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the qmake spec of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial Usage
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QPLATFORMDEFS_H
#define QPLATFORMDEFS_H
#ifdef UNICODE
#ifndef _UNICODE
#define _UNICODE
#endif
#endif
// Get Qt defines/settings
#include "qglobal.h"
#include <tchar.h>
#include <io.h>
#include <direct.h>
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <qt_windows.h>
#include <limits.h>
#if !defined(_WIN32_WINNT) || (_WIN32_WINNT-0 < 0x0500)
typedef enum {
NameUnknown = 0,
NameFullyQualifiedDN = 1,
NameSamCompatible = 2,
NameDisplay = 3,
NameUniqueId = 6,
NameCanonical = 7,
NameUserPrincipal = 8,
NameCanonicalEx = 9,
NameServicePrincipal = 10,
NameDnsDomain = 12
} EXTENDED_NAME_FORMAT, *PEXTENDED_NAME_FORMAT;
#endif
#define Q_FS_FAT
#ifdef QT_LARGEFILE_SUPPORT
#define QT_STATBUF struct _stati64 // non-ANSI defs
#define QT_STATBUF4TSTAT struct _stati64 // non-ANSI defs
#define QT_STAT ::_stati64
#define QT_FSTAT ::_fstati64
#else
#define QT_STATBUF struct _stat // non-ANSI defs
#define QT_STATBUF4TSTAT struct _stat // non-ANSI defs
#define QT_STAT ::_stat
#define QT_FSTAT ::_fstat
#endif
#define QT_STAT_REG _S_IFREG
#define QT_STAT_DIR _S_IFDIR
#define QT_STAT_MASK _S_IFMT
#if defined(_S_IFLNK)
# define QT_STAT_LNK _S_IFLNK
#endif
#define QT_FILENO _fileno
#define QT_OPEN ::_open
#define QT_CLOSE ::_close
#ifdef QT_LARGEFILE_SUPPORT
#define QT_LSEEK ::_lseeki64
#ifndef UNICODE
#define QT_TSTAT ::_stati64
#else
#define QT_TSTAT ::_wstati64
#endif
#else
#define QT_LSEEK ::_lseek
#ifndef UNICODE
#define QT_TSTAT ::_stat
#else
#define QT_TSTAT ::_wstat
#endif
#endif
#define QT_READ ::_read
#define QT_WRITE ::_write
#define QT_ACCESS ::_access
#define QT_GETCWD ::_getcwd
#define QT_CHDIR ::_chdir
#define QT_MKDIR ::_mkdir
#define QT_RMDIR ::_rmdir
#define QT_OPEN_LARGEFILE 0
#define QT_OPEN_RDONLY _O_RDONLY
#define QT_OPEN_WRONLY _O_WRONLY
#define QT_OPEN_RDWR _O_RDWR
#define QT_OPEN_CREAT _O_CREAT
#define QT_OPEN_TRUNC _O_TRUNC
#define QT_OPEN_APPEND _O_APPEND
#if defined(O_TEXT)
# define QT_OPEN_TEXT _O_TEXT
# define QT_OPEN_BINARY _O_BINARY
#endif
#define QT_FOPEN ::fopen
#ifdef QT_LARGEFILE_SUPPORT
#define QT_FSEEK ::fseeko64
#define QT_FTELL ::ftello64
#else
#define QT_FSEEK ::fseek
#define QT_FTELL ::ftell
#endif
#define QT_FGETPOS ::fgetpos
#define QT_FSETPOS ::fsetpos
#define QT_FPOS_T fpos_t
#ifdef QT_LARGEFILE_SUPPORT
#define QT_OFF_T off64_t
#else
#define QT_OFF_T long
#endif
#define QT_SIGNAL_ARGS int
#define QT_VSNPRINTF ::_vsnprintf
#define QT_SNPRINTF ::_snprintf
# define F_OK 0
# define X_OK 1
# define W_OK 2
# define R_OK 4
#endif // QPLATFORMDEFS_H
|
Solution
Unknown.
[1] http://bugreports.qt.nokia.com/browse/QTSDK-46
Please see at: http://bugreports.qt.nokia.com/browse/QTSDK-13 (Tim Jenssen added a comment - 04/May/10 03:04 PM: Related to this: http://labs.trolltech.com/blogs/2007/01/30/qtmsys/ qmake is using the wrong MakeFile format(unix), because it found sh.exe. Please remove the sh.exe from PATH variable and it should work. )
|
Because [1] refers to [2], [2] refers to [3] and [3] is about Windows, it is not applicable to solve this problem.
[2] http://bugreports.qt.nokia.com/browse/QTSDK-13
Related to this: http://labs.trolltech.com/blogs/2007/01/30/qtmsys/ qmake is using the wrong MakeFile format(unix), because it found sh.exe. Please remove the sh.exe from PATH variable and it should work.
|
Because [2] refers to [3] and [3] is about Windows, it is not applicable to solve this problem.
[3] http://labs.qt.nokia.com/2007/01/30/qtmsys
Users of Qt/MinGW have been restricted to compiling and using Qt with the Windows shell cmd.exe. Compilation of Qt would fail even with the presence of the MSYS shell sh.exe in the PATH. This caveat, has over the years, resulted in very many user complaints including this, this, this, this, this and not to mention lots of support requests.
|
Because [3] is about Windows, it is not applicable to solve this problem.
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.
