63217

'QMetaObject::connectSlotsByName: No matching signal for' error when building on Ubuntu QT

Question:

This question already has an answer here:

<ul><li> <a href="/questions/24355023/qmetaobjectconnectslotsbyname-no-matching-signal" dir="ltr" rel="nofollow">QMetaObject::connectSlotsByName: No matching signal</a> <span class="question-originals-answer-count"> 2 answers </span> </li> </ul>

I realise this question has been asked before, though my circumstances are slightly different and I have found none of the other answers helpful, I am new to QTCreator.

I am trying to build a project with QTCreator, that builds fine on OSX but when building it with Ubuntu I get this error:

QMetaObject::connectSlotsByName: No matching signal for on_actionWrite_Device_triggered()

The project still builds and partly works, but will not write to an external device (the point of the program).

Can anyone give a walkthrough of what I need to do, previous answers have said about explicitly connecting things, but not gone into details about how to do this. Any tips on searching through the project to find where to make this fix (I didn't write the original program).

Any help is appreciated Tom

Answer1:

Check out this: <a href="http://qt-project.org/doc/qt-4.8/qmetaobject.html#connectSlotsByName" rel="nofollow">http://qt-project.org/doc/qt-4.8/qmetaobject.html#connectSlotsByName</a>

The Method connectSlotsByName tries to connect slots to signals using the following form:

void on_<object name>_<signal name>(<signal parameters>);

Object name and signal name are separated by an underscore. I'm not sure but it may be a problem that the object name itself (actionWrite_Device) contains an underscore and therefore it is not clear what the signal name is (it could be either device_triggered or triggered). The same holds for the object name. This ambiguity might cause the trouble.

Answer2:

If this work son one platform, but does not on another, then a possible reason is, you don't have a clean build on one of the platforms.

To have clean build, first of all clean all extra files from source directory (for example using version control tools to remove all unversioned files). This is important, because compiler will look for some files preferntially under source directory, and if there are stale generated source files (moc_*.*, ui_*.h, etc) there, they will be used instead of the right ones in build directory. Then make sure you have shadow builds enabled in Qt Creator for the project and the build, and do a clean build.

Or just get a fresh checkout/clone from version control to a clean directory.

<hr />

Another possible reason is use of #ifdef resulting in different build result on different platforms. Or the project's .pro file may also have conditional sections, resulting in different files being built on different platforms, or different compile commands being used.

Recommend

  • How to read text source in hadoop separated by special character
  • Programmatically changing form controls
  • C++ std::auto_ptr copy constructor
  • How do I convert a ResultSet in a List of Hashtable?
  • Excluding multiple values from the array
  • byebug, next into application code only
  • Python Paramiko send CTRL+C to an ssh shell
  • string.IsNullOrEmpty() Doesn't Seem to Work on a String within a Class within a Class
  • Using extern @class in order to add a category?
  • How to open multiple instances of a program in Linux
  • Insertion large number of Entities into SQL Server 2012 [duplicate]
  • to implement a spinner in angular2+
  • C function strchr - How to calculate the position of the character?
  • Where these are stored?
  • Where can I find tomesh.c?
  • XSLT foreach repeating nodes to flat
  • git add error : “fatal : malloc, out of memory”
  • how do i write assembly code from c#?
  • Memory error in python- how to use more memory
  • How to make JSON.NET deserialize to Microsoft Date Time?
  • xcode don't localize specific strings
  • Differences in dis-assembled C code of GCC and Borland?
  • Extracting HTML between tags
  • Algorithm for a smudge tool?
  • ilmerge with a PFX file
  • Master page gives error
  • Optimizing database types to compact database (SQLite)
  • javaw.exe and eclipse startup problems
  • TFS: Get latest causes slow project reloading
  • Javascript Callbacks with Object constructor
  • How to make Safari send if-modified-since header?
  • Matrix multiplication with MKL
  • Buffer size for converting unsigned long to string
  • How can I remove ASP.NET Designer.cs files?
  • python draw pie shapes with colour filled
  • Is there any way to bind data to data.frame by some index?
  • Checking variable from a different class in C#
  • Running Map reduces the dimensions of the matrices
  • reshape alternating columns in less time and using less memory
  • How can i traverse a binary tree from right to left in java?