Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling kyotocabinet-1.2.76 on OSX 10.9

Tags:

kyotocabinet

I'm attempting to compile kyoto cabinet from this source, on OSX 10.9:

http://fallabs.com/kyotocabinet/pkg/kyotocabinet-1.2.76.tar.gz

But it's failing with this:

In file included from kcutil.cc:16:
In file included from ./kcutil.h:19:
./kccommon.h:92:10: fatal error: 'tr1/unordered_map' file not found
#include <tr1/unordered_map>
         ^
2 warnings and 1 error generated.
make: *** [kcutil.o] Error 1

It is my understanding that the C++ libraries have changed in OSX 10.9, but I am not sure how to navigate my way to a solution. Any help would be appreciated.

like image 326
robertjd Avatar asked Oct 15 '25 14:10

robertjd


1 Answers

I got some help from a coworker. You need to fix the includes to not use TR1, it appears that Mavericks doesn't have the TR1 specification anymore

In kccommon.h, find this code:

#if __cplusplus > 199711L || defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(_MSC_VER)

#include <unordered_map>
#include <unordered_set>

#else

#include <tr1/unordered_map>
#include <tr1/unordered_set>

namespace std {
using tr1::hash;
using tr1::unordered_map;
using tr1::unordered_set;
}

#endif

Remove the if else statement so that you are left with:

#include <unordered_map>
#include <unordered_set>

Try compiling again, it worked for me.

like image 63
robertjd Avatar answered Oct 18 '25 22:10

robertjd



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!