Skip to main content
GameDev.net gamedev.net
🔒 Locked

Scriptstdstring add-on under clang/LLVM 4.0 with libc++ and C++11

Started by Ricky C. Jul 29, 2012 at 10:51 PM 2 replies 2.5k views
Original Post
Ricky C.
Ricky C.
I (finally) got our entire engine to compile - see more about the epic saga in my blog post Adventures in compiling for Mac OSX. However to do so, I had to patch one add-on. Turns out that under clang/LLVM, when using the libc++ standard library, the operator+= and empty() methods of std::basic_string are inlined. This causes the linker to be unable to find the declarations the add-on is attempting to register - they don't exist.

After digging around, I was able to create the attached patch. This has allowed for compilation on my systems: OSX 10.7 and 10.8 using XCode 4.3 and 4.4 respectively. I have not yet tested execution, as there's still many yards of code for me to write to get there.
WitchLord
WitchLord
That's odd. It should be allowed to take the address of an inlined function. It will just force the compiler to provide a non-inlined version alongside the inlined one.

Anyway, I'll apply the patch as soon as possible.

Thanks,
Andreas
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - <a href="http://www.angelcode.com/tower" rel
Ricky C.
Ricky C.
I'm not 100% about the underlying cause. I did note that the std::basic_string::empty() method was marked for inlining, and I hypothesized off that. Beyond there.... All I'm 100% certain of is that providing wrapper functions cleared out the error. Someone with a far more extensive knowledge of the subject could dig deeper.
WitchLord
WitchLord
Patch applied in revision 1378.

Thanks,
Andreas
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - <a href="http://www.angelcode.com/tower" rel

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.