lvgl / lv_port_win_codeblocks

Windows PC simulator project for LVGL embedded GUI Library
MIT License
150 stars 86 forks source link

C++ Unknown Type Name 'namespace' #20

Closed jadonmmiller closed 3 years ago

jadonmmiller commented 3 years ago

When I try to compile my project, which contains c++ files, I get an "unknown type name 'namespace'" error.

How do I set CodeBlocks to compile with C++?

Thanks!

embeddedt commented 3 years ago

I don't use CodeBlocks for C++ development, however, I've just tried adding a .cpp file to the project with an namespace, and it seems to compile without issues. Are you using a different file extension?

jadonmmiller commented 3 years ago

Oops! Believe it or not, namespaces (a C++ feature) don't work in a .c (C Code) file! 😄

After renaming main.c to main.cpp, it works great!