Make : fatal error: 'new' file not found

I checked out latest UE4 version from git (4.7).
Setup.sh worked without problem.
$ ./GenerateProjectFiles.sh → works
make

Engine/Build/BatchFiles/Linux/Build.sh UE4Client Linux Debug 
Building UE4Client...
Using clang version '3.5.1' (string), 3 (major), 5 (minor), 1 (patch)
Building UnrealHeaderTool...
Using clang version '3.5.1' (string), 3 (major), 5 (minor), 1 (patch)
Performing 19 actions (4 in parallel)
[4/19] Compile Module.Core.3_of_5.cpp
[3/19] Compile Module.Core.4_of_5.cpp
[1/19] Compile Module.Core.2_of_5.cpp
[2/19] Compile Module.Core.1_of_5.cpp
In file included from /mnt/storage/jarvis/newgen/ue4/UnrealEngine/Engine/Intermediate/Build/Linux/x86_64-unknown-linux-gnu/UnrealHeaderTool/Development/Core/Module.Core.4_of_5.cpp:2:
In file included from /mnt/storage/jarvis/newgen/ue4/UnrealEngine/Engine/Source/Runtime/Core/Private/CorePrivatePCH.h:16:
Runtime/Core/Public/HAL/PlatformIncludes.h(5,10) : fatal error: 'new' file not found
#include <new>
         ^

This keeps repeating. What am I missing?

Hey thecr3w,

I’m assigning this post to someone on our team, but I just want to check one thing: are you intentionally trying to build for Linux?

Hello ,

well, I was told that UE4 is capable to run unter linux (although I expect even more crashes than in osx or windows).

Since app I am trying to migrate to UE will run mainly in linux (and only fast system I have is running fedora linux)… thats why I try running it under linux directly. So yes, it’s my intention.

Hey thecr3w-

I have a couple other questions for you to help me test issue you’re having. You seeing message while ./GenerateProjectFiles.sh is running, correct? Have you tried any other engine versions and received same error? When you mention “This keeps repeating” are you referring to everything from line 1 to line 14 or only line 14?

Cheers

Hi,
./GenerateProjectFiles.sh works fine.
I get this error while running “make”.

I will try other versions, but I had same problem with version 4.6.

While running make, following error repeats:

Runtime/Core/Public/HAL/PlatformIncludes.h(5,10) : fatal error: ‘new’ file not found

Checking PlatformIncludes.h, I can see in line 5:
#include

However: “new” is not found. It seems Unreal overloads “new” operator with their own “new”. Sadly, I have no clou, where that “new” is defined…

Are you running entire line of “$ make ShaderCompileWorker UnrealLightMass UnrealPak UE4Editor”? If so try doing a different make for each which could tell us exactly where in make process it is failing.

I have tried:

  • make ShaderCompileWorker
  • make UnrealLightMass
  • make UnrealPak
  • make UE4Editor

Each different make command generates error mentioned above. They all seem to rely on

  • Runtime/Core/Public/HAL/PlatformIncludes.h(5,10) : fatal error: ‘new’ file not found

In mean time, I downloaded UnrealEngine-Release. from git, extracted it and repeated installation.
However, I get stuck at same error.

Ok, I just realised that Setup.sh checks only for Ubuntu, Debian and LinuxMint.
Sadly, I am running Fedora. Therefore, I assume that Setup Script bypasses some requirements.

Hey thecr3w-

We currently only have automation for installing dependencies for Ubuntu and Ubuntu forks. following page details important dependencies if you do not already have them on your machine. Once you have installed those necessary you should be able to continue with installation.

https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Build/BatchFiles/Linux/README.md

Cheers

Ok, I switched from fedora to a current debian. Now, I am stuck even before this original problem. new problem is already described here by someone else…

sight
After several days of try and failure with these dependencies, i get really tired of this bugsearch. I killed my old Fedora linux, reinstalled my full disk encrypted System with debian… fixed nvidia driver … and now, after several hours I am facing THIS stupid bug?

Apologies for sounding frustrated, but it feels unbelievable unfair that f***k windows and even mac users just double click, while with my 8cpu server with 24gb ram and multiple grafic cards it’s simply not possible. I begin to have doubts that UE4 is right game engine to migrate my 2 year old project within linux…

We can close this thread unresolved, since I am not reinstalling fedora again.

Could you elaborate on what you are running into? bug you linked to is old and specific to 4.5/4.6, we don’t use GetAssets.py anymore.

As for OS, latest Ubuntu/Kubuntu is your safest bet. I understand frustration, but alas, part of problem is that there’s no single Linux “OS”, and as much as we try to stay reasonably distro-agnostic, we cannot test them all.

I’m having same problem on debian stable (jessie) when trying to build version 4.8.
strangest thing is that building in a virtual machine with same debian version works, so it must be something in my configuration.

I’m facing same problem “‘new’ file not found” on Ubuntu 14.04. Trying to build 4.9
Is there any solution available?

This is a link to full build log bash "/home/pav/unreal/UnrealEngine"/Engine/Build/BatchFiles/Linux/Build.sh Cras - Pastebin.com

They are both installed

$ clang --version
Ubuntu clang version 3.5.0-4ubuntu2~trusty2 (tags/RELEASE_350/final) (based on LLVM 3.5.0)
Target: x86_64-pc-linux-gnu
Thread model: posix

$ g++ --version
g++ (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see  source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Make sure you have both g++ and clang-3.5 installed.

Hey -

Are you able to compile a “Hello World” program with clang? If you’re still having trouble compiling C++ then there may be something wrong with setup on your machine.

Cheers

Hello world compiles perfectly.

$ cat hello.cpp 
#include <iostream>

int main() {
    std::cout << "Hello, world!\n";
    return 0;
}
$ clang++ -stdlib=libc++ hello.cpp 
$ ./a.out 
Hello, world!

Do not pass -stdlib=libc++ since engine doesn’t do that.

Oh, that’s may be a problem.

$ clang++  hello.cpp 
hello.cpp:1:10: fatal error: 'iostream' file not found
#include <iostream>
         ^
1 error generated.

What can cause this? I launched setup.sh and it inslatted a lot of dependencies but problem is still there =(

Looks like clang3.5 in Ubuntu 14.04 is trying to use libstdc+±4.9-dev. But in default repo threre is only libstdc+±4.8-dev. I’ve added ppa:ubuntu-toolchain-r/test and installed libstdc+±4.9-dev from there. Hello world now compiles succesfully.
Will try to build Unreal Engine now!