C++ Build Error C4503

I’ve been working on a code library that’s independent of the Unreal Engine, which is being built in to an Unreal project in a fashion very similar to this wiki page with MSVC 2015.

Recently, building produced a C4503 error “decorated name length exceeded, name was truncated”. This is likely caused by some variadic templates in the library code, but the error isn’t giving me any useful information about which one is particularly offending.

I might be able to shorten the offending name if there was any debug information about which template was responsible. Many other build systems provide a detailed entry for what the type was when the function failed, which UBT doesn’t seem to be providing here. Is there any way to get more detail from the error?

Alternatively, I know that others have seen and disabled this error (which is normally an MSVC warning) in previous Unreal versions. Is this still possible in Unreal 4.14+?

Modifying the external library is an option, but I can’t tell from this what specifically needs to be changed. Getting rid of all references to make_unique_deleter function is not really an option, unfortunately.

Line 41 of CameraDirector.cpp is just the end of the file, there’s literally nothing there. I’m not sure why the error is marked there.

+1 That’s just what I was thinking. I’ve isolated the start of the chain using change bisection (just as you were thinking). It was actually in an included header file, and I think I have a solution for removing the error.

That being said, the question of how to get more detail out of the build system, or whether this error can be disabled are still open.

Thanks for your help!

Just in case anyone comes across this later, the C4503 error can be disabled by modifying the “/Engine/Source/Runtime/Core/Public/Windows/WindowsPlatformCompilerSetup.h” file.

I still have no idea why the error reporting for this is so distinctly unhelpful, or whether it’s possible to make it better.

Post your full build log output, please. There’s often more usable info in there than in the parsed version.

Here’s the full compiler output (after the boilerplate).

...\Unreal Projects\CameraV3\Source\CameraV3\CameraDirector.cpp(41): error C4503: 'sol::detail::make_unique_deleter': decorated name length exceeded, name was truncated
3>ERROR : UBT error : Failed to produce item: ...\Unreal Projects\CameraV3\Binaries\Win64\UE4Editor-CameraV3.dl
3> Total build time: 43.34 seconds
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(46,5): error MSB3073: The command ""C:\Program Files (x86)\Epic Games\4.14\Engine\Build\BatchFiles\Rebuild.bat" CameraV3Editor Win64 Development "...\Unreal Projects\CameraV3\CameraV3.uproject" -waitmutex" exited with code -1.

I already know that “sol::detail::make_unique_deleter” is a template function which is called by about a hundred other template functions, and therefore isn’t a very helpful identifier (hence why I didn’t post it with the initial question). If you can make something more of this than I can, I’m all ears.

Any ideas?

Is modifying the external code library you’re referencing an option?

Also, could you post a a couple lines of code surrounding CameraDirector.cpp line 41?

You shouldn’t need to get rid of all references to make_unique_deleter. The most likely cause is a chain of templated function calls. (Like, a templated function that calls a templated function that calls a templated function that eventually ends up calling make_unique_deleter.) It’s that specific call which you need to kill, and you should be able to do that by just creating a version of it which accepts a specific type. (Or possibly more than one layer deep depending on how much you’re exceeding the name length limit by.)

The problem is finding that chain of calls - because it’s most likely not going to be a direct call to make_unique_deleter. That’s why I was asking about CameraDirector.cpp - I was hoping that that would lead to the start of the chain.

It’s only a 41 line long file, though. There’s nothing in there which seems like it might eventually lead to make_unique_deleter?

A way to tell for sure would be to comment out the contents of every function in that cpp and see if the error persists. If it doesn’t, it means that the start of the chain is in CameraDirector.cpp and then hopefully you could find it manually or by doing a binary search by commenting out different parts of the file.