PDA

View Full Version : nmake error during .pro compiling



mattia
18th June 2008, 08:48
Hi,
I tried to install Qt 4.4.0 under windows XP, I thought I did it in the right way but I'm not able to compile, for example, if I try to compile the project in "examples\dialogs\sipdialog\" I get this error:


sipdialog.pro(6): fatal error U1001: syntax error: character '.' not valid in the marco

i compiled it with "nmake sipdialog.pro".
Thanks so much!



HEADERS = dialog.h
SOURCES = main.cpp \
dialog.cpp

# install
target.path = $$[QT_INSTALL_EXAMPLES]/dialogs/sipdialog
sources.files = $$SOURCES $$HEADERS *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/dialogs/sipdialog
INSTALLS += target sources
wince50standard-x86-msvc2005: LIBS += libcmt.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib ws2.lib

jpn
18th June 2008, 09:09
i compiled it with "nmake sipdialog.pro".

nmake doesn't handle qmake project files. Just generate a makefile with plain "qmake" first and then compile the project with "nmake".

mattia
18th June 2008, 09:21
I tried to do as you advise me, and something is moving but i get this error now:


D:\Qt\4.4.0\examples\dialogs\sipdialog>nmake

Microsoft (R) Program Maintenance Utility Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.

"C:\Programmi\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe" -f Makefile.
Debug all

Microsoft (R) Program Maintenance Utility Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.

g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_S
UPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
-I'../../../include/QtCore' -I'../../../include/QtCore' -I'../../../include/QtGu
i' -I'../../../include/QtGui' -I'../../../include' -I'.' -I'd:/Qt/4.4.0/include/
ActiveQt' -I'tmp/moc/debug_shared' -I'.' -I'../../../mkspecs/win32-g++' -o tmp/o
bj/debug_shared/dialog.o dialog.cpp
dialog.cpp:44:17: QtGui: No such file or directory
In file included from dialog.cpp:46:
dialog.h:47:19: QDialog: No such file or directory
In file included from dialog.cpp:46:
dialog.h:51: error: expected class-name before '{' token
dialog.h:54: error: ISO C++ forbids declaration of `Q_OBJECT' with no type
dialog.h:54: error: expected `;' before "public"
dialog.h:59: error: `QRect' does not name a type
dialog.h:61: error: expected `:' before "slots"
dialog.h:62: error: expected primary-expression before "void"
dialog.h:62: error: ISO C++ forbids declaration of `slots' with no type
dialog.h:62: error: expected `;' before "void"
dialog.cpp:50: error: definition of implicitly-declared `Dialog::Dialog()'
dialog.cpp:50: error: declaration of `Dialog::Dialog()' throws different excepti
ons
dialog.h:51: error: than previous declaration `Dialog::Dialog() throw ()'
dialog.cpp: In constructor `Dialog::Dialog()':
dialog.cpp:51: error: `desktopGeometry' was not declared in this scope
dialog.cpp:51: error: `QApplication' has not been declared
dialog.cpp:51: error: `desktop' was not declared in this scope
dialog.cpp:53: error: `tr' was not declared in this scope
dialog.cpp:53: error: `setWindowTitle' was not declared in this scope
dialog.cpp:54: error: `QScrollArea' was not declared in this scope
dialog.cpp:54: error: `scrollArea' was not declared in this scope
dialog.cpp:54: error: `QScrollArea' is not a type
dialog.cpp:55: error: `QGroupBox' was not declared in this scope
dialog.cpp:55: error: `groupBox' was not declared in this scope
dialog.cpp:55: error: `QGroupBox' is not a type
dialog.cpp:57: error: `QGridLayout' was not declared in this scope
dialog.cpp:57: error: `gridLayout' was not declared in this scope
dialog.cpp:57: error: `QGridLayout' is not a type
dialog.cpp:62: error: `QLineEdit' was not declared in this scope
dialog.cpp:62: error: `lineEdit' was not declared in this scope
dialog.cpp:62: error: `QLineEdit' is not a type
dialog.cpp:66: error: `QLabel' was not declared in this scope
dialog.cpp:66: error: `label' was not declared in this scope
dialog.cpp:66: error: `QLabel' is not a type
dialog.cpp:70: error: `QPushButton' was not declared in this scope
dialog.cpp:70: error: `button' was not declared in this scope
dialog.cpp:70: error: `QPushButton' is not a type
dialog.cpp:88: error: `QHBoxLayout' was not declared in this scope
dialog.cpp:88: error: `layout' was not declared in this scope
dialog.cpp:88: error: `QHBoxLayout' is not a type
dialog.cpp:90: error: `setLayout' was not declared in this scope
dialog.cpp:91: error: `Qt' has not been declared
dialog.cpp:91: error: `ScrollBarAlwaysOff' was not declared in this scope
dialog.cpp:95: error: `pressed' was not declared in this scope
dialog.cpp:95: error: `SIGNAL' was not declared in this scope
dialog.cpp:96: error: `qApp' was not declared in this scope
dialog.cpp:96: error: `closeAllWindows' was not declared in this scope
dialog.cpp:96: error: `SLOT' was not declared in this scope
dialog.cpp:96: error: `connect' was not declared in this scope
dialog.cpp:97: error: `QApplication' has not been declared
dialog.cpp:97: error: expected primary-expression before "int"
dialog.cpp:97: error: `workAreaResized' was not declared in this scope
dialog.cpp:98: error: expected primary-expression before "int"
dialog.cpp:98: error: `desktopResized' was not declared in this scope
dialog.cpp:53: warning: unused variable 'setWindowTitle'
dialog.cpp:54: warning: unused variable 'QScrollArea'
dialog.cpp:55: warning: unused variable 'QGroupBox'
dialog.cpp:57: warning: unused variable 'QGridLayout'
dialog.cpp:62: warning: unused variable 'QLineEdit'
dialog.cpp:66: warning: unused variable 'QLabel'
dialog.cpp:70: warning: unused variable 'QPushButton'
dialog.cpp:88: warning: unused variable 'QHBoxLayout'
dialog.cpp:90: warning: unused variable 'setLayout'
dialog.cpp:91: warning: unused variable 'ScrollBarAlwaysOff'
dialog.cpp:95: warning: unused variable 'pressed'
dialog.cpp:96: warning: unused variable 'qApp'
dialog.cpp:96: warning: unused variable 'closeAllWindows'
dialog.cpp:97: warning: unused variable 'workAreaResized'
dialog.cpp:98: warning: unused variable 'desktopResized'
dialog.cpp: At global scope:
dialog.cpp:104: error: no `void Dialog::desktopResized(int)' member function dec
lared in class `Dialog'
dialog.cpp: In member function `void Dialog::reactToSIP()':
dialog.cpp:114: error: `QRect' was not declared in this scope
dialog.cpp:114: error: expected `;' before "availableGeometry"
dialog.cpp:116: error: `desktopGeometry' was not declared in this scope
dialog.cpp:116: error: `availableGeometry' was not declared in this scope
dialog.cpp:118: error: `windowState' was not declared in this scope
dialog.cpp:118: error: `Qt' has not been declared
dialog.cpp:118: error: `WindowMaximized' was not declared in this scope
dialog.cpp:118: error: `setWindowState' was not declared in this scope
dialog.cpp:119: error: `setGeometry' was not declared in this scope
dialog.cpp:118: warning: unused variable 'windowState'
dialog.cpp:118: warning: unused variable 'WindowMaximized'
dialog.cpp:118: warning: unused variable 'setWindowState'
dialog.cpp:119: warning: unused variable 'setGeometry'
dialog.cpp:121: error: `windowState' was not declared in this scope
dialog.cpp:121: error: `Qt' has not been declared
dialog.cpp:121: error: `WindowMaximized' was not declared in this scope
dialog.cpp:121: error: `setWindowState' was not declared in this scope
dialog.cpp:121: warning: unused variable 'windowState'
dialog.cpp:121: warning: unused variable 'WindowMaximized'
dialog.cpp:121: warning: unused variable 'setWindowState'
dialog.cpp:124: error: `desktopGeometry' was not declared in this scope
dialog.cpp:124: error: `availableGeometry' was not declared in this scope
dialog.cpp:114: warning: unused variable 'QRect'
dialog.cpp:124: warning: unused variable 'desktopGeometry'
dialog.cpp:124: warning: unused variable 'availableGeometry'
NMAKE : fatal error U1077: 'C:\MinGW\bin\g++.EXE' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Programmi\Microsoft Visual Studio 9.0\VC\BIN\nma
ke.exe"' : return code '0x2'
Stop.

