PDA

View Full Version : Linux -> Windows port issue (signals)



robertogoberto
21st September 2009, 05:37
Hello,

I'm having an issue porting one of my applications to Windows, I'm using Qt 4.5.2 OSE combined with VS2008. The problem is none of the signals/slots seem to work. I get this:

Object::connect: No such signal QAction::activated() in d:\projects\cc\qteditor\
ui_mainwindow.h:100
Object::connect: (sender name: 'actionQuit')
Object::connect: (receiver name: 'MainWindow')
Object::connect: No such signal QAction::activated() in .\window.cpp:22
Object::connect: (sender name: 'actionNew')
Object::connect: (receiver name: 'MainWindow')
Object::connect: No such signal QAction::activated() in .\window.cpp:23
Object::connect: (sender name: 'actionOpen')
Object::connect: (receiver name: 'MainWindow')
Object::connect: No such signal QAction::activated() in .\window.cpp:24
Object::connect: (sender name: 'actionSave')
Object::connect: (receiver name: 'MainWindow')
Object::connect: No such signal QAction::activated() in .\window.cpp:25
Object::connect: (sender name: 'actionSave_as')
Object::connect: (receiver name: 'MainWindow')
Object::connect: No such signal QAction::activated() in .\window.cpp:26
Object::connect: (sender name: 'actionAbout')
Object::connect: (receiver name: 'MainWindow')
This is especially maddening since the application builds fine in Windows, builds and runs fine -- it does not have this issue -- in Linux.

Here is the buildlog

"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\nmake.exe" -f Makefile.Debug
c:\Qt\2009.03\qt\bin\uic.exe mainwindow.ui -o ui_mainwindow.h
C:\Qt\2009.03\qt\bin\moc.exe -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"c:\Qt\2009.03\qt\include\QtCore" -I"c:\Qt\2009.03\qt\include\QtGui" -I"c:\Qt\2009.03\qt\include" -I"c:\SDL-1.2.13\include" -I"." -I"c:\Qt\2009.03\qt\include\ActiveQt" -I"debug" -I"." -I"c:\Qt\2009.03\qt\mkspecs\default" -D_MSC_VER=1500 -DWIN32 mapviewer.h -o debug\moc_mapviewer.cpp
C:\Qt\2009.03\qt\bin\moc.exe -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"c:\Qt\2009.03\qt\include\QtCore" -I"c:\Qt\2009.03\qt\include\QtGui" -I"c:\Qt\2009.03\qt\include" -I"c:\SDL-1.2.13\include" -I"." -I"c:\Qt\2009.03\qt\include\ActiveQt" -I"debug" -I"." -I"c:\Qt\2009.03\qt\mkspecs\default" -D_MSC_VER=1500 -DWIN32 window.h -o debug\moc_window.cpp
cl -c -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"c:\Qt\2009.03\qt\include\QtCore" -I"c:\Qt\2009.03\qt\include\QtGui" -I"c:\Qt\2009.03\qt\include" -I"c:\SDL-1.2.13\include" -I"." -I"c:\Qt\2009.03\qt\include\ActiveQt" -I"debug" -I"." -I"c:\Qt\2009.03\qt\mkspecs\default" -Fodebug\ @C:\Users\andrew\AppData\Local\Temp\nm7B37.tmp
editor.cpp
main.cpp
mainwindow.cpp
map.cpp
.\map.cpp(26) : warning C4100: 'primitive' : unreferenced formal parameter
.\map.cpp(56) : warning C4100: 'data' : unreferenced formal parameter
.\map.cpp(61) : warning C4100: 'odata' : unreferenced formal parameter
.\map.cpp(61) : warning C4100: 'nw' : unreferenced formal parameter
.\map.cpp(60) : warning C4100: 'nv' : unreferenced formal parameter
.\map.cpp(60) : warning C4100: 'v' : unreferenced formal parameter
.\map.cpp(140) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\stdio.h(237) : see declaration of 'fopen'
.\map.cpp(145) : warning C4189: 'w' : local variable is initialized but not referenced
.\map.cpp(145) : warning C4189: 'h' : local variable is initialized but not referenced
.\map.cpp(206) : warning C4189: 'breaker' : local variable is initialized but not referenced
.\map.cpp(314) : warning C4189: 'h' : local variable is initialized but not referenced
.\map.cpp(460) : warning C4018: '<' : signed/unsigned mismatch
.\map.cpp(483) : warning C4018: '<' : signed/unsigned mismatch
.\map.cpp(486) : warning C4018: '<' : signed/unsigned mismatch
.\map.cpp(488) : warning C4018: '<' : signed/unsigned mismatch
.\map.cpp(507) : warning C4018: '<' : signed/unsigned mismatch
.\map.cpp(533) : warning C4018: '<' : signed/unsigned mismatch
.\map.cpp(481) : warning C4189: 'continous' : local variable is initialized but not referenced
.\map.cpp(482) : warning C4189: 'distance' : local variable is initialized but not referenced
mapviewer.cpp
.\mapviewer.cpp(163) : warning C4100: 'e' : unreferenced formal parameter
.\mapviewer.cpp(320) : warning C4018: '<' : signed/unsigned mismatch
.\mapviewer.cpp(323) : warning C4018: '<' : signed/unsigned mismatch
.\mapviewer.cpp(340) : warning C4018: '<' : signed/unsigned mismatch
.\mapviewer.cpp(343) : warning C4018: '<' : signed/unsigned mismatch
.\mapviewer.cpp(347) : warning C4018: '<' : signed/unsigned mismatch
surface.cpp
window.cpp
Generating Code...
cl -c -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"c:\Qt\2009.03\qt\include\QtCore" -I"c:\Qt\2009.03\qt\include\QtGui" -I"c:\Qt\2009.03\qt\include" -I"c:\SDL-1.2.13\include" -I"." -I"c:\Qt\2009.03\qt\include\ActiveQt" -I"debug" -I"." -I"c:\Qt\2009.03\qt\mkspecs\default" -Fodebug\ @C:\Users\andrew\AppData\Local\Temp\nm90BA.tmp
moc_mapviewer.cpp
moc_window.cpp
Generating Code...
link /LIBPATH:"c:\Qt\2009.03\qt\lib" /NOLOGO /DEBUG /MANIFEST /MANIFESTFILE:"debug\qteditor.intermediate.manifest" /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /OUT:debug\qteditor.exe @C:\Users\andrew\AppData\Local\Temp\nm9760.tmp
MSVCRTD.lib(cinitexe.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
mt.exe -nologo -manifest "debug\qteditor.intermediate.manifest" -outputresource:debug\qteditor.exe;1

moc, uic, ... seem to be running correctly.

Here is the offending code.

connect(actionNew, SIGNAL(activated()), this, SLOT(reset()));
connect(actionOpen, SIGNAL(activated()), this, SLOT(open()));
connect(actionSave, SIGNAL(activated()), this, SLOT(save()));
connect(actionSave_as, SIGNAL(activated()), this, SLOT(saveas()));
connect(actionAbout, SIGNAL(activated()), this, SLOT(about()));
that's it. I'm at a loss as to why this works in Linux but not in Windows.

Lykurg
21st September 2009, 07:21
It's probably because you don't have qt3 support at your windows machine. activated() is deprecated, use triggered() instead.

robertogoberto
21st September 2009, 07:44
Yeah, that was it. Thank you. :-) I had no idea it was deprecated.