[Qt-interest] Runtime Error :- connect: No such slot (FIXED) But...

Jan Dasselaar jan at altus-escon.com
Mon Feb 22 10:02:09 CET 2010


On 21/02/2010 14:00, Wm. G. Urquhart wrote:
> Thiago Macieira wrote:
>> Em Domingo 21. Fevereiro 2010, às 11.49.58, Wm. G. Urquhart escreveu:
>>> I have crippled 99% of the application by commenting out the all of the
>>> applications connect(...)ions at start up along with other stuff, but
>>> still I get nothing.
>>
>> Is it already less than 500 lines of code? (including the class declarations)
>>
>> If so, post it to the mailing list.
>
> Hi,
>
> In an attempt to slim the project down for submission to the list I went
> mad with the comments and excluded everything from the .h and .cpp MyApp
> files. However, having cleaned the project when I rebuilt it (Debug
> Mode) I got complains of everything I had commented out being missing!
>
> Anyway, after a bit of looking around it would appear that the project
> is always trying to include ./release/moc_myapp.cpp and not the current
> ./debug one. But already being blinded by this I can't see where this is
>    configured.
>
> This is the MOC command line:
>
> "$(QTDIR)\bin\moc.exe"  "$(InputPath)" -o
> "$(ConfigurationName)\moc_$(InputName).cpp" -DQT_CORE_LIB -DQT_GUI_LIB
> -DQT_LARGEFILE_SUPPORT -DQT_THREAD_SUPPORT -DUNICODE -I"$(NOINHERIT)\."
> -I"$(QTDIR)\include\." -I"$(QTDIR)\include\QtCore\."
> -I"$(QTDIR)\include\QtGui\." -I".\." -I"$(ConfigurationName)\."
>
> the "Output Line":
>
> "$(ConfigurationName)\moc_$(InputName).cpp"
>
> and "Additional Deps"
>
> "$(ConfigurationName)\moc_$(InputName).cpp"
>
> And finally, the MOC directory in my Qt Plugin Settings:
>
> .\GeneratedFiles\$(ConfigurationName)
>
> I'm using Visual Studio 2008 so if anyone know how I can fix this I
> would be a very happy chap.
>
I'm using VS2008 with the commercial plugin and to change your config 
check the following:

1. Select e.g. the debug build

2. Select the first moc file assosiated with the cpp file which fails
    (when you have a debug and release build config only you should see 
it twice)

3. Look in the Properties window (if not visible press Alt-Enter) and if 
the relative path starts with .\Generated\Files\Debug this file should 
be enabled in the project.

4. To verify this right-click the moc file and select properties.

5. Exclude from build should be set to No

6. Now select the second moc file (should be located at 
.\Generated\Release) and make sure this one is exluded from the release 
build.

7. Now select the release build and again check both moc files for 
correct configuration in the build.


The fact that a file is exluded from the current build might be 
indicated by a special icon but I'm not sure.


To check if all moc files are correctly configured you can do the following:

1. Select e.g. the Debug build.

2. Delete the Generated subdir from disk.

3. Build the debug version.

4. It should build and after the build no Generated\Release should be 
present. If it does exist all moc files present there are incorrectly 
configured. Fix them as described above.

5. Repeat this but now for the release build.

Hth,

Jan






More information about the Qt-interest-old mailing list