I'm design menus for my device. Each menu has a title, some main options and two menu-navigation options.
Implementing such thing using OOP structure is really easy. So I decided to convert my project from C to C++. I created new C++ project, copied all files to this project while maintaining directory structure and added them to the project. Code compiled successfully while extensions were ".c" but after I change them to ".cpp", compiler started generating multiple strange "undefined reference" and "multiple definition" errors.
- Should I migrate to C++ at all? If no, why? How should I achieve my goal in C?
- Why these errors appear after I change extensions to ".cpp"? I've read somewhere if I define a variable in a header file and include it in two files, C++ compiler generates two copies of them and linker gets confused. Why this doesn't happen in C? "undefined reference" errors are related to HD44780 and Accurate Delay C libraries.