OS X Error while compiling TexturePacker (32bit) [solved]
#1
I get an error when i try to compile TexturePacker for XBMC 32 bit. Seems that something is wrong with the target. Any ideas?

Code:
make -C tools/TexturePacker/
g++ -D_LINUX -DUSE_LZO_PACKING -DTARGET_DARWIN  -I. -I/Users/Shared/xbmc-depends/macosx10.7_i386/include -I/Users/chris/xbmc/lib -I/Users/chris/xbmc/xbmc -I/Users/chris/xbmc/xbmc/linux md5.cpp SDL_anigif.cpp XBTFWriter.cpp XBMCTex.cpp /Users/chris/xbmc/xbmc/guilib/XBTF.cpp -L/Users/Shared/xbmc-depends/macosx10.7_i386/lib -lSDL_image -lSDL -llzo2 -L/Users/chris/xbmc/lib/libsquish -lsquish-native  -o TexturePacker
ld: warning: ignoring file /Users/Shared/xbmc-depends/macosx10.7_i386/lib/libSDL_image.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64)
ld: warning: ignoring file /Users/Shared/xbmc-depends/macosx10.7_i386/lib/libSDL.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64)
ld: warning: ignoring file /Users/Shared/xbmc-depends/macosx10.7_i386/lib/liblzo2.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64)
Undefined symbols for architecture x86_64:
  "_SDL_CreateRGBSurface", referenced from:
      ReadImage(gifdata*, int, int, int, unsigned char (*) [256], int, int)in ccWzNb8F.o
  "_SDL_SetColorKey", referenced from:
      _AG_LoadGIF_RW in ccWzNb8F.o
  "_SDL_DisplayFormatAlpha", referenced from:
      _AG_NormalizeSurfacesToDisplayFormat in ccWzNb8F.o
      _AG_ConvertSurfacesToDisplayFormat in ccWzNb8F.o
  "_SDL_DisplayFormat", referenced from:
      _AG_NormalizeSurfacesToDisplayFormat in ccWzNb8F.o
      _AG_ConvertSurfacesToDisplayFormat in ccWzNb8F.o
  "_SDL_MapRGBA", referenced from:
      _AG_NormalizeSurfacesToDisplayFormat in ccWzNb8F.o
  "_SDL_FillRect", referenced from:
      _AG_NormalizeSurfacesToDisplayFormat in ccWzNb8F.o
  "_SDL_ConvertSurface", referenced from:
      _AG_NormalizeSurfacesToDisplayFormat in ccWzNb8F.o
      createXBTFFrame(SDL_Surface*, CXBTFWriter&, double, unsigned int)in ccXgBFlp.o
  "_SDL_UpperBlit", referenced from:
      _AG_NormalizeSurfacesToDisplayFormat in ccWzNb8F.o
  "_SDL_FreeSurface", referenced from:
      _AG_NormalizeSurfacesToDisplayFormat in ccWzNb8F.o
      _AG_ConvertSurfacesToDisplayFormat in ccWzNb8F.o
      _AG_FreeSurfaces in ccWzNb8F.o
      createXBTFFrame(SDL_Surface*, CXBTFWriter&, double, unsigned int)in ccXgBFlp.o
      createBundle(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double, unsigned int, bool)in ccXgBFlp.o
  "_SDL_RWFromFile", referenced from:
      _AG_LoadGIF in ccWzNb8F.o
  "_lzo1x_999_compress", referenced from:
      appendContent(CXBTFWriter&, int, int, unsigned char*, unsigned int, unsigned int, bool, unsigned int)in ccXgBFlp.o
  "_lzo1x_optimize", referenced from:
      appendContent(CXBTFWriter&, int, int, unsigned char*, unsigned int, unsigned int, bool, unsigned int)in ccXgBFlp.o
  "_IMG_Load", referenced from:
      createBundle(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double, unsigned int, bool)in ccXgBFlp.o
  "___lzo_init_v2", referenced from:
      _main in ccXgBFlp.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[1]: *** [TexturePacker] Error 1
make: *** [tools/TexturePacker/TexturePacker] Error 2

When i set the target to x86_64 everything works fine. I'm on OSX Lion with XCode 4.3.2 and try to build margros master.

