How do i add a C file into a UE plugin ?

Hi,

I’m making a plugin that uses some third party code in C.

I have declared everything properly and the plugin compiles and works fine as long as i use the C code only in the plugin (cpp) code.

But if i try to use any symbol from the C code in my main project (where the plugin is correctly setup and works well), i get unresolved errors from the linker.

Looking in the intermediate folder of the plugin, i can see that the C obj is present (and the log tells that it is compiled), so i’m sure it’s seen and compiled.

But when i look into the final plugin.dll (with a dll viewer), i see no trace of the third party C symbols.

So, somehow, UE knows that it has to compile and use the C code, but it doesn’t include it into the final plugin dll, hence the link error.

Any idea of how i can setup the inclusion on the C.obj file into the plugin final dll ?

Thanks
Cedric

I ended up creating a separate project to make a static lib out of my third party code and use it.

It worked well, so technically my problem is solved.

But if anyone knows how to do this directly in my main project, i’m still interested to know.