I am trying to compile OpenCV 2.4.5 on Mac OSX Mountain Lion. I've made project with the command "cmake -G Xcode" so I can build it within Xcode. I've changed C++ Language Dialect to compiler-default and C++ Standard Library to libc++.
The setting Header Search Paths is set to '/opt/local/include/
**'.
These settings should be sufficient to build OpenCV, but I get the following error in the zlib library:
Semantic Issue Group
Warning: /opencv/3rdparty/zlib/gzwrite.c:216:20: Passing 'const Bytef *' (aka 'const unsigned char *') to parameter of type 'void *' discards qualifiers
Error: /opencv/3rdparty/zlib/gzwrite.c:273:41:
Read-only variable is not assignable
The error occurs on line 273 in gzwrite.c: strm->next_in[strm->avail_in++] = c;
/* try writing to input buffer for speed (state->size == 0 if buffer not
initialized) */
if (strm->avail_in < state->size) {
if (strm->avail_in == 0)
strm->next_in = state->in;
strm->next_in[strm->avail_in++] = c;
state->x.pos++;
return c & 0xff;
}
Can anyone tell me what I am missing so I can solve the error?
This was fixed in zlib 1.2.8.