Archived
Linker error while building for iOS target Ice
Hello All .
Facing a linker issue while building ice for iOS target.
_iconv", referenced from:
IceUtil::IconvStringConverter::toUTF8(char const*, char const*, IceUtil::UTF8Buffer&) const in libIce.a(StringConverterPlugin_Ice_cpp.o)
IceUtil::IconvStringConverter::fromUTF8(unsigned char const*, unsigned char const*, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&) const in libIce.a(StringConverterPlugin_Ice_cpp.o)
IceUtil::IconvStringConverter::toUTF8(wchar_t const*, wchar_t const*, IceUtil::UTF8Buffer&) const in libIce.a(StringConverterPlugin_Ice_cpp.o)
IceUtil::IconvStringConverter::fromUTF8(unsigned char const*, unsigned char const*, std::__1::basic_string<wchar_t, std::__1::char_traits, std::__1::allocator >&) const in libIce.a(StringConverterPlugin_Ice_cpp.o)
"_iconv_open", referenced from:
IceUtil::IconvStringConverter::createDescriptors() const in libIce.a(StringConverterPlugin_Ice_cpp.o)
IceUtil::IconvStringConverter::createDescriptors() const in libIce.a(StringConverterPlugin_Ice_cpp.o)
"_iconv_close", referenced from:
IceUtil::IconvStringConverter::close(std::__1::pair<void*, void*>) in libIce.a(StringConverterPlugin_Ice_cpp.o)
IceUtil::IconvStringConverter::createDescriptors() const in libIce.a(StringConverterPlugin_Ice_cpp.o)
IceUtil::IconvStringConverter::close(std::__1::pair<void*, void*>) in libIce.a(StringConverterPlugin_Ice_cpp.o)
IceUtil::IconvStringConverter::createDescriptors() const in libIce.a(StringConverterPlugin_Ice_cpp.o)
How to overcome this. Pls suggest will be really helpful.
Comments
-
Hi,
Which Ice version do you use? Did you add
-liconvto the linker options in your Xcode project?See https://doc.zeroc.com/ice/3.7/release-notes/using-the-macos-binary-distribution#id-.UsingthemacOSBinaryDistributionv3.7-UsingXcodeSDKs for information on how to use the Xcode SDKs.
Cheers,
Benoit.0 -
Hi,
Hmm why do you think Xcode doesn't support the iconv library for iOS? It's in the Xcode iPhoneOS sdk (at the following location with my Xcode installation:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libiconv.tbd).What error do you get when you add the link with the iconv library to your Qt project?
Cheers,
Benoit.0 -
I'm not very familiar with QtCreator and
qmake... doesn't qmake create an Xcode projet from the Qt .pro file?The iconv library is installed as a dynamic library on iOS devices. I don't think Apple provides a static library for it so you'll need to dynamically link with this library. The fact that Apple only provides a stub (the .tbd file) in the iPhoneOS SDK shouldn't be an issue. The clang compiler should be able to deal with it and you shouldn't have to specify the library path with
-L<path>/libif the Qt build system callsxcrun -sdk iphoneos clang++or uses Xcode to build the application.Can you copy/paste the error you get if you just add
LIBS += -liconvto your Qt .pro file? Can you also copy the compiler/linker output showing the build flags?Btw, Ice Touch 3.7 doesn't exist... we've integrated Ice Touch into the main Ice 3.7 distribution. It looks like you're still using Ice Touch <= 3.6. I recommend to upgrade to Ice 3.7.2 instead, it supports the latest Xcode versions.
Cheers,
Benoit.0 -
@benoit
The linker error are same i started this forum topic.
Undefined symbols for architecture arm64:
"_iconv", referenced from:
IceUtil::IconvStringConverter::toUTF8(char const*, char const*, IceUtil::UTF8Buffer&) const in libIce.a(StringConverterPlugin_Ice_cpp.o)
IceUtil::IconvStringConverter::fromUTF8(unsigned char const*, unsigned char const*, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >&) const in libIce.a(StringConverterPlugin_Ice_cpp.o)
IceUtil::IconvStringConverter::toUTF8(wchar_t const*, wchar_t const*, IceUtil::UTF8Buffer&) const in libIce.a(StringConverterPlugin_Ice_cpp.o)
IceUtil::IconvStringConverter::fromUTF8(unsigned char const*, unsigned char const*, std::__1::basic_string<wchar_t, std::__1::char_traits, std::__1::allocator >&) const in libIce.a(StringConverterPlugin_Ice_cpp.o)
"_iconv_open", referenced from:
IceUtil::IconvStringConverter::createDescriptors() const in libIce.a(StringConverterPlugin_Ice_cpp.o)
IceUtil::IconvStringConverter::createDescriptors() const in libIce.a(StringConverterPlugin_Ice_cpp.o)
"_iconv_close", referenced from:
IceUtil::IconvStringConverter::close(std::__1::pair<void*, void*>) in libIce.a(StringConverterPlugin_Ice_cpp.o)
IceUtil::IconvStringConverter::createDescriptors() const in libIce.a(StringConverterPlugin_Ice_cpp.o)
IceUtil::IconvStringConverter::close(std::__1::pair<void*, void*>) in libIce.a(StringConverterPlugin_Ice_cpp.o)
IceUtil::IconvStringConverter::createDescriptors() const in libIce.a(StringConverterPlugin_Ice_cpp.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)The compiler is provided by Mac for iOS and is integrated with Qt build system itself. It works very well if i do not have dependency on ICE.
Note: If i remove LIBS += -liconv and build for Mac OSX target it builds without linker errors.
0
