Repository: OGRECave/ogre

Issue #894: Building fails on MacOS Mojave due to linker errors
Created: 2018-10-11T09:37:52Z
System Information

Ogre Version: 1.11.2 stable (from source)
Operating System / Platform: macOS 10.14 (Mojave)
RenderSystem: OpenGL (looking at the linker error, at least)

Detailled description
I downloaded the latest source today, ran cmake -GXcode .. in a build subdirectory. Changing the architecture to x86_64, I built the project. Compiling apparently runs through, but I get linker errors afterwards.
Below is the complete log of the linking errors.
Ogre.log
Ld build/lib/macosx/RelWithDebInfo/RenderSystem_GL.framework/Versions/1.11.2/RenderSystem_GL normal x86_64
    cd /Users/michael/Code/Game/ogre
    export MACOSX_DEPLOYMENT_TARGET=10.14
    /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.14.sdk -L/Users/michael/Code/Game/ogre/build/lib/macosx/RelWithDebInfo -F/Users/michael/Code/Game/ogre/build/lib/macosx/RelWithDebInfo -filelist /Users/michael/Code/Game/ogre/build/RenderSystems/GL/OGRE.build/RelWithDebInfo/RenderSystem_GL.build/Objects-normal/x86_64/RenderSystem_GL.LinkFileList -install_name @executable_path/../Frameworks/RenderSystem_GL.framework/Versions/1.11.2/RenderSystem_GL -Xlinker -rpath -Xlinker /Users/michael/Code/Game/ogre/build/sdk/lib -mmacosx-version-min=10.14 -Xlinker -object_path_lto -Xlinker /Users/michael/Code/Game/ogre/build/RenderSystems/GL/OGRE.build/RelWithDebInfo/RenderSystem_GL.build/Objects-normal/x86_64/RenderSystem_GL_lto.o -stdlib=libc++ -framework Cocoa -framework Carbon -framework OpenGL -framework AGL /Users/michael/Code/Game/ogre/build/lib/macosx/RelWithDebInfo/libOgreGLSupport.a -framework OpenGL /Users/michael/Code/Game/ogre/build/lib/macosx/RelWithDebInfo/Ogre.framework/Versions/1.11.2/Ogre -current_version 1.11.2 -Xlinker -dependency_info -Xlinker /Users/michael/Code/Game/ogre/build/RenderSystems/GL/OGRE.build/RelWithDebInfo/RenderSystem_GL.build/Objects-normal/x86_64/RenderSystem_GL_dependency_info.dat -o /Users/michael/Code/Game/ogre/build/lib/macosx/RelWithDebInfo/RenderSystem_GL.framework/Versions/1.11.2/RenderSystem_GL
Undefined symbols for architecture x86_64:
  "Ogre::GpuProgram::setSyntaxCode(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:

  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Showing first 200 notices only
Showing first 200 errors only

** BUILD FAILED **


The following build commands failed:
	Ld build/lib/macosx/RelWithDebInfo/RenderSystem_GL.framework/Versions/1.11.2/RenderSystem_GL normal x86_64
(1 failure)

Duplicate issue #1144: Build failure on macOS 10.14 Xcode 10.2 
Created: 2019-03-26T21:57:13Z
System Information

Ogre Version: :1.11.6:
Operating System / Platform: :macOS 10.14.3:
RenderSystem: ❔

Detailled description
OgreMain builds without errors but anything trying to link to it has errors like this:
Ld /Users/glenn/rp/ogre-1-11-build/bin/Debug/VRMLConverter normal x86_64 (in target: VRMLConverter)
cd /Users/glenn/rp/src/InRow/dep/ogre-1-11
export MACOSX_DEPLOYMENT_TARGET=10.14
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -L/Users/glenn/rp/ogre-1-11-build/bin/Debug -F/Users/glenn/rp/ogre-1-11-build/bin/Debug -filelist /Users/glenn/rp/ogre-1-11-build/Tools/VRMLConverter/OGRE.build/Debug/VRMLConverter.build/Objects-normal/x86_64/VRMLConverter.LinkFileList -mmacosx-version-min=10.14 -Xlinker -object_path_lto -Xlinker /Users/glenn/rp/ogre-1-11-build/Tools/VRMLConverter/OGRE.build/Debug/VRMLConverter.build/Objects-normal/x86_64/VRMLConverter_lto.o -Xlinker -no_deduplicate -stdlib=libc++ -framework Carbon -framework Cocoa -Wl,-search_paths_first -Wl,-headerpad_max_install_names /Users/glenn/rp/ogre-1-11-build/lib/macosx/Debug/Ogre.framework/Versions/1.11.6/Ogre -Xlinker -dependency_info -Xlinker /Users/glenn/rp/ogre-1-11-build/Tools/VRMLConverter/OGRE.build/Debug/VRMLConverter.build/Objects-normal/x86_64/VRMLConverter_dependency_info.dat -o /Users/glenn/rp/ogre-1-11-build/bin/Debug/VRMLConverter
Undefined symbols for architecture x86_64:
"Ogre::LogManager::logMessage(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, Ogre::LogMessageLevel, bool)", referenced from:
_main in VRML2mesh.o
Ogre::LogManager::logMessage(Ogre::LogMessageLevel, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, bool) in VRML2mesh.o
parseShape(Ogre::Mesh*, vrmllib::Shape const*, Ogre::Matrix4) in VRML2mesh.o
parseMaterial(vrmllib::Appearance const*, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) in VRML2mesh.o
"Ogre::LogManager::logWarning(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, bool)", referenced from:
parseShape(Ogre::Mesh*, vrmllib::Shape const*, Ogre::Matrix4) in VRML2mesh.o
"Ogre::LogManager::getSingleton()", referenced from:
parseShape(Ogre::Mesh*, vrmllib::Shape const*, Ogre::Matrix4) in VRML2mesh.o
parseMaterial(vrmllib::Appearance const*, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&) in VRML2mesh.o
"Ogre::LogManager::createLog(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, bool, bool, bool)", referenced from:
_main in VRML2mesh.o
The linker errors always seem to involve std::__1::basic_string<char, std::__1::char_traits so it looks to me like a libc++ compatibility issue, however the compile commands all have -stdlib=libc++ .

Closing comment (2019-03-26T22:04:20Z): duplicate of #894. Its trying to link x86_64 against i386