[SOLVED] CEGUI not compiling because of libiconv

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

markymark
Just popping in
Just popping in
Posts: 8
Joined: Sun Dec 29, 2013 11:00

[SOLVED] CEGUI not compiling because of libiconv

Postby markymark » Sun Dec 29, 2013 11:18

Hi,

I must be doing something dumb here.

I'm using CMake GUI 2.8-11, XCode 5 on OSX Mavericks. I use macports.
I need 64 bit versions of the libraries.
I compiled the dependencies without hitch.
When I try to compile CEGUI I get...

Code: Select all

setenv MACOSX_DEPLOYMENT_TARGET 10.9
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -L/Users/markymark/cegui/cegui-source-build/lib -F/Users/markymark/cegui/cegui-source-build/lib -filelist /Users/markymark/cegui/cegui-source-build/cegui/src/cegui.build/Release/CEGUIBase-0.build/Objects-normal/x86_64/CEGUIBase-0.LinkFileList -install_name @executable_path/../Frameworks/libCEGUIBase-0.dylib -mmacosx-version-min=10.9 -framework Carbon -dynamiclib -Wl,-headerpad_max_install_names /usr/lib/libiconv.dylib /opt/local/lib/libfreetype.dylib -single_module -Xlinker -dependency_info -Xlinker /Users/markymark/cegui/cegui-source-build/cegui/src/cegui.build/Release/CEGUIBase-0.build/Objects-normal/x86_64/CEGUIBase-0_dependency_info.dat -o /Users/markymark/cegui/cegui-source-build/lib/libCEGUIBase-0.dylib
Undefined symbols for architecture x86_64:
  "_libiconv", referenced from:
      CEGUI::IconvStringTranscoder::stringToUTF16(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const in IconvStringTranscoder.o
      std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > CEGUI::iconvTranscode<std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> >, wchar_t>(CEGUI::IconvHelper&, char const*, unsigned long) in IconvStringTranscoder.o
  "_libiconv_close", referenced from:
      CEGUI::IconvStringTranscoder::stringToUTF16(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const in IconvStringTranscoder.o
      CEGUI::IconvStringTranscoder::stringToStdWString(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const in IconvStringTranscoder.o
      CEGUI::IconvStringTranscoder::stringFromUTF16(unsigned short const*) const in IconvStringTranscoder.o
  "_libiconv_open", referenced from:
      CEGUI::IconvHelper::IconvHelper(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in IconvStringTranscoder.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **


The following build commands failed:
   Ld /Users/markymark/cegui/cegui-source-build/lib/libCEGUIBase-0.dylib normal x86_64
(1 failure)


I wanted a completely static library but it appears to be picking up libiconv.dylib from /usr/lib and /opt/local.

So I guess my questions are... why isn't it compiling ? and how to do I get cmake to only use static libraries ?

Thanks very much if you can help.

Mark

markymark
Just popping in
Just popping in
Posts: 8
Joined: Sun Dec 29, 2013 11:00

Re: CEGUI not compiling because of libiconv

Postby markymark » Sun Dec 29, 2013 16:51

It compiles fine under i386 and not under x86_64.
Unfortunately my project is 64-bit.

Mark

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: CEGUI not compiling because of libiconv

Postby Ident » Sun Dec 29, 2013 22:03

You can define static builds in cmake using CEGUI_BUILD_STATIC_CONFIGURATION and the options for the deps.
I am not sure if a fully static build is possible, a lot of libraries do not allow static builds in their license. Also static builds in general can create a lot of issues. It is recommended not to do static builds - may I ask why you want to do a static build?

Unfortunately i have no experience with CEGUI in 64 bit so I cant help you there.
CrazyEddie: "I don't like GUIs"

markymark
Just popping in
Just popping in
Posts: 8
Joined: Sun Dec 29, 2013 11:00

Re: CEGUI not compiling because of libiconv

Postby markymark » Mon Dec 30, 2013 14:08

Ident wrote: may I ask why you want to do a static build?

I want to have a source folder that has no system dependencies and when the resulting application is distributed it contains the correct version of all libraries. In the past this meant for me to link statically to the libraries. I might be out of date here and can distribute dylib's and DLL's with the project. In the old days we had DLL hell where the wrong DLL could be picked up causing unknown behaviour.

Ident wrote:Unfortunately i have no experience with CEGUI in 64 bit so I cant help you there.

Unfortunately 64-bit is a requirement for Mac and soon for iOS builds. CEGUI seems to compile fine it is the dependency on a system installed libiconv that seems to be the issue. Do you have an OSX maintainer with XCode 5 ?

Thanks for disrupting my old fashioned belief in static builds.

Mark

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: CEGUI not compiling because of libiconv

Postby Ident » Mon Dec 30, 2013 17:13

I think libiconv is LGPL, therefore if u link it STATICALLY to your your project, your project will be LGPL too, by license definition.

I do not know how Mac's work in the respect of dynamic libraries but on windows if you ship the dll's with your program then the application will pick up those dll's that lie in thesame folder. It shouldn't be possible that wrong dll's will be picked up, unless somebody intentionally places them there or removes them (in which case it could happen that dll's from the globally defined paths are used instead).

i found some stuff about macports and libiconv in 64 bit but nothing i can make much sense of in regards to ur issue. maybe u can try to google for the issue yourself, as a mac user you probably have more knowledge about mac problems than me. Apparently though this is not a CEGUI-related issue but an issue with that library not being available in macports for 64-bit, as far as i understood. I guess u can resolve this by building it yourself?

CrazyEddie uses a Mac OS as well, however he is not available for free CEGUI support right now and will probably return at some point in the future. We dont know when...
CrazyEddie: "I don't like GUIs"

markymark
Just popping in
Just popping in
Posts: 8
Joined: Sun Dec 29, 2013 11:00

Re: CEGUI not compiling because of libiconv

Postby markymark » Mon Dec 30, 2013 18:22

Hi,

Solved the problem, may be an issue for other mac dev's out there...

I removed macports from my machine and reinstalled it with the instructions here...
http://guide.macports.org/chunked/installing.macports.uninstalling.html

I installed libiconv and the problem still occurred.

I then found some text on universal macports.
https://trac.macports.org/wiki/howto/buildUniversal

then ran...

Code: Select all

port install libiconv +universal


CEGUI compiled in 64-bit.

Thanks for the pointers !

Mark

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: [SOLVED] CEGUI not compiling because of libiconv

Postby Ident » Tue Dec 31, 2013 01:13

Thanks for reporting back on how you solved your problem. I marked the thread as resolved.
CrazyEddie: "I don't like GUIs"


Return to “Help”

Who is online

Users browsing this forum: No registered users and 19 guests