Compiler options

Guys, how and where can I get the compiler options which were sent to compiler in order to build UE4?

Thank you.

Hello ,

All options are setting in UnrealBuildTool. Check VCToolChain.cs file.

Best regards,

Hi ,
Thank you for your answer.
The reason I’m asking is, that I’m trying to use intel compiler instead of cl, and although I was able to compile (after some small modifications) UE4, the intel’s compiler throws linker errors. I’ve contacted intel and I’m in the middle of discussion on how to solve this problem. They wanted to know that.
Thank you again for your answer.

Hi ,
I can add/modify the different compiler options in VCToolChain.cs. But in the Visual Studio build log/Output window, I am not able to see the complete compiler options. I am expecting the build output to be something like this :-

cl.exe <compiler_options> <list of cpp files>

I had removed the “/nologo” and set the verbosity level to “detailed” in VCToolChain.cs and other build batch files, But still I am not able to get the compiler command line as mentioned above.

Is there any way that we can get this kind of compiler command line details, so that it would be very helpful for us to debug the linker issues.

Regards,
shv

Hello shv,

if you want to see build log in output you should specify –verbose argument (It enables BuildConfiguration.bPrintDebugInfo in build tool).
I think you will also interest in debugging UnrealBuildTool manually. For that set up it as startup project and set arguments (QAGame Win64 Debug -verbose).

Best regards,

Hi ,
Thanks for the options.

Hi ,
Thanks for the options. Sorry to reiterate this question as i am new to building UE4. The configuration seems different here. I did try to change the configuration from “Development Editor” to “Debug” and set the UE4 project as “startup project” , Also changed the “MSBuild options” (VS2012 Tools --. Options → projects and solutions → Build and Run → MSBuild Verbosity → Detailed.).

I made these changes and had also removed the “/nologo” option in CPP,C and LINK args from VCToolChain.cs file.

But still, i get the build log as following :-

PCH.Shared.Core.h.cpp
2> PCH.Shared.CoreUObject.h.cpp
2> Microsoft (R) C/C++ Optimizing Compiler Version 18.00.30501 for x64
2> Copyright (C) Microsoft Corporation. All rights reserved.
2>
2> Microsoft (R) C/C++ Optimizing Compiler Version 18.00.30501 for x64
2> Copyright (C) Microsoft Corporation. All rights reserved.
2>
2> Microsoft (R) C/C++ Optimizing Compiler Version 18.00.30501 for x64
2> Copyright (C) Microsoft Corporation. All rights reserved.
2> Module.Core.7_of_8.cpp
2> Module.Core.1_of_8.cpp
2> Module.Core.2_of_8.cpp
2> Microsoft (R) C/C++ Optimizing Compiler Version 18.00.30501 for x64
2> Copyright (C) Microsoft Corporation. All rights reserved.
2>
2> Module.Core.5_of_8.cpp

As we could see, i see only the Compiler version and then followed by the set of CPP files. I am interested to the complete compiler option, because of the reason that i am getting the following linker error with intel compiler :-

Module.CoreUObject.1_of_5.cpp.obj : :1 LNK2019: unresolved external symbol “public: static class IPluginManager & __cdecl IPluginManager::Get(void)” (?Get@IPluginManager@@SAAEAV1@XZ) referenced in function “private: __cdecl FLongPackagePathsSingleton::FLongPackagePathsSingleton(void)” (??0FLongPackagePathsSingleton@@AEAA@XZ)
27>E:\Issue\UnrealEngine-4.1.1-release\UnrealEngine-4.1.1-release\Engine\Binaries\Win64\UE4Editor-CoreUObject.dll : fatal error LNK1120: 1 unresolved externals

But i dig down to find this symbol and get the linkage as below :-

//PackageName.cpp

IPluginManager::Get().SetRegisterMountPointDelegate( IPluginManager::FRegisterMountPointDelegate::CreateStatic( &FPackageName::RegisterMountPoint ) );

//IPluginManager.h

Class IPluginManager
{

public:

	static PROJECTS_API IPluginManager& Get();

Now, we have “Project.h” being included in “PackageName.cpp” and the “Projects.h” incldes “IPluginManager.h”, Hence there is a perfect reference of this Get symbol through header. So would like to trace what is happening and why is this header no being included. So thought of looking at the compiler build command line. but unable to get it with lots of modifications.

I have also attached the snapshot of my project in VS.

Regards,
Sukruth H V![alt text][1]

Hi,
Sorry since my comment was quite big, I had to split it into 2 parts.

Hi shv,

Sorry for 2 day lag.

As we could see, i see only the
Compiler version and then followed by
the set of CPP files. I am interested
to the complete compiler option

I have tested on QAGame example.
QAGame properties → Configuration Properties → NMake for fields (Build command line and Rebuild All command line) add –verbose parameter

..\..\Build\BatchFiles\Build.bat QAGame Win64 Debug –verbose
..\..\Build\BatchFiles\Rebuild.bat QAGame Win64 Debug –verbose

And then rebuild QAGame. In my case the result looks like output.

So would like to trace what is
happening and why is this header no
being included.

Like an option you can debug Unreal Build Tool (UBT). For that find UBT (Solution/ Programs/ UnrealBuildTool) and set as startup project it. Set arguments for project (Properties->Debug->Start Options->Command line arguments: YourProject Win64 Debug –verbose (In my case QAGame Win64 Debug -verbose)) and run it.

Check the function CompileCPPFiles and LinkFiles in VCToolChain.cs. In the end of these functions should be line Log.TraceVerbose that prints command arguments to output.

Let me know if you need some more help.
Best regards,

Hi ,
Thanks a lot for the answer. I am able to see the command line now. Your suggestion was very helpful!!!

Regards,
shv