The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
SDL_image iOS build error
回归
Guest

Hi! I build SDL_image on iOS. And build success .a lib.When I use it, it have a link error:

ld: warning: directory not found for option '-L/Users/zxl/Documents/iPhone/fall/SDL/lib'
Undefined symbols for architecture x86_64:
"_CGImageSourceCreateImageAtIndex", referenced from:
_CreateCGImageFromCGImageSource in libSDL2_image.a(IMG_ImageIO.o)
"_CGImageSourceCreateWithDataProvider", referenced from:
_CreateCGImageSourceFromRWops in libSDL2_image.a(IMG_ImageIO.o)
"_CGImageSourceCreateWithURL", referenced from:
_CreateCGImageSourceFromFile in libSDL2_image.a(IMG_ImageIO.o)
"_CGImageSourceGetType", referenced from:
_Internal_isType_ImageIO in libSDL2_image.a(IMG_ImageIO.o)
"_UTTypeConformsTo", referenced from:
_Internal_isType_ImageIO in libSDL2_image.a(IMG_ImageIO.o)
"_kCGImageSourceTypeIdentifierHint", referenced from:
_CreateHintDictionary in libSDL2_image.a(IMG_ImageIO.o)
"_kUTTypeGIF", referenced from:
_IMG_isGIF in libSDL2_image.a(IMG_ImageIO.o)
_IMG_LoadGIF_RW in libSDL2_image.a(IMG_ImageIO.o)
"_kUTTypeJPEG", referenced from:
_IMG_isJPG in libSDL2_image.a(IMG_ImageIO.o)
_IMG_LoadJPG_RW in libSDL2_image.a(IMG_ImageIO.o)
"_kUTTypePNG", referenced from:
_IMG_isPNG in libSDL2_image.a(IMG_ImageIO.o)
_IMG_LoadPNG_RW in libSDL2_image.a(IMG_ImageIO.o)
"_kUTTypeTIFF", referenced from:
_IMG_isTIF in libSDL2_image.a(IMG_ImageIO.o)
_IMG_LoadTIF_RW in libSDL2_image.a(IMG_ImageIO.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)‍


I didn't know how to fix it. I use lipo -info it have all architectures armv7 i386 x86_64 arm64.


Anyone can help me? I also found someone also have this problem in the mail list. He seems not resolve it. ‍
SDL_image iOS build error
Robotic-Brain
Guest

It looks like you're linking statically with SDL instead of using the
framework bundle. If you do that, you have to specify all the
dependencies yourself.

Try adding this to your compile command for each missing dependency:
-framework <Framework Name>

Looking at your output I think you're missing "ApplicationServices"
To find out what SDL or SDL_Image needs type this in a Terminal:
otool -L <path to binary>
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL_image iOS build error
Jeffrey Carpenter
Guest

Hello,

Linking your app to the ImageIO framework ought to resolve it.

Cheers,
Jeffrey Carpenter


On 2014/09/ 23, at 7:45, 回归 wrote:

Quote:
Hi! I build SDL_image on iOS. And build success .a lib.
When I use it, it have a link error:
ld: warning: directory not found for option '-L/Users/zxl/Documents/iPhone/fall/SDL/lib'
Undefined symbols for architecture x86_64:
"_CGImageSourceCreateImageAtIndex", referenced from:
_CreateCGImageFromCGImageSource in libSDL2_image.a(IMG_ImageIO.o)
"_CGImageSourceCreateWithDataProvider", referenced from:
_CreateCGImageSourceFromRWops in libSDL2_image.a(IMG_ImageIO.o)
"_CGImageSourceCreateWithURL", referenced from:
_CreateCGImageSourceFromFile in libSDL2_image.a(IMG_ImageIO.o)
"_CGImageSourceGetType", referenced from:
_Internal_isType_ImageIO in libSDL2_image.a(IMG_ImageIO.o)
"_UTTypeConformsTo", referenced from:
_Internal_isType_ImageIO in libSDL2_image.a(IMG_ImageIO.o)
"_kCGImageSourceTypeIdentifierHint", referenced from:
_CreateHintDictionary in libSDL2_image.a(IMG_ImageIO.o)
"_kUTTypeGIF", referenced from:
_IMG_isGIF in libSDL2_image.a(IMG_ImageIO.o)
_IMG_LoadGIF_RW in libSDL2_image.a(IMG_ImageIO.o)
"_kUTTypeJPEG", referenced from:
_IMG_isJPG in libSDL2_image.a(IMG_ImageIO.o)
_IMG_LoadJPG_RW in libSDL2_image.a(IMG_ImageIO.o)
"_kUTTypePNG", referenced from:
_IMG_isPNG in libSDL2_image.a(IMG_ImageIO.o)
_IMG_LoadPNG_RW in libSDL2_image.a(IMG_ImageIO.o)
"_kUTTypeTIFF", referenced from:
_IMG_isTIF in libSDL2_image.a(IMG_ImageIO.o)
_IMG_LoadTIF_RW in libSDL2_image.a(IMG_ImageIO.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I didn't know how to fix it. I use lipo -info it have all architectures armv7 i386 x86_64 arm64.

Anyone can help me? I also found someone also have this problem in the mail list. He seems not resolve it.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org