Build Troubleshooting in Open 3D Engine

This guide will help you identify and resolve some common issues that you might encounter with the Open 3D Engine (O3DE) build system. Be aware that you might come across situations unique to your project or build that aren’t addressed here. This reference is only for the most frequent build issues that aren’t affected by a known bug, or can’t easily be worked around. If you don’t find your problem covered here, try searching our forums or asking in the O3DE Discord .

If you believe your build problem is due to a bug in O3DE, check existing bug reports and file an issue if you can!

Looking for error logs or memory dumps? Refer to Open 3D Engine Log Files for locations.

C2027 Errors on Generated Files

Issue: The MSVC C2027 compiler error is caused by attempting to build a file referencing a missing type. This issue is normally caused by empty files created by the code generation tool, most often during the build of the AzQtFramework library.

Remedy:

  1. Ensure that you have enough disk space to build your selected targets. The code generator will produce empty files if there isn’t enough disk space to write them.

  2. Delete directories containing CMake cache information.

  3. Delete folders containing autogenerated source from your build folder. Do one of the following:

    • Delete all folders containing _autogen in their name from your build directory.
    • Delete the build directory used during CMake configure and generate, then reconfigure and regenerate.

CMake Searching for Wrong MSVC During Configure

Issue: The CMake tools report a missing MSVC compiler. This produces a warning similar to:

CMake Error at CMakeLists.txt:15 (project):
  The CMAKE_C_COMPILER:
 
    C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.24.28314/bin/Hostx64/x64/cl.exe
 
  is not a full path to an existing compiler tool.

This is caused when Visual Studio is updated or modified, and the CMake cache holds information pointing to the previous compiler install.

Remedy: This issue is most often caused after a Visual Studio update, without a regeneration of the O3DE project files. The path of the C and C++ compiler is set at configure-time by the CMake system, using the CMAKE_C_COMPILER and CMAKE_CXX_COMPILER values. These values are stored in the CMake cache. Clean the cache and reconfigure by doing one of the following:

  • Removing the CMakeCache.txt file in your CMake build directory.
  • Removing the CMake build directory completely.

After cleaning the cache, the correct compiler should be detected during the CMake configuration stage.

CMake fails to find Findo3de.cmake

Issue: The CMake tool reports it cannot find a package configuration file provided by “o3de”. This produces a warning similar to:

CMake Error at CMakeLists.txt:10 (find_package): 

By not providing "Findo3de.cmake" in CMAKE_MODULE_PATH this project has 
asked CMake to find a package configuration file provided by "o3de", but 
CMake did not find one. 

Could not find a package configuration file provided by "o3de" with any of 
the following names: 

o3deConfig.cmake 

o3de-config.cmake

Remedy: This issue is usually caused by a misconfigured o3de_manifest.json file that has an entry for a version of O3DE that no longer exists or has missing or corrupt files. This can occur if you installed O3DE and then deleted the engine folder instead of uninstalling it using “Add or Remove Programs”. Do the following:

  1. Close Project Manager (o3de.exe) if it is open.
  2. Open <user>/.o3de/o3de_manifest.json in a text editor.
  3. Remove entries in the “engines” and “engines_path” lists for engines that have been removed or with paths that no longer exist.
  4. Make sure that the final lines in “engines” and “engines_path” do not end in a comma.
  5. Save and close the file.
  6. Restart Project Manager (o3de.exe).
  7. Re-add your project if you don’t see it in the Projects page.

When Project Manager opens it should automatically re-register the O3DE engine and update o3de_manifest.json with the correct information.

Package Directory Detection Fails

Issue: During configuration, the package directory isn’t correctly detected and the CMake configure task reports an error similar to the following:

cmake -B windows_vs2019 -S . -G "Visual Studio 16 2019" -DLY_3RDPARTY_PATH="C:\o3de\3rdParty\" -DLY_PROJECTS="%O3DE_PROJECTS%"
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.17763.
-- Using Windows target SDK 10.0.18362.0
CMake Error at cmake/3rdParty.cmake:19 (file):
  file FILE([TO_CMAKE_PATH|TO_NATIVE_PATH] path result) must be called with
  exactly three arguments.
Call Stack (most recent call first):
  CMakeLists.txt:43 (include)CMake Error at cmake/3rdParty.cmake:21 (if):
  if given arguments:    "NOT" "EXISTS" "C:/o3de/3rdParty\"  Unknown arguments specified
Call Stack (most recent call first):
  CMakeLists.txt:43 (include)-- Configuring incomplete, errors occurred!

Remedy: This issue is caused on Windows when the LY_3RDPARTY_PATH value passed to CMake ends in a \ character. Do one of the following:

  • Change the value to remove the trailing \.
  • Change the format of your LY_3RDPARTY_PATH to use the platform-agnostic / path separator.