Add C code to project

I have a C++ project (well it was blueprint, but I added C++ files). I’m currently trying to integrate S7 Scheme. It’s designed as a single .C file that you compile with your project. I’ve had a lot of trouble so far.

First off, Unreal Build Tool won’t compile C files apparently. It complains about the precompiled headers for some reason. If I rename the .C file to .CPP then it will go ahead and compile (but has errors).

When compiling the newly renamed .CPP file, it complained that I have to first include my project’s main header file, so I went ahead and did that. That header eventually pulls in some headers that #define ERROR, PI, etc. which causes conflicts in this .CPP file. Well I worked around that but undefining these symbols in the .CPP file.

Now my issue is that this code uses setjmp, which apparently is a no no for a C++ file so now I’m stuck. If I could get this file to compile as a .C file I think it will be smooth sailing. What can I do to get S7 into my project?

You should build the S7 source separately as a library (outside of UE/UBT), and then link the library into your project just like any other third party library.