Reuse C++ Code in Unreal Engine 4.27 to 5.0

When you need some C++ custom code from a different project in a lower version of Unreal Engine or just from another project. You need to watch out for these points, even if it doesn’t matter if you’re on the latest or previous version of Unreal Engine.

Prerequisites:

  • Compilable code from the previous version of Unreal Engine
  • Installed UE 5.0 or UE 4.27
  • C++ ready project
  • Update IDE to the newest version

Step-by-Step:

  1. Turn off your IDE (Visual Studio Code, Visual Studio XXXX, etc.)
  2. Copy your C++ code (header and C++ code) to your project
  3. Open your copied code in your IDE
  4. Change the Project Module Name to the correct API (mostly ProjectName_API)
  5. Save and turn off your IDE again
  6. Delete INTERMEDIATE and BINARES from your project folder
  7. Regenerate C++ code from .uproject
  8. Open your IDE and manually again compile your code
  9. Open your Unreal Engine and press CTRL + ALT + F11 for live coding
FINISH! GOOD JOB!

Now you know how to reuse C++ code from the previous version of the unreal engine. Enjoy!


Posted

in

,

by