iphone - Linking problem in Xcode when using a dependent subproject -
i using xcode write iphone project , use external library. added xcode project file parent target , adjusted header search path , set direct dependency in parent's build target.
now strange thing happens: can open library , compile without problems. library links frameworks e.g. avfoundation.framework
.
i clean target , start building parent project. in build results see builds library, linking fails these error messages:
undefined symbols: "_avcapturesessionpresetmedium", referenced from: _avcapturesessionpresetmedium$non_lazy_ptr in libzxingwidget.a(zxingwidgetcontroller.o) (maybe meant: _avcapturesessionpresetmedium$non_lazy_ptr) "_cvpixelbuffergetheight", referenced from: -[zxingwidgetcontroller captureoutput:didoutputsamplebuffer:fromconnection:] in libzxingwidget.a(zxingwidgetcontroller.o) "_cvpixelbufferlockbaseaddress", referenced from: -[zxingwidgetcontroller captureoutput:didoutputsamplebuffer:fromconnection:] in libzxingwidget.a(zxingwidgetcontroller.o) "_audioservicesplaysystemsound", referenced from: -[zxingwidgetcontroller presentresultforstring:] in libzxingwidget.a(zxingwidgetcontroller.o) "_audioservicescreatesystemsoundid", referenced from: -[zxingwidgetcontroller viewwillappear:] in libzxingwidget.a(zxingwidgetcontroller.o) "_cvpixelbufferunlockbaseaddress", referenced from: -[zxingwidgetcontroller captureoutput:didoutputsamplebuffer:fromconnection:] in libzxingwidget.a(zxingwidgetcontroller.o) "_cvpixelbuffergetbaseaddress", referenced from: -[zxingwidgetcontroller captureoutput:didoutputsamplebuffer:fromconnection:] in libzxingwidget.a(zxingwidgetcontroller.o) "_cvpixelbuffergetbytesperrow", referenced from: -[zxingwidgetcontroller captureoutput:didoutputsamplebuffer:fromconnection:] in libzxingwidget.a(zxingwidgetcontroller.o) "_iconv_close", referenced from: zxing::qrcode::decodedbitstreamparser::append(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned char const*, unsigned long, char const*)in libzxingwidget.a(decodedbitstreamparser-64e27b33e79cbc52.o) zxing::qrcode::decodedbitstreamparser::append(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned char const*, unsigned long, char const*)in libzxingwidget.a(decodedbitstreamparser-64e27b33e79cbc52.o) "_objc_class_$_avcapturevideopreviewlayer", referenced from: objc-class-ref-to-avcapturevideopreviewlayer in libzxingwidget.a(zxingwidgetcontroller.o) "_iconv", referenced from: zxing::qrcode::decodedbitstreamparser::append(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned char const*, unsigned long, char const*)in libzxingwidget.a(decodedbitstreamparser-64e27b33e79cbc52.o) "_objc_class_$_avcapturesession", referenced from: objc-class-ref-to-avcapturesession in libzxingwidget.a(zxingwidgetcontroller.o) "_objc_class_$_avcapturedevice", referenced from: objc-class-ref-to-avcapturedevice in libzxingwidget.a(zxingwidgetcontroller.o) "_kcvpixelbufferpixelformattypekey", referenced from: _kcvpixelbufferpixelformattypekey$non_lazy_ptr in libzxingwidget.a(zxingwidgetcontroller.o) (maybe meant: _kcvpixelbufferpixelformattypekey$non_lazy_ptr) "_objc_class_$_avcapturevideodataoutput", referenced from: objc-class-ref-to-avcapturevideodataoutput in libzxingwidget.a(zxingwidgetcontroller.o) "_cvpixelbuffergetwidth", referenced from: -[zxingwidgetcontroller captureoutput:didoutputsamplebuffer:fromconnection:] in libzxingwidget.a(zxingwidgetcontroller.o) "_audioservicesdisposesystemsoundid", referenced from: -[zxingwidgetcontroller dealloc] in libzxingwidget.a(zxingwidgetcontroller.o) "_objc_class_$_avcapturedeviceinput", referenced from: objc-class-ref-to-avcapturedeviceinput in libzxingwidget.a(zxingwidgetcontroller.o) "_avlayervideogravityresizeaspectfill", referenced from: _avlayervideogravityresizeaspectfill$non_lazy_ptr in libzxingwidget.a(zxingwidgetcontroller.o) (maybe meant: _avlayervideogravityresizeaspectfill$non_lazy_ptr) "_cmsamplebuffergetimagebuffer", referenced from: -[zxingwidgetcontroller captureoutput:didoutputsamplebuffer:fromconnection:] in libzxingwidget.a(zxingwidgetcontroller.o) "_iconv_open", referenced from: zxing::qrcode::decodedbitstreamparser::append(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned char const*, unsigned long, char const*)in libzxingwidget.a(decodedbitstreamparser-64e27b33e79cbc52.o) "_avmediatypevideo", referenced from: _avmediatypevideo$non_lazy_ptr in libzxingwidget.a(zxingwidgetcontroller.o) (maybe meant: _avmediatypevideo$non_lazy_ptr) ld: symbol(s) not found collect2: ld returned 1 exit status
i can include needed frameworks in parent project, thought including frameworks in library project linking ok.
my question is: have include frameworks dependent subprojects use in parent project ensure proper linking, or doing wrong?
thanks help.
if subproject compiles static lib, yes.
Comments
Post a Comment