Application to showcase build problem when including mbed.h from .cpp and .c -files. Folder structure and nested #includes inside #ifndefX+#defineX+#endif obfuscate the reason. Compiler error is about 'keyword namespace not found', which happens when mbed.h is included from .c.
Revision 0:7c2be109ea78, committed 2016-09-27
- Comitter:
- MikkoZ
- Date:
- Tue Sep 27 07:13:58 2016 +0000
- Commit message:
- Example app of build problem. Initial version
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.gitignore Tue Sep 27 07:13:58 2016 +0000 @@ -0,0 +1,4 @@ +.build +.mbed +projectfiles +*.py*
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/foldertest1/foldertest1/foldertest1.h Tue Sep 27 07:13:58 2016 +0000 @@ -0,0 +1,6 @@ +#ifndef FOLDERTEST1_H +#define FOLDERTEST1_H + +#include "mbed.h" + +#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/foldertest1/source/foldertest1.c Tue Sep 27 07:13:58 2016 +0000 @@ -0,0 +1,2 @@ +#define this_file_doesnt_include_foldertest1_nor_mbed_h 0 +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/foldertest2/foldertest2/foldertest2.h Tue Sep 27 07:13:58 2016 +0000 @@ -0,0 +1,1 @@ +#include "../../foldertest1/foldertest1/foldertest1.h"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/foldertest2/source/foldertest2.c Tue Sep 27 07:13:58 2016 +0000 @@ -0,0 +1,1 @@ +#include "../foldertest2/foldertest2.h" \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Sep 27 07:13:58 2016 +0000 @@ -0,0 +1,9 @@ +#include "foldertest2/foldertest2/foldertest2.h" +//#include "mbed.h" +int main() { + bool led1 = false; + while (true) { + led1 = !led1; + Thread::wait(500); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed-os.lib Tue Sep 27 07:13:58 2016 +0000 @@ -0,0 +1,1 @@ +https://github.com/ARMmbed/mbed-os/#21dd7008a1540c02150f1b87c12294301db979bb