Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build museeq: "no matching function for call" in chatrooms.cpp #26

Open
amoe opened this issue Sep 29, 2016 · 3 comments
Open

Cannot build museeq: "no matching function for call" in chatrooms.cpp #26

amoe opened this issue Sep 29, 2016 · 3 comments

Comments

@amoe
Copy link

amoe commented Sep 29, 2016

When building museek+ with -DEVERYTHING=1 on Debian unstable, I get an error while compiling museeq.

[ 56%] Building CXX object museeq/CMakeFiles/museeq.dir/chatrooms.cpp.o
/home/amoe/vcs/museek-plus/museeq/chatrooms.cpp: In member function ‘void ChatRooms::joined(const QString&, const NRoom&, const QString&, const QStringList&)’:
/home/amoe/vcs/museek-plus/museeq/chatrooms.cpp:78:50: error: no matching function for call to ‘ChatRoom::ChatRoom(const QString&, ChatRooms*, bool)’
  ChatRoom* _room = new ChatRoom(room, this, false);
                                                  ^
In file included from /home/amoe/vcs/museek-plus/museeq/chatrooms.cpp:25:0:
/home/amoe/vcs/museek-plus/museeq/chatroom.h:37:2: note: candidate: ChatRoom::ChatRoom(QString, QWidget*, QString)
  ChatRoom(const QString, QWidget * = 0, const QString = "ChatRoom");
  ^~~~~~~~
/home/amoe/vcs/museek-plus/museeq/chatroom.h:37:2: note:   no known conversion for argument 3 from ‘boo ’ to ‘QString’
museeq/CMakeFiles/museeq.dir/build.make:501: recipe for target 'museeq/CMakeFiles/museeq.dir/chatrooms.cpp.o' failed
make[2]: *** [museeq/CMakeFiles/museeq.dir/chatrooms.cpp.o] Error 1
CMakeFiles/Makefile2:477: recipe for target 'museeq/CMakeFiles/museeq.dir/all' failed
make[1]: *** [museeq/CMakeFiles/museeq.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

CMake 3.6.2, g++ 6.2.0, Qt 4.8.7.

@hallsofmirrors
Copy link
Contributor

I had to fix this (along with updating the cmake, python, /usr/bin/museeq headers to use python2) in order to build this on arch. Let me figure out whether I can push my fix and I'll see if I can help... idk git very well and I hadn't heard of museek yesterday.

this particular error is because g++ is strongly typing false as a bool instead of simply letting it mean 0/NULL for whatever reason. (The constructor wants a QString, which should construct an empty object here when passed (const char *)0, according to Qt docs. )

my guess is that we noticed the issue because we're using g++ 6.2.x and the new g++ decided to stop silently casting false to a char* (or whatever QString constructor it was calling).

@hallsofmirrors
Copy link
Contributor

This patch fixes the problem, I'll figure out how to do a pull request properly another time f7bfba0

@drlight-code
Copy link
Contributor

On 10/20/2016 06:37 PM, hallsofmirrors wrote:

I had to fix this (along with updating the cmake, python,
/usr/bin/museeq headers to use python2) in order to build this on
arch. Let me figure out whether I can push my fix and I'll see if
I can help... idk git very well and I hadn't heard of museek
yesterday.

I have open PRs for cmake fixes and the python shebangs, as I'm
building also on arch:

#24
#25

this particular error is because g++ is strongly typing |false|
as a bool instead of simply letting it mean |0|/|NULL| for
whatever reason. (The constructor wants a |QString|, which should
construct an empty object here when passed |(const char *)0|,
according to Qt docs. )

my guess is that we noticed the issue because we're using g++
6.2.x and the new g++ decided to stop silently casting |false| to
a |char*| (or whatever |QString| constructor it was calling).

I actually wonder how this can have ever worked, because from
what I've researched bool should never have silently casted to
char*, but probably I'm missing something. Just removing the
parameter and relying on the default value fixes it for me as
well. Since I already have a commit for it locally I could make
another PR if you're not so comfortable with git yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants