kloop
kloop

Reputation: 4721

why can't I compile the following?

I am trying to compile a package I got from here: http://sourceforge.net/projects/desr/

on a MacOSX with SDK 10.6 or 10.7 (I have both in /Developer).

I get the following errors:

g++  -g -O2  -I. -I.. -I../ixe -c charmap.cpp
g++  -g -O2  -I. -I.. -I../ixe -c HtmlTokenizer.cpp
In file included from /usr/include/c++/4.2.1/iosfwd:45,
             from /usr/include/c++/4.2.1/bits/stl_algobase.h:70,
             from /usr/include/c++/4.2.1/bits/char_traits.h:46,
             from /usr/include/c++/4.2.1/string:47,
             from ./Char.h:30,
             from ./string.h:27,
             from /usr/include/c++/4.2.1/cstring:52,
             from HtmlTokenizer.cpp:24:
/usr/include/c++/4.2.1/bits/c++locale.h: In function ‘int std::__convert_from_v(int* const&, char*, int, const char*, ...)’:
/usr/include/c++/4.2.1/bits/c++locale.h:69: error: ‘strcmp’ is not a member of ‘std’
/usr/include/c++/4.2.1/bits/c++locale.h:71: error: ‘strlen’ is not a member of ‘std’
/usr/include/c++/4.2.1/bits/c++locale.h:72: error: ‘strcpy’ is not a member of ‘std’

I read about it on the web, and it seems like none of the reasons specified in other forums is the reason in this case (such as a missing "cstring" include or an include inside a namespace definition).

I know I compiled this package on Linux, so I am thinking that either my Mac OSX xcode installation is broken (??) or xcode is sensitive to some error in this package that the Linux environment is not.

Any ideas?

Upvotes: 0

Views: 1525

Answers (1)

Simon Urbanek
Simon Urbanek

Reputation: 13932

A local include file "string.h" is masking the system <string.h>. Typically this is caused by projects that require case-sensitive FS and use file names like String.h which clashes with the system on case-insensitive FSes (which is the default on OS X).

If the issue is really case-insensitivity you could either a) fix the project to not use such silly names or b) create a disk image formatted with case-sensitive HFS+ and compile the project there.

Upvotes: 1

Related Questions