i think, it's a installation problem...how can i fix it? Is there a manual about how to install Qt under win?
Regards,

jpn
18th June 2008, 09:29
Your Qt installation is for MinGW. You cannot use it with Visual Studio just like that. You have to download the source package of Qt and compile it yourself for Visual Studio.


download qt-win-opensource-src-4.4.0.zip (ftp://ftp.trolltech.com/qt/source/qt-win-opensource-src-4.4.0.zip)
unarchive the package
run configure script
compile it according to instructions on the screen

See also Installing Qt/Windows (http://doc.trolltech.com/4.4/install-win.html) and Qt4 with Visual Studio.

mattia
18th June 2008, 09:40
i compiled Qt library as in:
http://doc.trolltech.com/4.4/install-win.html
with:


D:
cd \Qt\4.4.0
configure

i was looking how to configure VS here:
http://wiki.qtcentre.org/index.php?title=Qt4_with_Visual_Studio
and I'm not able to understand where to find qconfigure script:


When you have decided about which options to use, call the qconfigure script that was created by the ACS patch. The script accepts the version of your Visual Studio following by any set of the configure options you want to be active.

Do i need to download a patch? i'm using Qt 4.4.0

jpn
18th June 2008, 10:15
and I'm not able to understand where to find qconfigure script
Use "configure".


Do i need to download a patch? i'm using Qt 4.4.0
No, as the article says, it's no more needed for Qt versions 4.3.2 and greater.