Skip to content

Conversation

@kstenschke
Copy link

Compilation prior to this change failed w/ message
invalid conversion from ‘std::size_t ()(void, uint64_t, const void*, std::size_t) {aka long unsigned int ()(void, long unsigned int, const void*, long unsigned int)}’ to ‘mz_file_write_func {aka long unsigned int ()(void, long long unsigned int, const void*, long unsigned int)}’ [-fpermissive]
archive_->m_pWrite = &detail::write_callback;

Compilation prior to this change failed w/ message
invalid conversion from ‘std::size_t (*)(void*, uint64_t, const void*, std::size_t) {aka long unsigned int (*)(void*, long unsigned int, const void*, long unsigned int)}’ to ‘mz_file_write_func {aka long unsigned int (*)(void*, long long unsigned int, const void*, long unsigned int)}’ [-fpermissive]
         archive_->m_pWrite = &detail::write_callback;
@nyckmaia
Copy link

I just added this library in my C++ project and I got this compilation time error:

/home/nyck/Desktop/maia/maia_app/maialib/include/miniz-cpp/zip_file.hpp:5583: error: invalid conversion from ‘std::size_t (*)(void*, uint64_t, const void*, std::size_t)’ {aka ‘long unsigned int (*)(void*, long unsigned int, const void*, long unsigned int)’} to ‘mz_file_write_func’ {aka ‘long unsigned int (*)(void*, long long unsigned int, const void*, long unsigned int)’} [-fpermissive]
In file included from /home/nyck/Desktop/maia/maia_app/maialib/include/score.h:15,
                 from /home/nyck/Desktop/maia/maia_app/maialib/src/orq_functions.cpp:5:
/home/nyck/Desktop/maia/maia_app/maialib/include/miniz-cpp/zip_file.hpp: In member function ‘void miniz_cpp::zip_file::start_write()’:
/home/nyck/Desktop/maia/maia_app/maialib/include/miniz-cpp/zip_file.hpp:5583:38: error: invalid conversion from ‘std::size_t (*)(void*, uint64_t, const void*, std::size_t)’ {aka ‘long unsigned int (*)(void*, long unsigned int, const void*, long unsigned int)’} to ‘mz_file_write_func’ {aka ‘long unsigned int (*)(void*, long long unsigned int, const void*, long unsigned int)’} [-fpermissive]
 5583 |                 archive_->m_pWrite = &detail::write_callback;
      |                                      ^~~~~~~~~~~~~~~~~~~~~~~
      |                                      |
      |                                      std::size_t (*)(void*, uint64_t, const void*, std::size_t) {aka long unsigned int (*)(void*, long unsigned int, const void*, long unsigned int)}

What can I do to fix it?

  • Ubuntu 20.04 x64
  • GCC 9.3
  • Qt 5.15.0

@nyckmaia
Copy link

nyckmaia commented Jan 6, 2023

Hi, I got the same error 3 years later...
Is there a way to fix it?

/mnt/c/Users/nyck/Desktop/maialib/core/external/miniz-cpp/zip_file.hpp: In member function ‘void miniz_cpp::zip_file::start_write()’:
      /mnt/c/Users/nyck/Desktop/maialib/core/external/miniz-cpp/zip_file.hpp:6340:38: error: invalid conversion from ‘std::size_t (*)(void*, uint64_t, const void*, std::size_t)’ {aka ‘long unsigned int (*)(void*, long unsigned int, const void*, long unsigned int)’} to ‘mz_file_write_func’ {aka ‘long unsigned int (*)(void*, long long unsigned int, const void*, long unsigned int)’} [-fpermissive]
       6340 |                 archive_->m_pWrite = &detail::write_callback;
            |                                      ^~~~~~~~~~~~~~~~~~~~~~~
            |                                      |
            |                                      std::size_t (*)(void*, uint64_t, const void*, std::size_t) {aka long unsigned int (*)(void*, long unsigned int, const void*, long unsigned int)}
      /mnt/c/Users/nyck/Desktop/maialib/core/external/miniz-cpp/zip_file.hpp:6366:30: error: invalid conversion from ‘std::size_t (*)(void*, uint64_t, const void*, std::size_t)’ {aka ‘long unsigned int (*)(void*, long unsigned int, const void*, long unsigned int)’} to ‘mz_file_write_func’ {aka ‘long unsigned int (*)(void*, long long unsigned int, const void*, long unsigned int)’} [-fpermissive]
       6366 |         archive_->m_pWrite = &detail::write_callback;
            |                              ^~~~~~~~~~~~~~~~~~~~~~~
            |                              |
            |                              std::size_t (*)(void*, uint64_t, const void*, std::size_t) {aka long unsigned int (*)(void*, long unsigned int, const void*, long unsigned int)}
      ninja: build stopped: subcommand failed.
  • Ubuntu 20.04
  • GCC 9.3
  • C++ 17
  • CXX_FLAGS -Wall -Wextra

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

Successfully merging this pull request may close these issues.

2 participants