PDA

View Full Version : help needed with complicated project



Muzz
15th February 2008, 00:10
Hello everybody,

Im busy with a new/old project that has to been used QT 4.2.0, I use the follow software to develop with QT:

Microsoft Visual C++ 2005 Express - V: 8.0.50727.42
QT 4.2.0 (Installed in D:\qt-win-4.2.0)

The follow environment variables in Windows XP are set:

QMAKESPEC => win32-msvc2005
PATH => D:\qt-win-4.2.0\lib;D:\qt-win-4.2.0\bin

In Microsoft Visual C++ 2005 Express in the Options dialog, At Project and Solutions, VC++ Directories, The follow directories are set:

LIBRARY: D:\qt-win-4.2.0\lib
(Visual Studio makefile returns: d:\qt-win-4.2.0\lib\qtmain.lib d:\qt-win-4.2.0\lib\QtGui4.lib d:\qt-win-4.2.0\lib\QtCore4.lib)

I've used a community patch for 4.2.X to configure this QT Release to enable it in Visual Studio 2005 Express, The follow problem when I try to compile my project in an release, It fails on many things that I do not follow.

I've got the follow directory structure:

src/images (My images I use within my program)
src/include (My included files to refer to in my source)
src/xmpp (Some connection header files and CPP's, Used by source)

src/ itselfs has several .h and .cpp and .ui files. The next few files are differents like my generated .PRO file:


################################################## ####################
# Automatically generated by qmake (2.01a) vr 15. feb 00:42:54 2008
################################################## ####################

TEMPLATE = app
TARGET =
DEPENDPATH += . include xmpp
INCLUDEPATH += .

# Input
HEADERS += aboutdialog.h \
accountdialog.h \
appdatachannel.h \
chatdialog.h \
editgroupsdialog.h \
eventqueue.h \
generaloptionswidget.h \
loginpane.h \
mainwindow.h \
MinimizeToTray.h \
nodetabwidget.h \
nodetreewidget.h \
options.h \
optionsdialog.h \
pluginmanager.h \
pluginoptionswidget.h \
rosterdomainview.h \
rostergroupview.h \
rosteronlineview.h \
rosteroptionswidget.h \
rosterpane.h \
rosterplugin.h \
rosterview.h \
selectcontactdialog.h \
systemmsgdialog.h \
useraccount.h \
include/conversation.h \
include/node.h \
include/plugin.h \
include/roster.h \
include/socket.h \
include/urihandler.h \
include/user.h \
xmpp/dnssrv.h \
xmpp/httpsproxy.h \
xmpp/iqauth.h \
xmpp/jabberauth.h \
xmpp/proxy.h \
xmpp/registerauth.h \
xmpp/saslmd5.h \
xmpp/saslmech.h \
xmpp/saslplain.h \
xmpp/socks5proxy.h \
xmpp/sslsocket.h \
xmpp/xmppauth.h \
xmpp/xmppstream.h \
xmpp/xmppversion.h \
../plugins/privacy/privacy.h \
../plugins/filetransfer/filetransfer.h
FORMS += aboutdialog.ui \
accountdialog.ui \
editgroupsdialog.ui \
generaloptionswidget.ui \
logindialog.ui \
optionsdialog.ui \
pluginoptionswidget.ui \
rosteroptionswidget.ui \
selectcontactdialog.ui \
systemmsgdialog.ui
SOURCES += aboutdialog.cpp \
accountdialog.cpp \
appdatachannel_win.cpp \
chatdialog.cpp \
editgroupsdialog.cpp \
eventqueue.cpp \
generaloptionswidget.cpp \
loginpane.cpp \
main.cpp \
mainwindow.cpp \
MinimizeToTray.cpp \
nodetabwidget.cpp \
nodetreewidget.cpp \
optionsdialog.cpp \
pluginmanager.cpp \
pluginoptionswidget.cpp \
rosterdomainview.cpp \
rostergroupview.cpp \
rosteronlineview.cpp \
rosteroptionswidget.cpp \
rosterpane.cpp \
rosterplugin.cpp \
rosterview.cpp \
selectcontactdialog.cpp \
systemmsgdialog.cpp \
useraccount.cpp \
xmpp/dnssrv.cpp \
xmpp/dnssrv_unix.cpp \
xmpp/dnssrv_win.cpp \
xmpp/httpsproxy.cpp \
xmpp/iqauth.cpp \
xmpp/proxy.cpp \
xmpp/registerauth.cpp \
xmpp/saslmd5.cpp \
xmpp/saslplain.cpp \
xmpp/socks5proxy.cpp \
xmpp/sslsocket.cpp \
xmpp/xmppauth.cpp \
xmpp/xmppstream.cpp \
xmpp/xmppversion.cpp
RESOURCES += lol.qrc

When I open the "Visual Studio 2005 Command Prompt" and type: qmake -project within the src directory, it doesn't fail, Afterwartds, I do qmake -nomoc (That doesnt help since MSVC Solution Explorer gives alot of MOC_.....h or MOC_....Cpp files. When I do qmake -tp vc, it generates the .vcproj and I can open my project.

The follow debug is available from the VSMC IDE:

1>------ Build started: Project: lol, Configuration: Release Win32 ------
1>RCC lol.qrc
1>MOC xmpp\xmppstream.h
1>MOC systemmsgdialog.h
1>MOC xmpp\sslsocket.h
1>MOC xmpp\socks5proxy.h
1>MOC selectcontactdialog.h
1>MOC rosterplugin.h
1>rosterplugin.h(69): Error: Undefined interface
1>Project : error PRJ0019: A tool returned an error code from "MOC rosterplugin.h"
1>lol - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

nmake in the "Visual Studio 2005 Command Prompt" gives the follow debug:


Microsoft (R) Program Maintenance Utility Version 7.00.8882
Copyright (C) Microsoft Corp 1988-2000. All rights reserved.

nmake -f Makefile.Release

Microsoft (R) Program Maintenance Utility Version 7.00.8882
Copyright (C) Microsoft Corp 1988-2000. All rights reserved.

d:\qt-win-4.2.0\bin\moc.exe -DUNICODE -DQT_LARGEFILE_SUPPORT -DWIN32 -D_
CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DQT_DLL -DQT_NO_DEBUG -DQT_
GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"D:/qt-win-4.2.0/include/QtCore" -I"
D:/qt-win-4.2.0/include/QtCore" -I"D:/qt-win-4.2.0/include/QtGui" -I"D:/qt-win-4
.2.0/include/QtGui" -I"D:/qt-win-4.2.0/include" -I"." -I"D:/qt-win-4.2.0/include
/ActiveQt" -I"release" -I"." -I"..\..\..\qt-win-4.2.0\mkspecs\win32-msvc2005" ma
inwindow.h -o release\moc_mainwindow.cpp
mainwindow.h(48): Error: Undefined interface
NMAKE : fatal error U1077: 'd:\qt-win-4.2.0\bin\moc.exe' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\n
make.exe"' : return code '0x2'
Stop.
And if I exclude the 'mainwindow.cpp' another file will give an Undefined interface error.

How could I solve this and build my compiled EXE? Thank you.

jpn
15th February 2008, 06:56
And what do rosterplugin.h and mainwindow.h look like? Could you attach them?

Muzz
15th February 2008, 07:03
Hi,

The file's are Attached to this post.

Thank you.

jpn
15th February 2008, 07:15
Hmm, Q_INTERFACES() (http://doc.trolltech.com/latest/qobject.html#Q_INTERFACES) is used when implementing plugins but you're compiling everything in one pass. Do you have the original .pro file(s)?

Muzz
15th February 2008, 07:42
Yes, They are posted in this reply,

The linq.pro is in /
The src.pro is in /src/
The liblinq.pro is in /src/liblinq/
The libidn.pro is in /src/libidn/

jpn
15th February 2008, 07:51
So, what happens if you build the project with its original .pro files (eg. without using "qmake -project")?

Muzz
15th February 2008, 08:12
I open the "Visual Studio 2005 Command Prompt" and go to the follow directory "D:/lol", In that directory I've the follow directories "src" but I do not go to that directory because there is linq.pro in "D:/lol".

When I do qmake nothing happends, but generated the MAKEFILE.
D:\hyves\src>qmake

D:\hyves\src>

And when I do nmake, The follow appears:

Microsoft (R) Program Maintenance Utility Version 7.00.8882
Copyright (C) Microsoft Corp 1988-2000. All rights reserved.

cd zlib && D:\qt-win-4.2.0\bin\qmake.exe zlib.pro -win32 -o Makefile
cd zlib && nmake -f Makefile

Microsoft (R) Program Maintenance Utility Version 7.00.8882
Copyright (C) Microsoft Corp 1988-2000. All rights reserved.

nmake -f Makefile.Release

Microsoft (R) Program Maintenance Utility Version 7.00.8882
Copyright (C) Microsoft Corp 1988-2000. All rights reserved.

cl -c -nologo -Zm200 -GS -O2 -MD -DNDEBUG -W3 -DUNICODE -DQT_LARGEFILE_S
UPPORT -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -I"." -I".
.\..\..\qt-win-4.2.0\mkspecs\win32-msvc2005" -Forelease\ @C:\DOCUME~1\Rick\LOCAL
S~1\Temp\nm169.tmp
adler32.c
compress.c
crc32.c
deflate.c
example.c
gzio.c
infback.c
inffast.c
inflate.c
inftrees.c
minigzip.c
trees.c
uncompr.c
zutil.c
Generating Code...
lib /NOLOGO /OUT:"release\zlib.lib" @C:\DOCUME~1\Rick\LOCALS~1\Temp\nm16
A.tmp
example.obj : warning LNK4006: _main already defined in minigzip.obj; second def
inition ignored
cd libcrypt && D:\qt-win-4.2.0\bin\qmake.exe libcrypt.pro -win32 -o Make
file
cd libcrypt && nmake -f Makefile

Microsoft (R) Program Maintenance Utility Version 7.00.8882
Copyright (C) Microsoft Corp 1988-2000. All rights reserved.

nmake -f Makefile.Release

Microsoft (R) Program Maintenance Utility Version 7.00.8882
Copyright (C) Microsoft Corp 1988-2000. All rights reserved.

cl -c -nologo -Zm200 -GS -O2 -MD -DNDEBUG -GR -EHsc -W3 -DUNICODE -DQT_L
ARGEFILE_SUPPORT -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
-I"." -I"..\..\..\qt-win-4.2.0\mkspecs\win32-msvc2005" -Forelease\ @C:\DOCUME~1\
Rick\LOCALS~1\Temp\nm16B.tmp
md5.cpp
cl -c -nologo -Zm200 -GS -O2 -MD -DNDEBUG -W3 -DUNICODE -DQT_LARGEFILE_S
UPPORT -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -I"." -I".
.\..\..\qt-win-4.2.0\mkspecs\win32-msvc2005" -Forelease\ @C:\DOCUME~1\Rick\LOCAL
S~1\Temp\nm16C.tmp
sha.c
lib /NOLOGO /OUT:"release\crypt.lib" @C:\DOCUME~1\Rick\LOCALS~1\Temp\nm1
6D.tmp
cd libidn && D:\qt-win-4.2.0\bin\qmake.exe libidn.pro -win32 -o Makefile

cd libidn && nmake -f Makefile

Microsoft (R) Program Maintenance Utility Version 7.00.8882
Copyright (C) Microsoft Corp 1988-2000. All rights reserved.

nmake -f Makefile.Release

Microsoft (R) Program Maintenance Utility Version 7.00.8882
Copyright (C) Microsoft Corp 1988-2000. All rights reserved.

cl -c -nologo -Zm200 -GS -O2 -MD -DNDEBUG -W0 -DUNICODE -DQT_LARGEFILE_S
UPPORT -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -I"." -I".
" -I"..\..\..\qt-win-4.2.0\mkspecs\win32-msvc2005" -Forelease\ @C:\DOCUME~1\Rick
\LOCALS~1\Temp\nm16E.tmp
nfkc.c
d:\lol\src\libidn\stringprep.h(31) : fatal error C1083: Cannot open include fi
le: 'unistd.h': No such file or directory
profiles.c
d:\lol\src\libidn\stringprep.h(31) : fatal error C1083: Cannot open include fi
le: 'unistd.h': No such file or directory
rfc3454.c
d:\lol\src\libidn\stringprep.h(31) : fatal error C1083: Cannot open include fi
le: 'unistd.h': No such file or directory
stringprep.c
d:\lol\src\libidn\stringprep.h(31) : fatal error C1083: Cannot open include fi
le: 'unistd.h': No such file or directory
toutf8.c
d:\lol\src\libidn\stringprep.h(31) : fatal error C1083: Cannot open include fi
le: 'unistd.h': No such file or directory
Generating Code...
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\n
make.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.

jpn
15th February 2008, 08:15
Do you have Platform SDK installed?

Muzz
15th February 2008, 08:17
Yes I have, That was about 500 Megs. I've double checked right now since I have tested it with an sample source just made to look if windows.h will be included in VS Express.

jpn
15th February 2008, 08:22
Did you follow step 3: http://msdn2.microsoft.com/en-us/express/aa700755.aspx?

Muzz
15th February 2008, 09:09
Yes, olso checked with making an Win32 example source without ATL ect ect.

jpn
15th February 2008, 09:16
Hmm, is unistd.h available on Windows at all? :)

Muzz
15th February 2008, 09:54
Mhh downloaded a new release of that package that was needed, Working now. Gonne debug other .PRO files in order to compile, Thanks for your help!