TheChief
Reply
#2
Looks like you missed a make -C tools/darwin/depends/xbmc after getting the android merges in that tree?
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#3
I shouldn't miss that. Here my script to build the depends, maybe there is an error?

Code:
#!/bin/sh
cd /Users/xxx/xbmc
cd tools/darwin/depends && ./bootstrap && ./configure --with-darwin=osx && make clean && make
cd /Users/xxx/xbmc
make -C tools/darwin/depends/xbmc && make clean &&  make xcode_depends && make -C lib/addons/script.module.pil

It is just the 32bit which does not work. All other build for 64bit, ATV2 and iOS works.

I don't understand this: ld: symbol(s) not found for architecture x86_64, because i don't build for 64bit.
Reply
#4
what does

file /Users/Shared/xbmc-depends/macosx10.6_i386/lib/libSDL_image.dylib | awk '{print $NF}'

give
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#5
That gives:

file /Users/Shared/xbmc-depends/macosx10.7_i386/lib/libSDL_image.dylib | awk '{print $NF}'
libSDL_image-1.2.0.1.6.dylib

What should it print? For 64bit it is the same file name.

Will try to rebuild all depends.
Reply
#6
it should print something like "i386" or "x86_64".

output of file /Users/Shared/xbmc-depends/macosx10.7_i386/lib/libSDL_image.dylib please.

Something is borked with that awk in your case. And that is the issue.
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#7
I just get the written above (file name), no i386 or x68_64.
Reply
#8
I tried a clean build but get the same error as in the first post. I build for i386, so i dont understand, why it is looking for x86_64 symbols. I think the problems are not caused by the SDL libs.
Reply
#9
https://github.com/xbmc/xbmc/blob/5c1df0...re.in#L624

there is no other way for us to know if the native compiler defaults to i386 or x86_64 builds so we look into the depends of the native libsdl_image build and see which architecture it has. This file check ensures that TexturePacker is built with the right arch so that those linker errors won't happen. (don't discuss this - just trust us. There are more constellations in the buildprocess which will just bork if you take any other arch assumptions here).

It looks like your "file" cmd is broken which is why it defaults to -m64. This leads to the 64bit compilation of TexturePacker and then it tries to link against i386 sdl libs and others.

So get your file command running and you are lucky.
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#10
Problem is, that libSDL_image.dylib is a symbolic link to libSDL_image-1.2.0.1.6.dylib.

If i call "file libSDL_image-1.2.0.1.6.dylib | awk '{print $NF}'", the command works.

This:

file -L libSDL_image.dylib | awk '{print $NF}'"

also works, so maybe you have to edit configire.in?

man file
Code:
-L, --dereference
             option causes symlinks to be followed, as the like-named option in ls(1) (on systems that
             support symbolic links).  This is the default behavior.

What do you think?
Reply
#11
So with option -L everything works. So would be cool, if you can add this option in the xbmc git.
Reply
#12
This is the default behavior. ... whats wrong with your file?
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#13
Code:
macbook:xbmc-ios memphis$ file /Users/Shared/xbmc-depends/macosx10.6_i386/lib/libSDL_image.dylib
/Users/Shared/xbmc-depends/macosx10.6_i386/lib/libSDL_image.dylib: Mach-O dynamically linked shared library i386

macbook:xbmc-ios memphis$ ls -al /Users/Shared/xbmc-depends/macosx10.6_i386/lib/libSDL_image.dylib
lrwxr-xr-x  1 memphis  wheel  28  4 Jun 18:16 /Users/Shared/xbmc-depends/macosx10.6_i386/lib/libSDL_image.dylib -> libSDL_image-1.2.0.1.6.dylib

macbook:xbmc-ios memphis$ which file
/usr/bin/file

macbook:xbmc-ios memphis$ file --version
file-5.03
magic file from /usr/share/file/magic
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#14
Seems you are on Snow leopard, i'm on Lion. Maybe something changed.

Code:
imac:~ chris$ which file
/usr/bin/file

imac:~ chris$ file --version
file-5.04
magic file from /usr/share/file/magic
Reply
#15
Your quote of the -L option said "This is the default behavior." - thats why i'm struggling.

I will have a look on lion and ml.
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply

Logout Mark Read Team Forum Stats Members Help
Error while compiling TexturePacker (32bit) [solved]0