safon007 / gamekit

Automatically exported from code.google.com/p/gamekit
0 stars 0 forks source link

64bit ZZip on OSX Causing Issues #222

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
----------------------------------------------------
1. Get a clean copy of GameKit from Subversion
2. Generate an XCode project using CMake
3. Open the OGREKIT.xcode project, select AppOgreKit as the target, and compile

What is the expected output? What do you see instead?
----------------------------------------------------
Expect to see the code compile cleanly so one can run the momo_ogre.blend 
example. Instead the following build error occurs:
Undefined symbols for architecture i386:
  "___zzip_aligned4", referenced from:
      ___zzip_parse_root_directory in libZZipLib.a(zip.o)
ld: symbol(s) not found for architecture i386

Following the recent changes, this appears to be related to the changes made 
for Android &/or Windows both of which touched ZZip lately.

Original issue reported on code.google.com by BenT.Sol...@gmail.com on 3 Apr 2012 at 11:56

GoogleCodeExporter commented 8 years ago
Hmm,..sadly I know this error...I love it. I tried to compile gamekit on snow 
leopard for 64bit but
don't even came that far as OIS seems to have an issue there (is this snow 
leopard related?).
What makes me curious is in your log "...for architecture i386". So are you 
compiling for 32bit or 64bit?
32bit works at least on my test-mac.
Did you try to revert the latest changes on zzip and see the result? 

Original comment by thomas.t...@googlemail.com on 11 Apr 2012 at 2:59

GoogleCodeExporter commented 8 years ago
Turns out that the issue is the compiler that gets chosen. It defaults to the 
Apple LLVM 3.0 when it needs to be the GCC LLVM combination. 

From the looks of it, the LLVM only compiler option does not properly handle 
the "inline" keyword in C files which is applied to the function via the 
"_zzip_inline" qualifier on the __zzip_aligned4 function. I assume removing the 
qualifier would make it work on both compilers - though I am not sure if the 
speed hit is worth it or not.

The question is, do we change the ZZipLib definition of a convenience function 
or do we simply require (and inform) people of the GCC+LLVM compiler 
requirement?

Original comment by BenT.Sol...@gmail.com on 12 Apr 2012 at 3:56

GoogleCodeExporter commented 8 years ago
I remember XCode once mentioned that somewhere is an incompatiblity and if I 
want always to use a certain compiler (I assume it was gcc-llvm). Since I'm 
using XCode just for testing gamekit I'm not that familiar with it and how to 
setup things...

If switching to the right compiler is the solution, I think we should do as you 
said and just mention to use gcc-llvm. Could you write one or two sentences in 
the "How to build"-wiki about that? Thx a lot

Original comment by thomas.t...@googlemail.com on 12 Apr 2012 at 1:46

GoogleCodeExporter commented 8 years ago
i prefer to make work with LLVM /clang too. Can you detect the compiler and set 
the appropriate #defines?

Original comment by erwin.coumans on 12 Apr 2012 at 3:33

GoogleCodeExporter commented 8 years ago
Yes, that would be possible. Problem is that there seems to be no appropriate 
define, because of that inline problem (see above). Or do you mean to use or 
not use 'inline' according to the compiler flag? 
Checking the compiler seems to be possible via __GNUC__ or __clang__ flags. 
I can't produce the error (and won't force my XCode to do so) so that would be 
up to some mac-people to do this.

Original comment by thomas.t...@googlemail.com on 12 Apr 2012 at 3:50

GoogleCodeExporter commented 8 years ago
Hmm,..looking in the zzip's conf.h shows that you can define your own inline. 
So maybe something like: 
#ifdef __clang__ 
  #define ZZIP_inline 
#endif 
could do the job...(not 100% sure about the __clang__ flag)

Original comment by thomas.t...@googlemail.com on 12 Apr 2012 at 3:56

GoogleCodeExporter commented 8 years ago
yes, the __clang__ should do the job. Can you fix it and let others try?

Original comment by erwin.coumans on 12 Apr 2012 at 6:51

GoogleCodeExporter commented 8 years ago
Well, ok! I commit a try! 

Original comment by thomas.t...@googlemail.com on 12 Apr 2012 at 7:27