Compilation error targeting Linux: error : 'this' pointer cannot be null in well-defined C++ code

I’ve installed the toolchain, set LINUX_ROOT, and regenerated project files. Linux is available as a platform from within VS2013. Unfortunately, when I build the UE4 project I get a bunch of errors:

1>Runtime/CoreUObject/Public/UObject\UnrealType.h(3056,7): error : 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true [-Werror,-Wundefined-bool-conversion]
1>          if ( this && SomeObject != this )
1>               ^~~~ ~~

1>Runtime/Engine/Public\InstancedFoliage.h(254,2): error : constructor cannot have a return type
1>          const FFoliageMeshInfo(const FFoliageMeshInfo& Other) = delete;
1>          ^~~~~~

1>C:\dev\UnrealEngine\Engine\Source\Runtime\SlateRHIRenderer\Private\SlateRHIFontTexture.cpp(74,3): error : 'const' qualifier on reference type '_ParamType1' (aka 'FSlateFontAtlasRHI &') has no effect [-Werror,-Wignored-qualifiers]
1>                  ENQUEUE_UNIQUE_RENDER_COMMAND_ONEPARAMETER( SlateUpdateFontTextureCommand,
1>                  ^

I’m using the linked toolchain (v4_clang-3.5.0_ld-2.24_glibc-2.12.2) on Windows 7. CrashReportClient builds fine, FWIW (I suspect not much).

Hey subjunctive-

There are a few questions I have to help me test your issue. Are you building a the editor or building a project? If you’re building a project is it a new project or are you compiling changes made to an existing project? You also mention both Windows 7 as well as Linux, could you elaborate on how your machine is setup?

Cheers

I’ve tried building the editor and client configs. I am building on a Windows system by cross-compiling, using VS2013. I’ve installed the toolchain linked from A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums and configured LINUX_ROOT appropriately. I’m then selecting Linux Development Client as my build configuration, and building the UE4 project via right-click → build.

Hey subjunctive-

Thanks for the information. I’m trying to work through the setup you mention and also need to know which version of the engine are you trying to build?

Which UE version are you compiling? Starting with at least 4.5 UBT passes -Wno-undefined-bool-conversion when it detects that the engine is being compiled with clang 3.5.0 or newer.

Unreal Engine 4.4 and earlier can only be compiled with clang 3.3-based cross-toolchain (the link to it is available in the respective Release page).

I was trying to build 4.3 (I think it’s the version that matches UnrealTournament). Trying to build with release gives me a different set of errors (EDIT: those were an artifact of the build environment for my release tree not being correct, apologies.)

Hey subjunctive-

As RCL mentioned, using engine versions 4.4 and earlier can only be compiled with clang 3.3. Since you are using clang 3.5 can you try building a more recent engine version such as the latest releases branch and let us know if you have the same error? Additionally, if you specifically need Unreal Engine 4.3 you can try getting an older version of clang and using that instead.

Cheers

UT is being developed off the latest released engine version (with some local changes), so you shouldn’t need to go that far back.