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

type errors fixed #19

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

vishal-ahirwar
Copy link

type errors fixed

@Mq-b
Copy link

Mq-b commented Jan 4, 2025

mq-b@mqb-ubuntu:~/test/test_fsync$ g++ test.cpp -o test -std=c++14
In file included from test.cpp:2:
zip_file.hpp: In member function ‘void miniz_cpp::zip_file::start_write()’:
zip_file.hpp:5585: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]
 5585 |                 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)}
zip_file.hpp:5613: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]
 5613 |         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)}
#include <iostream>
#include "zip_file.hpp"

int main(){
    miniz_cpp::zip_file zip;
    zip.write("test.txt", "Hello, World!");
    zip.write("./1MB_file.dat");
    zip.save("test.zip");
    std::clog << "Saved to test.zip" << std::endl;
}

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