Archived

This forum has been archived. Please start a new discussion on GitHub.

Failed to compile on OS X 10.6

I get this error after trying to compile ICE for OS X 10.6. Any guesses as to a possible fix?


c++ -dynamiclib -g -Wall -D_REENTRANT -L../../lib -o ../../lib/libIce.3.4.2.dylib -install_name /opt/Ice-3.4/lib/libIce.34.dylib Acceptor.o Application.o Base64.o Buffer.o BasicStream.o BuiltinSequences.o CommunicatorI.o Communicator.o ConnectRequestHandler.o ConnectionFactory.o ConnectionI.o ConnectionMonitor.o Connection.o ConnectionRequestHandler.o Connector.o Current.o DefaultsAndOverrides.o Direct.o DispatchInterceptor.o DynamicLibrary.o Endpoint.o EndpointFactoryManager.o EndpointFactory.o EndpointI.o EndpointTypes.o EventHandler.o Exception.o FacetMap.o FactoryTable.o FactoryTableInit.o GC.o Identity.o ImplicitContextI.o ImplicitContext.o IncomingAsync.o Incoming.o Initialize.o Instance.o LocalException.o LocalObject.o LocatorInfo.o Locator.o LoggerI.o Logger.o LoggerUtil.o Network.o ObjectAdapterFactory.o ObjectAdapterI.o ObjectAdapter.o ObjectFactoryManager.o ObjectFactory.o Object.o OpaqueEndpointI.o OutgoingAsync.o Outgoing.o PluginManagerI.o Plugin.o Process.o PropertiesI.o Properties.o PropertyNames.o Protocol.o ProtocolPluginFacade.o ProxyFactory.o Proxy.o ReferenceFactory.o Reference.o RetryQueue.o RequestHandler.o RouterInfo.o Router.o Selector.o ServantLocator.o ServantManager.o Service.o SliceChecksumDict.o SliceChecksums.o Stats.o StreamI.o Stream.o StringConverter.o SysLoggerI.o TcpAcceptor.o TcpConnector.o TcpEndpointI.o TcpTransceiver.o ThreadPool.o TraceLevels.o TraceUtil.o Transceiver.o UdpConnector.o UdpEndpointI.o UdpTransceiver.o -lIceUtil -lbz2 -liconv -ldl
Undefined symbols for architecture x86_64:
"_iconv_close", referenced from:
Ice::IconvStringConverter<char>::close(std::pair<void*, void*>)in StringConverter.o
Ice::IconvStringConverter<wchar_t>::close(std::pair<void*, void*>)in StringConverter.o
Ice::IconvStringConverter<char>::createDescriptors() constin StringConverter.o
Ice::IconvStringConverter<wchar_t>::createDescriptors() constin StringConverter.o
"_iconv_open", referenced from:
Ice::IconvStringConverter<char>::createDescriptors() constin StringConverter.o
Ice::IconvStringConverter<wchar_t>::createDescriptors() constin StringConverter.o
"_iconv", referenced from:
Ice::IconvStringConverter<char>::fromUTF8(unsigned char const*, unsigned char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&) constin StringConverter.o
Ice::IconvStringConverter<char>::toUTF8(char const*, char const*, Ice::UTF8Buffer&) constin StringConverter.o
Ice::IconvStringConverter<wchar_t>::toUTF8(wchar_t const*, wchar_t const*, Ice::UTF8Buffer&) constin StringConverter.o
Ice::IconvStringConverter<wchar_t>::fromUTF8(unsigned char const*, unsigned char const*, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >&) constin StringConverter.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[3]: *** [../../lib/libIce.3.4.2.dylib] Error 1
make[2]: *** [all] Error 1
make[1]: *** [all] Error 1
make: *** [all] Error 1

