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

miniz 3.0: "static const mz_uint s_tdefl_num_probes" defined twice #262

Closed
ElTh0r0 opened this issue Oct 30, 2022 · 1 comment
Closed

miniz 3.0: "static const mz_uint s_tdefl_num_probes" defined twice #262

ElTh0r0 opened this issue Oct 30, 2022 · 1 comment

Comments

@ElTh0r0
Copy link

ElTh0r0 commented Oct 30, 2022

Hi,
since v.3.0 I cannot use miniz anymore. I'm including miniz.c/miniz.h from the ZIP archive from the release page in my project, but compilation fails:

../../master/application/./3rdparty/miniz/miniz.c:1254:22: error: default initialization of an object of const type 'const mz_uint[11]' (aka 'const unsigned int[11]')
static const mz_uint s_tdefl_num_probes[11];
                     ^
../../master/application/./3rdparty/miniz/miniz.c:2113:22: error: redefinition of 's_tdefl_num_probes'
static const mz_uint s_tdefl_num_probes[11] = { 0, 1, 6, 32, 16, 32, 128, 256, 512, 768, 1500 };
                     ^
../../master/application/./3rdparty/miniz/miniz.c:1254:22: note: previous definition is here
static const mz_uint s_tdefl_num_probes[11];
                     ^

With v2.2.0 everything is fine.

Edit: Just tested again with v3.0.1 -> still the same error.

@ElTh0r0
Copy link
Author

ElTh0r0 commented Jan 29, 2023

To whom it may concern: I included miniz in my project as follows:

#define MINIZ_HEADER_FILE_ONLY
#include "./3rdparty/miniz/miniz.c"

Since it is mentioned as follows in miniz.h:

   * This is a header file library, like stb_image.c. To get only a header file, either cut and paste the
     below header, or create miniz.h, #define MINIZ_HEADER_FILE_ONLY, and then include miniz.c from it.

I know the miniz documentation is not the best, but it seems, that above comment is not correct (anymore). After including miniz.h instead (and adding miniz.c to the project), I was again able to compile and use miniz in my project. I just don't understand why this issue now came up after miniz v3 release.

@ElTh0r0 ElTh0r0 closed this as completed Jan 29, 2023
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

1 participant