Exactly what I was afraid of... For us, Windows users, it is defined in tchar.h as _ui64tow (for "wide" compiles), but I'm not sure that function exists for you as well. We need a way to output unsigned long (or 64 bit int) to a char buffer. Either find a way to use that internal (standard?) function through macros / cmake, or perhaps try this implementation ( haven't been tested!!!! ):
std::string Misc::toString(const uint64_t value){ char buf[20]; _snprintf(buf,20,"%lu",value); return buf; } Itamar. -----Original Message----- From: Robert Voyer [mailto:robert.vo...@gmail.com] Sent: Wednesday, December 30, 2009 12:06 AM To: clucene-developers@lists.sourceforge.net Subject: Re: [CLucene-dev] Error building clucene on OS X Snow Leopard I'm pretty new to git, so please let me know if there is a better way to do this... I refreshed my checkout, applied the patch (git apply ~/diff.diff) and got the following compilation error: src/shared/CLucene/util/Misc.cpp: In static member function 'static std::string lucene::util::Misc::toString(uint64_t)': src/shared/CLucene/util/Misc.cpp:451: error: '_ui64tot' was not declared in this scope Looks as though the patch doesn't work because the compiler can't find the definition of _ui64tot(value, tbuf, 10); Where is this function defined? Robert On Dec 29, 2009, at 1:42 PM, Itamar Syn-Hershko wrote: > Did you apply the patch? If you haven't please do and let me know if > it still works for you. I'm trying to fix this yet keep all compilers > and platforms work with it... > > Itamar. > > -----Original Message----- > From: Robert Voyer [mailto:robert.vo...@gmail.com] > Sent: Tuesday, December 29, 2009 11:35 PM > To: clucene-developers@lists.sourceforge.net > Subject: Re: [CLucene-dev] Error building clucene on OS X Snow Leopard > > Removing the cast worked for me (on OS X w/ GCC 4.2.1). There was > another cast at IndexWriter.cpp:101 that needed to be removed in order to compile. > > Robert > > On Dec 29, 2009, at 11:02 AM, Itamar Syn-Hershko wrote: > >> Without that cast I get compilation error on VS2005, saying >> 'lucene::util::Misc::toString' : ambiguous call to overloaded >> function. I've made a small code change to try and resolve this, >> please verify it compiles (and runs) on Linux and OS X (and as many >> other platforms you can), and if it does I will commit it to HEAD. >> >> Itamar. >> >> -----Original Message----- >> From: Jim Weir [mailto:jw...@criticalmention.com] >> Sent: Tuesday, December 29, 2009 8:28 PM >> To: clucene-developers@lists.sourceforge.net >> Subject: Re: [CLucene-dev] Error building clucene on OS X Snow >> Leopard >> >> It's an integer size issue as Snow Leopard resolves pthread_t as a >> 64-bit type, and then code is casting this to 32-bit. In the past >> I've removed the cast to get around the compile error. Is there any >> reason this explicit cast should remain? >> >> >> On Tue, Dec 29, 2009 at 1:20 PM, Itamar Syn-Hershko >> <ita...@divrei-tora.com> >> wrote: >>> I wasn't the one implementing the pthread_t support for threads, so >>> I don't know how this error suddenly came to be. That line you're >>> getting an error on is for informal purposes only, so you can safely >>> comment out that part which is used to output the thread ID to a >>> stream (Misc::toString( >>> (int32_t)(_LUCENE_CURRTHREADID) ) ). >>> >>> I'm not sure wether or not it is at all possible to print a thread >>> ID out of a pthread_t handle. See >>> http://fixunix.com/unix/84437-how-print-out-thread-id-pthread_t.html. >>> Instead of commenting that portion out, try perhaps cast it to >>> int64_t and see what happens? Casting it to uint64_t should work as >>> well, but then you'll need to add an appropriate toString implementation. >>> >>> I hope that helps. If you find a good solution for this problem >>> please send us a patch. >>> >>> Itamar. >>> ________________________________ >>> From: Robert Voyer [mailto:robert.vo...@gmail.com] >>> Sent: Tuesday, December 29, 2009 5:53 PM >>> To: clucene-developers@lists.sourceforge.net >>> Subject: [CLucene-dev] Error building clucene on OS X Snow Leopard >>> >>> Hello all, >>> I'm getting the following error when attempting to build Clucene >>> (the >>> 2_3_2 branch from git) on OS X 10.6.2 (Xcode 3.2.1 / GCC 4.2.1): >>> IndexFileDeleter.cpp:93: error: cast from '_opaque_pthread_t*' to >> 'int32_t' >>> loses precision >>> Anyone know a solution for this? >>> Thanks, >>> Robert >>> -------------------------------------------------------------------- >>> - >>> - >>> -------- This SF.Net email is sponsored by the Verizon Developer >>> Community Take advantage of Verizon's best-in-class app development >>> support A streamlined, 14 day to market process makes app >>> distribution fast and easy Join now and get one step closer to >>> millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev >>> _______________________________________________ >>> CLucene-developers mailing list >>> CLucene-developers@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/clucene-developers >>> >>> >> >> --------------------------------------------------------------------- >> - >> ------ >> -- >> This SF.Net email is sponsored by the Verizon Developer Community >> Take advantage of Verizon's best-in-class app development support A >> streamlined, >> 14 day to market process makes app distribution fast and easy Join >> now and get one step closer to millions of Verizon customers >> http://p.sf.net/sfu/verizon-dev2dev >> _______________________________________________ >> CLucene-developers mailing list >> CLucene-developers@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/clucene-developers >> <diff.diff>---------------------------------------------------------- >> - >> ------------------- This SF.Net email is sponsored by the Verizon >> Developer Community Take advantage of Verizon's best-in-class app >> development support A streamlined, 14 day to market process makes app >> distribution fast and easy Join now and get one step closer to >> millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev >> _______________________________________________ >> CLucene-developers mailing list >> CLucene-developers@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/clucene-developers > > > ---------------------------------------------------------------------- > ------ > -- > This SF.Net email is sponsored by the Verizon Developer Community Take > advantage of Verizon's best-in-class app development support A > streamlined, > 14 day to market process makes app distribution fast and easy Join now > and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > CLucene-developers mailing list > CLucene-developers@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/clucene-developers > > > > ---------------------------------------------------------------------- > -------- This SF.Net email is sponsored by the Verizon Developer > Community Take advantage of Verizon's best-in-class app development > support A streamlined, 14 day to market process makes app distribution > fast and easy Join now and get one step closer to millions of Verizon > customers http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > CLucene-developers mailing list > CLucene-developers@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/clucene-developers ---------------------------------------------------------------------------- -- This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ CLucene-developers mailing list CLucene-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/clucene-developers ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ CLucene-developers mailing list CLucene-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/clucene-developers