Comments

  • xdm
    xdm La Coruña, Spain
    Hi Victor,

    Seems that your iconv doesn't support x86_64 architecture, the default 10.6 libiconv supports x86_64 so seems you have override it with other.

    Check that:
    otool -fv /usr/lib/libiconv.dylib 
    Fat headers
    fat_magic FAT_MAGIC
    nfat_arch 3
    architecture x86_64
        cputype CPU_TYPE_X86_64
        cpusubtype CPU_SUBTYPE_X86_64_ALL
        capabilities 0x0
        offset 4096
        size 1078816
        align 2^12 (4096)
    architecture i386
        cputype CPU_TYPE_I386
        cpusubtype CPU_SUBTYPE_I386_ALL
        capabilities 0x0
        offset 1085440
        size 1053936
        align 2^12 (4096)
    architecture ppc7400
        cputype CPU_TYPE_POWERPC
        cpusubtype CPU_SUBTYPE_POWERPC_7400
        capabilities 0x0
        offset 2142208
        size 1063552
        align 2^12 (4096)
    

    If your iconv don't shows x86_64 architecture, you need to get a version that support this architecture, restoring from the 10.6 default or building it from sources with support for this.

    See also this blog post for similar problem, Mac OS X | Flowing
  • Thanks for the help.

    I bashed my head over this one for quite a while until i finally tried running make with sudo and it finally ended up linking with libiconv. (But I really have no idea why that helped.)

    After that, I slowly collected one dependency after another and rebuilt (rinse and repeat) until this little beauty showed up:
    make[3]: gmcs: No such file or directory
    make[3]: *** [../../bin/Ice.dll] Error 1

    the entire output of the failed command is bellow:
    gmcs -warnaserror -d:MAKEFILE_BUILD -debug -define:DEBUG -target:library -out:../../bin/Ice.dll -warnaserror- -keyfile:../../../config/IceDevKey.snk /doc:../../bin/Ice.xml /nowarn:1591 -unsafe+ Acceptor.cs AMDCallback.cs Application.cs Arrays.cs AssemblyInfo.cs AssemblyUtil.cs AsyncIOThread.cs Base64.cs BasicStream.cs Buffer.cs ByteBuffer.cs CommunicatorI.cs Compare.cs CollectionBase.cs Collections.cs ConnectRequestHandler.cs ConnectionI.cs ConnectionFactory.cs ConnectionMonitor.cs ConnectionReaper.cs ConnectionRequestHandler.cs Connector.cs DefaultsAndOverrides.cs DictionaryBase.cs Direct.cs DispatchInterceptor.cs EndpointI.cs EndpointFactory.cs EndpointFactoryManager.cs EndpointHostResolver.cs EventHandler.cs Exception.cs ImplicitContextI.cs IncomingAsync.cs Incoming.cs Instance.cs LinkedList.cs LocalObject.cs LocatorInfo.cs LoggerI.cs LoggerPlugin.cs Monitor.cs Network.cs ObjectAdapterFactory.cs ObjectAdapterI.cs Object.cs ObjectFactoryManager.cs OpaqueEndpointI.cs Options.cs OutgoingAsync.cs Outgoing.cs OutputBase.cs Patcher.cs PluginManagerI.cs ProcessI.cs PropertiesAdminI.cs PropertiesI.cs Property.cs PropertyNames.cs Protocol.cs ProtocolPluginFacade.cs Proxy.cs ProxyFactory.cs ProxyIdentityKey.cs Reference.cs ReferenceFactory.cs ReplyStatus.cs RequestHandler.cs RetryQueue.cs RouterInfo.cs ServantManager.cs SliceChecksums.cs SocketOperation.cs Stream.cs StreamI.cs StreamWrapper.cs StringUtil.cs SysLoggerI.cs TcpAcceptor.cs TcpConnector.cs TcpEndpointI.cs TcpTransceiver.cs ThreadHookPlugin.cs ThreadPool.cs TieBase.cs Time.cs Timer.cs TraceLevels.cs TraceUtil.cs Transceiver.cs UdpEndpointI.cs UdpConnector.cs UdpTransceiver.cs UserExceptionFactory.cs Util.cs ValueWriter.cs XMLOutput.cs generated/BuiltinSequences.cs generated/Communicator.cs generated/Connection.cs generated/Current.cs generated/Endpoint.cs generated/EndpointTypes.cs generated/FacetMap.cs generated/Identity.cs generated/ImplicitContext.cs generated/LocalException.cs generated/Locator.cs generated/Logger.cs generated/ObjectAdapter.cs generated/ObjectFactory.cs generated/Plugin.cs generated/Process.cs generated/Properties.cs generated/Router.cs generated/ServantLocator.cs generated/SliceChecksumDict.cs generated/Stats.cs
    make[3]: gmcs: No such file or directory
    make[3]: *** [../../bin/Ice.dll] Error 1
    make[2]: *** [all] Error 1
    make[1]: *** [all] Error 1
    make: *** [all] Error 1
    

    edit: i guess this was a bit of a premature post on my part. slice2cs for C# but I'm guessing that mapping isn't supported on OS X.
  • xdm
    xdm La Coruña, Spain
    You need to install mono if you want to build Ice for .NET. gmcs is mono compiler for 2.0 .NET runtime.
  • benoit
    benoit Rennes, France
    victor wrote: »
    Thanks for the help.

    I bashed my head over this one for quite a while until i finally tried running make with sudo and it finally ended up linking with libiconv. (But I really have no idea why that helped.)

    Most likely you have another iconv version installed in /usr/local and it's not used when compiling with sudo.

    Benoit.