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.

Files at this revision

API Documentation at this revision

Comitter:
MikkoZ
Date:
Tue Sep 27 07:13:58 2016 +0000
Commit message:
Example app of build problem. Initial version

Changed in this revision

.gitignore Show annotated file Show diff for this revision Revisions of this file
foldertest1/foldertest1/foldertest1.h Show annotated file Show diff for this revision Revisions of this file
foldertest1/source/foldertest1.c Show annotated file Show diff for this revision Revisions of this file
foldertest2/foldertest2/foldertest2.h Show annotated file Show diff for this revision Revisions of this file
foldertest2/source/foldertest2.c Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 7c2be109ea78 .gitignore
--- /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*
diff -r 000000000000 -r 7c2be109ea78 foldertest1/foldertest1/foldertest1.h
--- /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
diff -r 000000000000 -r 7c2be109ea78 foldertest1/source/foldertest1.c
--- /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
+
diff -r 000000000000 -r 7c2be109ea78 foldertest2/foldertest2/foldertest2.h
--- /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"
diff -r 000000000000 -r 7c2be109ea78 foldertest2/source/foldertest2.c
--- /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
diff -r 000000000000 -r 7c2be109ea78 main.cpp
--- /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);
+    }
+}
diff -r 000000000000 -r 7c2be109ea78 mbed-os.lib
--- /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