undefined iconv symbols on Mac OS X with CEGUI 0.8.7

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

ma2020
Just popping in
Just popping in
Posts: 8
Joined: Mon Jul 13, 2020 02:07

undefined iconv symbols on Mac OS X with CEGUI 0.8.7

Postby ma2020 » Fri Aug 14, 2020 19:41

When building CEGUI using any of the project types that CMake can make, several undefined symbol errors involving iconv happen.

[ 70%] Linking CXX shared library ../../lib/libCEGUIBase-0.dylib
Undefined symbols for architecture x86_64:
"_libiconv", referenced from:
__ZNK5CEGUI21IconvStringTranscoder13stringToUTF16ERKNS_6StringE in IconvStringTranscoder.cpp.o
__ZNK5CEGUI21IconvStringTranscoder18stringToStdWStringB5cxx11ERKNS_6StringE in IconvStringTranscoder.cpp.o
__ZN5CEGUIL14iconvTranscodeINS_6StringEhEET_RNS_11IconvHelperEPKcm in IconvStringTranscoder.cpp.o
"_libiconv_close", referenced from:
__ZN5CEGUI11IconvHelperD1Ev in IconvStringTranscoder.cpp.o
__ZNK5CEGUI21IconvStringTranscoder13stringToUTF16ERKNS_6StringE in IconvStringTranscoder.cpp.o
__ZNK5CEGUI21IconvStringTranscoder18stringToStdWStringB5cxx11ERKNS_6StringE in IconvStringTranscoder.cpp.o
__ZNK5CEGUI21IconvStringTranscoder15stringFromUTF16EPKt in IconvStringTranscoder.cpp.o
__ZNK5CEGUI21IconvStringTranscoder20stringFromStdWStringERKNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEE in IconvStringTranscoder.cpp.o
"_libiconv_open", referenced from:
__ZN5CEGUI11IconvHelperC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_ in IconvStringTranscoder.cpp.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libCEGUIBase-0.dylib] Error 1
make[1]: *** [cegui/src/CMakeFiles/CEGUIBase-0.dir/all] Error 2
make: *** [all] Error 2

The fix for this problem is to add libiconv.dylib to the linking phase.

My info:
OS: Mac OS 10.8.
Compiler: GCC and Clang
CEGUI 0.8.7

ma2020
Just popping in
Just popping in
Posts: 8
Joined: Mon Jul 13, 2020 02:07

Re: undefined iconv symbols on Mac OS X with CEGUI 0.8.7

Postby ma2020 » Tue Aug 18, 2020 18:15

This problem happens when the MacPorts version of libiconv's headers are used and Mac OS X version of libiconv.dylib is used in linking. One possible solution is to deactivate the MacPorts version of libiconv: sudo port deactivate libiconv


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 2 guests