| I had the same issue on Mac OS X 10.6.8, with HTTrack 3.47.24.
No compiler errors but a run-time error when I attempt to run the
application:
dyld: lazy symbol binding failed: Symbol not found: _strndup
Referenced from: /usr/local/lib/libhttrack.2.dylib
Expected in: flat namespace
dyld: Symbol not found: _strndup
Referenced from: /usr/local/lib/libhttrack.2.dylib
Expected in: flat namespace
Trace/BPT trap
The issue depends on the fact that Mac OS X 10.6.8 does not contain a suitable
implementation of strndup().
The issue may be corrected in version 3.47.24, with a small edit to the file
src/htscharset.c. It suffice to move a static implementation of strndup()
outside the preprocessor conditional: #ifdef _WIN32.
This is a quick'n'dirty fix that allows a succesful compilation of HTTrack on
Mac OS X 10.6.8.
A better fix would be to change the file src/htscharset.c to enclose the
static definition of strndup() inside a double guard such as:
#if defined(_WIN32) || (defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
&& (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ <= 1068))
static char *strndup(const char *s, size_t size) {
char *dest = malloc(size + 1);
if (dest != NULL) {
memcpy(dest, s, size);
dest[size] = '\0';
return dest;
}
return NULL;
}
#endif
I hope that this helps.
Regards,
GF | |