1

I tried to embed use the Imebra library as Dicom file viewer in my iOS app. But when I built the Imebra library via "cmake --build ." on command line after "cmake install...", Errors came out as the following

Undefined symbols for architecture x86_64: "_iconv", referenced from: imebra::charsetConversionIconv::myIconv(void*, char*, unsigned long) const in charsetConversionIconvImpl.cpp.o "_iconv_close", referenced from: imebra::charsetConversionIconv::~charsetConversionIconv() in charsetConversionIconvImpl.cpp.o "_iconv_open", referenced from: imebra::charsetConversionIconv::charsetConversionIconv(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in charsetConversionIconvImpl.cpp.o

Can someone help me with it?

Amit Joshi
  • 15,448
  • 21
  • 77
  • 141
YLei
  • 11
  • 1
  • Mac already has the libiconv Library, and I reinstall it using Brew, but the error came out again. – YLei Jul 18 '16 at 19:33
  • this build fails for me, too. So the path to libiconv mast be added to the project, I think. – john elemans Jul 18 '16 at 22:17
  • @johnelemans Thanks for your reply. Did you embed the Imebra library successfully in your APP? – YLei Jul 19 '16 at 04:26

2 Answers2

0

The cmake file does not specify the iconv library when it selects it by default. Try launching cmake explicitly specifying iconv:

Cmake -DIMEBRA_CHARSET_CONVERSION=ICONV

UPDATE

A bug in the CMakeLists.txt has been fixed in version 4.0.5.3 of the library.

Basically, while explicitly linking to iconv on Linux causes the build to fail, the opposite is true on OS-X. The resolution consisted in explicitly linking to iconv when running the build on OS-X.

Paolo Brandoli
  • 4,681
  • 26
  • 38
  • Hi Paolo, thank you for the reply. After I run cmake -DIMEBRA_CHARSET_CONVERSION=ICONV ../imebra_4_0_0_4/library AND cmake --build . I still got the same error. Did I compile it wroing? Many Thanks – YLei Jul 21 '16 at 07:09
  • http://stackoverflow.com/questions/4546484/iconv-routines-get-translated-to-libiconv-names-and-fail-to-link-on-os-x may resolve the problem – Paolo Brandoli Jul 21 '16 at 17:22
0

i have just installed it successfuly without any error. here is what i did...

follow commandline instructions provided on imebra compilling documentation instead of gui. if you are getting error at cmake command (for being not recognized as a valid command) then you have to install CMake command line tools.

Here is a tutorial: https://www.youtube.com/watch?v=sK4sVg4SRsg

To generate a library for the iPhone simulator, type the following (replace imebra_location with the path to Imebra):

mkdir imebra_for_ios
cd imebra_for_ios
cmake imebra_location -DIOS=SIMULATOR
cmake --build

To generate a library for iPhone, type the following (replace imebra_location with the path to Imebra):

mkdir imebra_for_ios
cd imebra_for_ios
cmake imebra_location -DIOS=IPHONE
cmake --build
Cheema
  • 1