[MXS-4347]  error: no matching constructor for initialization of 'maxsql::ComPacket' Created: 2022-10-11  Updated: 2022-11-14  Resolved: 2022-11-14

Status: Closed
Project: MariaDB MaxScale
Component/s: Core
Affects Version/s: 22.08.1
Fix Version/s: 22.08.3

Type: Bug Priority: Minor
Reporter: Martin Filla Assignee: Niclas Antti
Resolution: Fixed Votes: 0
Labels: None
Environment:

cc -v
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9
Candidate multilib: .;@m64
Selected multilib: .;@m64

Linux 5.15.0-46-generic #49~20.04.1-Ubuntu SMP Thu Aug 4 19:15:44 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux



 Description   

Hi,
i tried compile source code on Linux and i have issue error: no matching constructor for initialization of 'maxsql::ComPacket'

In file included from /home/maxfx/Documents/MaxScale/include/maxscale/config_common.hh:33:
/home/maxfx/Documents/MaxScale/include/maxscale/protocol/mariadb/query_classifier.hh:20:1: warning: struct 'GWBUF' was previously declared as a class; this is valid, but may result in linker errors under the Microsoft C++ ABI [-Wmismatched-tags]
struct GWBUF;
^
/home/maxfx/Documents/MaxScale/include/maxscale/buffer.hh:74:7: note: previous use is here
class GWBUF
      ^
/home/maxfx/Documents/MaxScale/include/maxscale/protocol/mariadb/query_classifier.hh:20:1: note: did you mean class here?
struct GWBUF;
^~~~~~
class                                                                                                          
In file included from /home/maxfx/Documents/MaxScale/server/core/packet_tracker.cc:17:
/home/maxfx/Documents/MaxScale/include/maxscale/mysql_plus.hh:1328:11: error: no matching constructor for initialization of 'maxsql::ComPacket'
        : ComPacket(pPacket)
          ^         ~~~~~~~
/home/maxfx/Documents/MaxScale/include/maxscale/mysql_plus.hh:505:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'GWBUF *' to 'const maxsql::ComPacket' for 1st argument
class ComPacket
      ^
/home/maxfx/Documents/MaxScale/include/maxscale/mysql_plus.hh:505:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'GWBUF *' to 'maxsql::ComPacket' for 1st argument
class ComPacket
      ^
/home/maxfx/Documents/MaxScale/include/maxscale/mysql_plus.hh:511:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
    ComPacket(GWBUF* pPacket, bool* client_split_flag)
    ^
/home/maxfx/Documents/MaxScale/include/maxscale/mysql_plus.hh:1347:36: error: 'm_pPacket' is a private member of 'maxsql::ComPacket'
        uint8_t* pEnd = GWBUF_DATA(m_pPacket) + gwbuf_link_length(m_pPacket);
                                   ^
/home/maxfx/Documents/MaxScale/include/maxscale/mysql_plus.hh:570:14: note: declared private here
    GWBUF*   m_pPacket;
             ^
/home/maxfx/Documents/MaxScale/include/maxscale/mysql_plus.hh:1347:67: error: 'm_pPacket' is a private member of 'maxsql::ComPacket'
        uint8_t* pEnd = GWBUF_DATA(m_pPacket) + gwbuf_link_length(m_pPacket);
                                                                  ^
/home/maxfx/Documents/MaxScale/include/maxscale/mysql_plus.hh:570:14: note: declared private here
    GWBUF*   m_pPacket;
             ^
 



 Comments   
Comment by Johan Wikman [ 2022-10-12 ]

We don't build MaxScale using clang, but it would be desirable if that could be done.
So as to be certain of a functioning base-line, can you build it using gcc?

Generated at Thu Feb 08 04:27:59 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.