Compiling c files with the Unreal Build System
Hi, I have an external lib that I would like to include as source in a plugin I'm making. The lib is written in straight c and I had a few issues getting the Unreal Build System to compile the module that I'm reporting here as potential bug reports or for people to find via search:
1) the MODULENAME_API macro does not seem to work with c files (it does not seem to replace the export / import correctly).
2) because of this you need to wrap exposed functionality in a cpp file to expose something or the .exp file will not be produced and the module compilation will fail
hope this helps someone!
asked Jul 18 '17 at 11:30 AM in Bug Reports
Sorry for not responding to your post sooner. Are you still having trouble with this?
What is most likely happening here is that your C library is being correctly included as a dependency, so the macro is set to import. However, because it is a C library, our build system never actually builds the library and the macro is never set to export. That is probably why wrapping your library's functionality with C++ and using the macro there works fine.
answered Feb 28 '18 at 07:09 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here