我的项目100%致力于IOS 6.1,但随着我的改变,我得到了以下问题
clang: warning: argument unused during compilation: '-stdlib'
Undefined symbols for architecture armv7:
"std::cerr", referenced from:
ImageCodec::unregisterCodec(ImageCodec*) in ocrkit-bin.o
colorspace_convert(Image&, int, int, unsigned char) in ocrkit-bin.o
colorspace_by_name(Image&, std::string const&, unsigned char) in ocrkit-bin.o
flipX(Image&) in ocrkit-bin.o
rot90(Image&, int) in ocrkit-bin.o
exif_rotate(Image&, unsigned int) in ocrkit-bin.o
BMPCodec::writeImage(std::ostream*, Image&, int, std::string const&) in ocrkit-bin.o
...
"std::string::operator+=(std::string const&)", referenced from:
Args::str() in ocrkit-bin.o
"std::__throw_length_error(char const*)", referenced from:
std::vector<PDFObject*, std::allocator<PDFObject*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<PDFObject**, std::vector<PDFObject*, std::allocator<PDFObject*> > >, PDFObject* const&) in ocrkit-bin.o
std::vector<unsigned char, std::allocator<unsigned char> >::_M_fill_insert(__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned long, unsigned char const&) in ocrkit-bin.o
std::vector<unsigned char, std::allocator<unsigned char> >::_M_insert_aux(__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned char const&) in ocrkit-bin.o
l4495 in ocrkit-bin.o
l4497 in ocrkit-bin.o
l4499 in ocrkit-bin.o
l4501 in ocrkit-bin.o
...
"std::string::clear()", referenced from:
PDFContentStream::writeStreamImpl(std::ostream&) in ocrkit-bin.o
"std::basic_ios<char, std::char_traits<char> >::clear(std::_Ios_Iostate)", referenced from:
PDFXObject::writeStreamImpl(std::ostream&) in ocrkit-bin.o
PDFContentStream::writeStreamImpl(std::ostream&) in ocrkit-bin.o
"std::ostream::operator<<(double)", referenced from:
quantize::quantize(double, int) in ocrkit-bin.o
"std::ostream::operator<<(unsigned long long)", referenced from:
PDFNumber::writeImpl(std::ostream&) in ocrkit-bin.o
PDFTrailer::write(std::ostream&) in ocrkit-bin.o
"std::_List_node_base::hook(std::_List_node_base*)", referenced from:
std::list<ImageCodec::loader_ref, std::allocator<ImageCodec::loader_ref> >::_M_insert(std::_List_iterator<ImageCodec::loader_ref>, ImageCodec::loader_ref const&) in ocrkit-bin.o
std::list<PDFObject*, std::allocator<PDFObject*> >::_M_insert(std::_List_iterator<PDFObject*>, PDFObject* const&) in ocrkit-bin.o
std::list<PDFXObject*, std::allocator<PDFXObject*> >::_M_insert(std::_List_iterator<PDFXObject*>, PDFXObject* const&) in ocrkit-bin.o
std::list<PDFPage*, std::allocator<PDFPage*> >::_M_insert(std::_List_iterator<PDFPage*>, PDFPage* const&) in ocrkit-bin.o
"std::basic_ofstream<char, std::char_traits<char> >::open(char const*, std::_Ios_Openmode)", referenced from:
PrintLines(void*, char const*) in ocrkit-bin.o
"std::string::operator[](unsigned long)", referenced from:
PNG2Codec::readImage(std::istream*, Image&, std::string const&) in ocrkit-bin.o
quantize::quantize(double, int) in ocrkit-bin.o
"std::basic_ios<char, std::char_traits<char> >::fill(char)", referenced from:
PDFXref::write(std::ostream&) in ocrkit-bin.o
"std::string::operator=(std::string const&)", referenced from:
quantize::quantize(double, int) in ocrkit-bin.o
PDFXObject::writeStreamTagsImpl(std::ostream&) in ocrkit-bin.o
Args::str() in ocrkit-bin.o
"std::ostream::tellp()", referenced from:
PDFXref::write(std::ostream&) in ocrkit-bin.o
PDFStream::writeImpl(std::ostream&) in ocrkit-bin.o
PDFObject::write(std::ostream&) in ocrkit-bin.o
"std::basic_ostream<char, std::char_traits<char> >& std::operator<<<std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char)", referenced from:
PDFXref::write(std::ostream&) in ocrkit-bin.o
PNG2Codec::readImage(std::istream*, Image&, std::string const&) in ocrkit-bin.o
"std::_Rb_tree_increment(std::_Rb_tree_node_base const*)", referenced from:
PDFPage::writeImpl(std::ostream&) in ocrkit-bin.o
Args::str() in ocrkit-bin.o
"std::basic_ostream<char, std::char_traits<char> >& std::operator<<<std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, unsigned char)", referenced from:
l022 in ocrkit-bin.o
"std::string::append(char const*)", referenced from:
_ocrForImage in ocrkit-bin.o
我使用了这些-ObjC -lxml2 -all_load -lstdc ++所有链接器标志,并且它100%使用IOS 6.1 IOS 7.0编译器有什么问题
答案 0 :(得分:4)
您的项目可能使用已使用gcc编译的其他一些框架或嵌入式项目,并且已将项目切换为7.0已开始使用llvm进行构建。
您可以强制项目在目标的构建设置的Apple LLVM 5.0 - C ++部分中使用gcc的标准库
答案 1 :(得分:1)
错误表明C ++标准库没有链接,我认为llvm
需要传递
-stdlib=libc++
而不是
-lstdc++
(由gcc使用?) 虽然不完全确定,但我自己并没有将C ++与Objective C混合使用。
您可能使用过GCC i.s.o. iOS7之前的LLVM,因此通过更新项目来更改编译器(可能是无意的)。