Results 1 to 1 of 1
Hello, I am trying to compile a simple program for Windows from Linux. I've build my CMakeList.txt,
Code:
# specify the cross compiler
SET(CMAKE_C_COMPILER /usr/bin/i586-mingw32msvc-gcc)
SET(CMAKE_CXX_COMPILER /usr/bin/i586-mingw32msvc-g++)
cmake_minimum_required(VERSION 2.4.0)
find_package(Qt4 ...
- 12-08-2009 #1Just Joined!
- Join Date
- Oct 2007
- Posts
- 47
CMake trouble
Hello, I am trying to compile a simple program for Windows from Linux. I've build my CMakeList.txt,
and then I hitCode:# specify the cross compiler SET(CMAKE_C_COMPILER /usr/bin/i586-mingw32msvc-gcc) SET(CMAKE_CXX_COMPILER /usr/bin/i586-mingw32msvc-g++) cmake_minimum_required(VERSION 2.4.0) find_package(Qt4 REQUIRED) include(${QT_USE_FILE}) set(AmbLogScr_SRCS main.cpp timesheetdialog.cpp ) set(AmbLogScr_MOC_SRCS timesheetdialog.h ) set(AmbLogScr_UIS timesheetdialog.ui ) qt4_wrap_cpp(AmbLogScr_MOCS ${AmbLogScr_MOC_SRCS}) qt4_wrap_ui(AmbLogScr_UIS_H ${AmbLogScr_UIS}) qt4_wrap_cpp(AmbLogScr_MOC_UI ${AmbLogScr_UIS_H}) qt4_add_resources(AmbLogScr_RCC_SRCS ${AmbLogScr_RCCS}) add_definitions(-DQT_NO_DEBUG) add_executable(AmbLogScr ${AmbLogScr_SRCS} ${AmbLogScr_MOCS} ${AmbLogScr_MOC_UI} ${AmbLogScr_RCC_SRCS}) target_link_libraries(AmbLogScr ${QT_LIBRARIES} pthread)
cmake ./
make
and it comes up with the following
I honestly dont know what it means. :'( I am not use to cross compiling, and I dont know an easier way to compile for windows.Code:luke@luk:~/Documents/Work/AmbLogScr$ cmake ./ -- Configuring done -- Generating done -- Build files have been written to: /home/luke/Documents/Work/AmbLogScr luke@luk:~/Documents/Work/AmbLogScr$ make ./ luke@luk:~/Documents/Work/AmbLogScr$ make [ 14%] Building CXX object CMakeFiles/AmbLogScr.dir/main.o In file included from /usr/include/qt4/QtGui/qapplication.h:46, from /usr/include/qt4/QtGui/QApplication:1, from /home/luke/Documents/Work/AmbLogScr/main.cpp:1: /usr/include/qt4/QtGui/qwindowdefs.h:110:35: error: QtGui/qwindowdefs_win.h: No such file or directory In file included from /usr/include/qt4/QtGui/qapplication.h:46, from /usr/include/qt4/QtGui/QApplication:1, from /home/luke/Documents/Work/AmbLogScr/main.cpp:1: /usr/include/qt4/QtGui/qwindowdefs.h:138: error: ‘WId’ was not declared in this scope /usr/include/qt4/QtGui/qwindowdefs.h:138: error: template argument 1 is invalid /usr/include/qt4/QtGui/qwindowdefs.h:138: error: invalid type in declaration before ‘;’ token In file included from /usr/include/qt4/QtGui/qapplication.h:49, from /usr/include/qt4/QtGui/QApplication:1, from /home/luke/Documents/Work/AmbLogScr/main.cpp:1: /usr/include/qt4/QtGui/qcursor.h:115: error: ‘HCURSOR’ does not name a type /usr/include/qt4/QtGui/qcursor.h:116: error: expected `)' before ‘cursor’ In file included from /usr/include/qt4/QtGui/qwidget.h:47, from /usr/include/qt4/QtGui/qdialog.h:45, from /usr/include/qt4/QtGui/QDialog:1, from /home/luke/Documents/Work/AmbLogScr/timesheetdialog.h:4, from /home/luke/Documents/Work/AmbLogScr/main.cpp:3: /usr/include/qt4/QtGui/qpaintdevice.h:87: error: ‘HDC’ does not name a type /usr/include/qt4/QtGui/qpaintdevice.h:88: error: ‘HDC’ has not been declared In file included from /usr/include/qt4/QtGui/qpalette.h:46, from /usr/include/qt4/QtGui/qwidget.h:48, from /usr/include/qt4/QtGui/qdialog.h:45, from /usr/include/qt4/QtGui/QDialog:1, from /home/luke/Documents/Work/AmbLogScr/timesheetdialog.h:4, from /home/luke/Documents/Work/AmbLogScr/main.cpp:3: /usr/include/qt4/QtGui/qcolor.h:241: warning: ‘QDataStream& operator<<(QDataStream&, const QColor&)’ redeclared without dllimport attribute: previous dllimport ignored /usr/include/qt4/QtGui/qcolor.h:242: warning: ‘QDataStream& operator>>(QDataStream&, QColor&)’ redeclared without dllimport attribute: previous dllimport ignored In file included from /usr/include/qt4/QtGui/qmatrix.h:46, from /usr/include/qt4/QtGui/qbrush.h:49, from /usr/include/qt4/QtGui/qpalette.h:47, from /usr/include/qt4/QtGui/qwidget.h:48, from /usr/include/qt4/QtGui/qdialog.h:45, from /usr/include/qt4/QtGui/QDialog:1, from /home/luke/Documents/Work/AmbLogScr/timesheetdialog.h:4, from /home/luke/Documents/Work/AmbLogScr/main.cpp:3: /usr/include/qt4/QtGui/qregion.h:145: error: ‘HRGN’ does not name a type /usr/include/qt4/QtGui/qregion.h:195: error: ‘HRGN’ does not name a type In file included from /usr/include/qt4/QtGui/qtransform.h:45, from /usr/include/qt4/QtGui/qbrush.h:50, from /usr/include/qt4/QtGui/qpalette.h:47, from /usr/include/qt4/QtGui/qwidget.h:48, from /usr/include/qt4/QtGui/qdialog.h:45, from /usr/include/qt4/QtGui/QDialog:1, from /home/luke/Documents/Work/AmbLogScr/timesheetdialog.h:4, from /home/luke/Documents/Work/AmbLogScr/main.cpp:3: /usr/include/qt4/QtGui/qpainterpath.h:233: warning: ‘QDataStream& operator<<(QDataStream&, const QPainterPath&)’ redeclared without dllimport attribute: previous dllimport ignored /usr/include/qt4/QtGui/qpainterpath.h:234: warning: ‘QDataStream& operator>>(QDataStream&, QPainterPath&)’ redeclared without dllimport attribute: previous dllimport ignored In file included from /usr/include/qt4/QtGui/qbrush.h:52, from /usr/include/qt4/QtGui/qpalette.h:47, from /usr/include/qt4/QtGui/qwidget.h:48, from /usr/include/qt4/QtGui/qdialog.h:45, from /usr/include/qt4/QtGui/QDialog:1, from /home/luke/Documents/Work/AmbLogScr/timesheetdialog.h:4, from /home/luke/Documents/Work/AmbLogScr/main.cpp:3: /usr/include/qt4/QtGui/qpixmap.h:112: error: ‘WId’ has not been declared /usr/include/qt4/QtGui/qpixmap.h:146: error: ‘HBITMAP’ does not name a type /usr/include/qt4/QtGui/qpixmap.h:147: error: ‘HBITMAP’ has not been declared In file included from /usr/include/qt4/QtGui/qwidget.h:49, from /usr/include/qt4/QtGui/qdialog.h:45, from /usr/include/qt4/QtGui/QDialog:1, from /home/luke/Documents/Work/AmbLogScr/timesheetdialog.h:4, from /home/luke/Documents/Work/AmbLogScr/main.cpp:3: /usr/include/qt4/QtGui/qfont.h:227: error: ‘HFONT’ does not name a type In file included from /usr/include/qt4/QtGui/qwidget.h:56, from /usr/include/qt4/QtGui/qdialog.h:45, from /usr/include/qt4/QtGui/QDialog:1, from /home/luke/Documents/Work/AmbLogScr/timesheetdialog.h:4, from /home/luke/Documents/Work/AmbLogScr/main.cpp:3: /usr/include/qt4/QtGui/qkeysequence.h:199: warning: ‘QDataStream& operator<<(QDataStream&, const QKeySequence&)’ redeclared without dllimport attribute: previous dllimport ignored /usr/include/qt4/QtGui/qkeysequence.h:200: warning: ‘QDataStream& operator>>(QDataStream&, QKeySequence&)’ redeclared without dllimport attribute: previous dllimport ignored In file included from /usr/include/qt4/QtGui/qdialog.h:45, from /usr/include/qt4/QtGui/QDialog:1, from /home/luke/Documents/Work/AmbLogScr/timesheetdialog.h:4, from /home/luke/Documents/Work/AmbLogScr/main.cpp:3: /usr/include/qt4/QtGui/qwidget.h:105: error: ‘WId’ does not name a type /usr/include/qt4/QtGui/qwidget.h:232: error: ‘WId’ does not name a type /usr/include/qt4/QtGui/qwidget.h:234: error: ‘WId’ does not name a type /usr/include/qt4/QtGui/qwidget.h:235: error: ‘WId’ does not name a type /usr/include/qt4/QtGui/qwidget.h:565: error: expected ‘;’ before ‘(’ token /usr/include/qt4/QtGui/qwidget.h:583: error: ‘HDC’ does not name a type /usr/include/qt4/QtGui/qwidget.h:584: error: ‘HDC’ has not been declared /usr/include/qt4/QtGui/qwidget.h:682: error: ‘WId’ has not been declared make[2]: *** [CMakeFiles/AmbLogScr.dir/main.o] Error 1 make[1]: *** [CMakeFiles/AmbLogScr.dir/all] Error 2 make: *** [all] Error 2 luke@luk:~/Documents/Work/AmbLogScr$


Reply With Quote