2013-09-23 35 views
2

我的項目100%的IOS 6.1的工作,但我改變我得到了以下問題參數編譯過程中未使用的:「-stdlib」

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++的所有鏈接器標誌和iOS 6.1 工作的100%什麼是IOS 7.0編譯器的問題

回答

4

您的項目可能會使用其他一些已經使用gcc編譯的框架或嵌入式項目,並且將項目切換到7.0已經開始使用llvm進行構建。

您可以強制項目中使用gcc的標準庫中的蘋果LLVM 5.0 - 你的目標的構建設置C++部分

LLVM C++ options

+0

太棒了!你爲我節省了很多時間:) – reflog

1

的錯誤表示一個C++標準庫不掛,我認爲llvm你需要傳遞

-stdlib=libc++ 

而不是

-lstdc++ 

(這是GCC使用?) 不能完全確定,雖然,我不與目標C混合C++自己。

您可能使用過GCC i.s.o.在iOS7之前的LLVM,所以編譯器(可能是無意的)通過更新您的項目進行更改。

+0

我已經加入-stdlib =的libC++作爲連接標誌位還是我有相同問題 –

相關問題