Mavericks Build Failure because of unexported symbols

in Bug Reports
Install dependencies with de-facto standard homebrew on brand new machine with OSX Mavericks 10.9 (i.e. not upgraded from something else)
Attempt to build Ice 4.5.1 with Xcode 5.0.1 clang compiler.
Use modification detailed in http://www.zeroc.com/forums/bug-reports/6151-cant-build-osx-mavericks-because-ssl-deprecation.html to get past previous error.
This happens because:
Not sure how to solve that.
Attempt to build Ice 4.5.1 with Xcode 5.0.1 clang compiler.
Use modification detailed in http://www.zeroc.com/forums/bug-reports/6151-cant-build-osx-mavericks-because-ssl-deprecation.html to get past previous error.
xcrun clang++ -Wl,-rpath,@loader_path/../lib -g -Wall -Werror -L../../lib -o ../../bin/icegridnode Internal.o DescriptorParser.o DescriptorBuilder.o TraceLevels.o FileCache.o PlatformInfo.o SessionManager.o NodeI.o NodeServerAdminRouter.o ServerI.o ServerAdapterI.o Activator.o NodeSessionManager.o AdminCallbackRouter.o RegistryI.o RegistryServerAdminRouter.o InternalRegistryI.o Allocatable.o AdapterCache.o ObjectCache.o AllocatableObjectCache.o ServerCache.o NodeCache.o ReplicaCache.o Database.o LocatorI.o LocatorRegistryI.o AdminI.o Util.o DescriptorHelper.o NodeSessionI.o ReplicaSessionI.o ReapThread.o SessionI.o AdminSessionI.o SessionServantManager.o Topics.o QueryI.o FileUserAccountMapperI.o ReplicaSessionManager.o WellKnownObjectsManager.o IceGridNode.o -lIceGrid -lIceStorm -lIceStormService -lIceBox -lGlacier2 \ -lIcePatch2 -lIceDB -lIceXML -lIceSSL -lssl -lcrypto -lIce -lIceUtil Undefined symbols for architecture x86_64: "IceGrid::ServerInstanceHelper::operator=(IceGrid::ServerInstanceHelper const&)", referenced from: void std::__1::__tree<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, IceGrid::ServerInstanceHelper>, std::__1::__map_value_compare<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, IceGrid::ServerInstanceHelper, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, true>, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, IceGrid::ServerInstanceHelper> > >::__assign_multi<std::__1::__tree_const_iterator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, IceGrid::ServerInstanceHelper>, std::__1::__tree_node<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, IceGrid::ServerInstanceHelper>, void*> const*, long> >(std::__1::__tree_const_iterator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, IceGrid::ServerInstanceHelper>, std::__1::__tree_node<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, IceGrid::ServerInstanceHelper>, void*> const*, long>, std::__1::__tree_const_iterator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, IceGrid::ServerInstanceHelper>, std::__1::__tree_node<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, IceGrid::ServerInstanceHelper>, void*> const*, long>) in DescriptorHelper.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [../../bin/icegridnode] Error 1 make[1]: *** [IceGrid] Error 2 make: *** [all] Error 1
This happens because:
$ nm src/IceGrid/DescriptorHelper.o | c++filt | grep ServerInstanceHelper::operator= U IceGrid::ServerInstanceHelper::operator=(IceGrid::ServerInstanceHelper const&)
Not sure how to solve that.
0
Comments
Try removing line 250 in cpp/src/IceGrid/DescriptorHelper.h, this should fix the problem. We'll fix this for the next release, thanks for pointing it out.
Cheers,
Benoit.
but somewhat unsurprisingly that just leads to:
For now, you should be able to workaround the problem by adding -mmacosx-version-min=10.8 to the CPPFLAGS in cpp/config/Make.rules.Darwin or set MACOSX_DEPLOYMENT_TARGET=10.8 in your environment before building (and after a make clean).
Note that we also provide an OS X installer for Ice, see our download page.
Cheers,
Benoit.
Changing cpp/config/Make.rules.Darwin:
Results in (Too long to post here):
xcrun clang++ -dynamiclib -g -Wall -Werror -L../../lib -o ../../lib/libIceUtil - Pastebin.com
Or doing this before building:
Results in:
You can get the OS X third party packages from our download page, if you want to build the third party packages your self you will need to also set MACOSX_DEPLOYMENT_TARGET=10.8 when you build DB, so it uses the same c++ runtime than Ice.
Ok, I see that that will probably work, but you still have a pretty serious issue here going forwards.
You need to also comment out the operator= from line 250 as Benoit commented.
The problem is that types used in std::map must be assignable, an a const member prevents the compiler from generated the assignment operator.
Much better solution, thanks. I guess both of these will be fixed in the next release as it's a general c++11 problem? As it's meant to be const you'll just have to implement it yourself.