Compiling C (not C++) source as part of a plugin module


I’m not seeing an extensive reference for the build tool that explains this so I figured I’d ask while searching through the engine repo for an example.

I’m building a plugin and want to make use of another set of sources that are written in C. The visual studio project sees them and that’s all good, but the build complains for each file:

2>cl : Command line warning D9024: cl : Command line warning D9024 : unrecognized source file type 'c', object file assumedunrecognized source file type 'c', object file assumed
2>cl : Command line warning D9027: source file 'c' ignored
2>cl : Command line warning D9002: ignoring unknown option '-x'
2>cl : Command line warning D9024: unrecognized source file type 'c', object file assumed

I was hoping to avoid a situation where I have to setup a separate build for these files and include them in the unreal project as a static library. Seems silly to have to do this.

At the moment I’m working on Windows 10 with Visual Studio Community 2015. I haven’t tried this on MacOS or Linux yet.

Any advice or pointers?



Well ok. Bit of a waste of time to try anything else. I see that almost any other example of third party sources or libraries just get pre-built so that’s what I’ve done too. CMake gets me easy builds for the big 3 platforms at least so it’s not too hard to put them into a separate stream in Perforce and just import those paths into my current stream.

I didn’t make a separate module for it like most of the documentation on the wiki does though. It’s all enormously complex compared to just specifying an extra include path and adding a lib to link with. Maybe I can update some wiki pages with the bare minimum there.