I am a newbie here and just learning about Code::Blocks using MinGW. I can't find anything in the forum archives that address this, so maybe it is just me.
I have a library of standard ANSI C functions I want to include in a wxWidgets project.
I created a demo wxWidgets project called Test. It contains the files TestApp.cpp and TestMain.cpp (plus associated .h files). It builds without error and runs fine.
If I go to File|New|File... and add an empty file called abc.c and try to rebuild the project I get dozens of errors. Adding an empty file called abc.cpp, however, builds as usual.
I can include the code in a cpp file with appropriate extern wrappers (or even just as straight C code allowing it to be compiled as C++) and that gets around the problem, but I don't see why I have to rename the files from .c to .cpp. Why can't I just include a straight C file?
Am I doing something stupid here or is there a config option I have missed? How can I include a C file in a C++ project?
Thanks for any help.