{"action":"created","issue":{"url":"https://api.github.com/repos/jcupitt/libvips/issues/280","labels_url":"https://api.github.com/repos/jcupitt/libvips/issues/280/labels{/name}","comments_url":"https://api.github.com/repos/jcupitt/libvips/issues/280/comments","events_url":"https://api.github.com/repos/jcupitt/libvips/issues/280/events","html_url":"https://github.com/jcupitt/libvips/issues/280","id":70308379,"number":280,"title":"Static Library for iOS ","user":{"login":"skela","id":58268,"avatar_url":"https://avatars.githubusercontent.com/u/58268?v=3","gravatar_id":"","url":"https://api.github.com/users/skela","html_url":"https://github.com/skela","followers_url":"https://api.github.com/users/skela/followers","following_url":"https://api.github.com/users/skela/following{/other_user}","gists_url":"https://api.github.com/users/skela/gists{/gist_id}","starred_url":"https://api.github.com/users/skela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skela/subscriptions","organizations_url":"https://api.github.com/users/skela/orgs","repos_url":"https://api.github.com/users/skela/repos","events_url":"https://api.github.com/users/skela/events{/privacy}","received_events_url":"https://api.github.com/users/skela/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jcupitt/libvips/labels/question","name":"question","color":"02e10c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-23T05:02:13Z","updated_at":"2015-04-24T02:52:09Z","closed_at":null,"body":"\r\nI am trying to include libvips in an Xcode project, to be used in an iPhone app to generate deep zoom tiles from big images. So far I've tried to generate static libs for all the various architectures and then using Xcode's lipo tool to combine them into a fat library. At the end of it all I end up with 3 fat libraries that I include in my Xcode project.\r\n\r\n\tskela@skelimac:~/Desktop/libvips-objc$ lipo -info libvips.a ; lipo -info libvips-cpp.a ; lipo -info libvipsCC.a\r\n\tArchitectures in the fat file: libvips.a are: armv7 armv7s i386 x86_64 arm64\r\n\tArchitectures in the fat file: libvips-cpp.a are: armv7 armv7s i386 x86_64 arm64\r\n\tArchitectures in the fat file: libvipsCC.a are: armv7 armv7s i386 x86_64 arm64\r\n\r\nI've updated my project's Header search paths and library search paths, but getting linking errors and complaints about undefined symbols.\r\n\r\n\tLd /Users/skela/Library/Developer/Xcode/DerivedData/DrawingTest-bcabavjuthzdnjbzvwnjpqxekpmc/Build/Products/Debug-iphoneos/DrawingTest.app/DrawingTest normal armv7\r\n\t    cd /Users/skela/code/introlabs/constructor/ios/Tests/DrawingTest\r\n\t    export IPHONEOS_DEPLOYMENT_TARGET=8.2\r\n\t    export PATH=\"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin\"\r\n\t    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk -L/Users/skela/Library/Developer/Xcode/DerivedData/DrawingTest-bcabavjuthzdnjbzvwnjpqxekpmc/Build/Products/Debug-iphoneos -L/Users/skela/Desktop/PhotoScrollerNetwork/libturbojpeg -L/Users/skela/code/introlabs/constructor/ios/Tests/DrawingTest -L/Users/skela/Desktop/libvips-objc -F/Users/skela/Library/Developer/Xcode/DerivedData/DrawingTest-bcabavjuthzdnjbzvwnjpqxekpmc/Build/Products/Debug-iphoneos -F/Users/skela/code/introlabs/constructor/ios/Tests/DrawingTest/Pods/OpenCV -F/Users/skela/code/introlabs/constructor/ios/Tests/DrawingTest -filelist /Users/skela/Library/Developer/Xcode/DerivedData/DrawingTest-bcabavjuthzdnjbzvwnjpqxekpmc/Build/Intermediates/DrawingTest.build/Debug-iphoneos/DrawingTest.build/Objects-normal/armv7/DrawingTest.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -ObjC -lPods-DrawingTest-ARTiledImageView -lPods-DrawingTest-EKTilesMaker -lPods-DrawingTest-NAMapKit -lPods-DrawingTest-SDWebImage -lstdc++ -framework AVFoundation -framework Accelerate -framework AssetsLibrary -framework CoreGraphics -framework CoreImage -framework CoreMedia -framework CoreVideo -framework Foundation -framework ImageIO -framework QuartzCore -framework UIKit -framework opencv2 -fobjc-arc -fobjc-link-runtime -stdlib=libc++ -miphoneos-version-min=8.2 -lc -lc++ -framework QuartzCore -framework Accelerate -framework CoreGraphics -framework CoreFoundation -lvips -lvips-cpp -lvipsCC -framework ImageIO -lPods-DrawingTest -Xlinker -dependency_info -Xlinker /Users/skela/Library/Developer/Xcode/DerivedData/DrawingTest-bcabavjuthzdnjbzvwnjpqxekpmc/Build/Intermediates/DrawingTest.build/Debug-iphoneos/DrawingTest.build/Objects-normal/armv7/DrawingTest_dependency_info.dat -o /Users/skela/Library/Developer/Xcode/DerivedData/DrawingTest-bcabavjuthzdnjbzvwnjpqxekpmc/Build/Products/Debug-iphoneos/DrawingTest.app/DrawingTest\r\n\r\n\tUndefined symbols for architecture armv7:\r\n\t  \"_fftw_plan_dft_c2r_2d\", referenced from:\r\n\t      _rinvfft1 in libvips.a(invfft.o)\r\n\t  \"_fftw_execute_dft_c2r\", referenced from:\r\n\t      _rinvfft1 in libvips.a(invfft.o)\r\n\t  \"_cmsCreateTransform\", referenced from:\r\n\t      _vips_icc_build in libvips.a(icc_transform.o)\r\n\t  \"_cmsCreateLab4Profile\", referenced from:\r\n\t      _vips_icc_export_build in libvips.a(icc_transform.o)\r\n\t      _vips_icc_import_build in libvips.a(icc_transform.o)\r\n\t  \"_cmsCreateXYZProfile\", referenced from:\r\n\t      _vips_icc_export_build in libvips.a(icc_transform.o)\r\n\t      _vips_icc_import_build in libvips.a(icc_transform.o)\r\n\t  \"_cmsGetColorSpace\", referenced from:\r\n\t      _vips_icc_profile_needs_bands in libvips.a(icc_transform.o)\r\n\t      _vips_icc_build in libvips.a(icc_transform.o)\r\n\t      _is_pcs in libvips.a(icc_transform.o)\r\n\t  \"_cmsIsIntentSupported\", referenced from:\r\n\t      _vips_check_intent in libvips.a(icc_transform.o)\r\n\t  \"_cmsOpenProfileFromMem\", referenced from:\r\n\t      _vips_icc_load_profile_image in libvips.a(icc_transform.o)\r\n\t      _vips_icc_export_build in libvips.a(icc_transform.o)\r\n\t  \"_fftw_plan_dft_r2c_2d\", referenced from:\r\n\t      _rfwfft1 in libvips.a(fwfft.o)\r\n\t  \"_fftw_plan_dft_2d\", referenced from:\r\n\t      _cfwfft1 in libvips.a(fwfft.o)\r\n\t      _cinvfft1 in libvips.a(invfft.o)\r\n\t  \"_fftw_destroy_plan\", referenced from:\r\n\t      _cfwfft1 in libvips.a(fwfft.o)\r\n\t      _rfwfft1 in libvips.a(fwfft.o)\r\n\t      _rinvfft1 in libvips.a(invfft.o)\r\n\t      _cinvfft1 in libvips.a(invfft.o)\r\n\t  \"_TIFFReadEncodedTile\", referenced from:\r\n\t      _write_copy_tiff in libvips.a(vips2tiff.o)\r\n\t  \"_GetImagePixels\", referenced from:\r\n\t      _get_pixels in libvips.a(magick2vips.o)\r\n\t  \"_g_realloc\", referenced from:\r\n\t      _write_buf_grow in libvips.a(vipspng.o)\r\n\r\n+ More lines of errors like that (201 errors)\r\n\r\nI'm just wondering if you guys have heard about any (hopefully successful) attempts at using this library on iOS before, or if not, whether you have any tips as to what I need to do in order to get this thing to run.\r\n\r\nI can stick what I've done in a git repo if there's an appetite for it, but just wondering if I'm on the right track or not.\r\n![screen shot 2015-04-23 at 13 00 33](https://cloud.githubusercontent.com/assets/58268/7290869/e98db86a-e9b8-11e4-931a-9fa86c0210fe.png)\r\n"},"comment":{"url":"https://api.github.com/repos/jcupitt/libvips/issues/comments/95781632","html_url":"https://github.com/jcupitt/libvips/issues/280#issuecomment-95781632","issue_url":"https://api.github.com/repos/jcupitt/libvips/issues/280","id":95781632,"user":{"login":"skela","id":58268,"avatar_url":"https://avatars.githubusercontent.com/u/58268?v=3","gravatar_id":"","url":"https://api.github.com/users/skela","html_url":"https://github.com/skela","followers_url":"https://api.github.com/users/skela/followers","following_url":"https://api.github.com/users/skela/following{/other_user}","gists_url":"https://api.github.com/users/skela/gists{/gist_id}","starred_url":"https://api.github.com/users/skela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skela/subscriptions","organizations_url":"https://api.github.com/users/skela/orgs","repos_url":"https://api.github.com/users/skela/repos","events_url":"https://api.github.com/users/skela/events{/privacy}","received_events_url":"https://api.github.com/users/skela/received_events","type":"User","site_admin":false},"created_at":"2015-04-24T02:52:09Z","updated_at":"2015-04-24T02:52:09Z","body":"I realise now that I've never had to do any kind of dynamic linking before for mobile. But unfortunately, I'm finding lots of information about how dynamic linking is not supported or even allowed on iOS, so this cannot be done that route (Apple rejects the app when you try to upload it to the App Store if dynamic libs are found).\r\n\r\nSo its either static linking, but maybe I could look into attaching the code to the Xcode project directly.\r\nJust in case you didn't know, iOS development is done in Objective-c , and you can include both C and C++ code in your projects.\r\n\r\nI wasn't able to get jhbuild working, but ill keep that in mind."}}