From 4434569719f08bc8b693922b246a06a23d136913 Mon Sep 17 00:00:00 2001 From: 0x6d61726b <0x6d61726b@gmail.com> Date: Wed, 30 Aug 2017 17:21:53 +0200 Subject: [PATCH] Build with external tool fails: missing includes When building with VisualGDB the compilation fails due to the lack of required include files Dir.h and File.h. Compiler report: 1>------ Build started: Project: exported-mbed-STM32F429-nucleo, Configuration: Debug VisualGDB ------ 1> FileSystem.cpp 1> mbed-os/features/filesystem/FileSystem.cpp: In instantiation of 'class Managed': 1> mbed-os\features\filesystem\FileSystem.cpp(141,19): note : required from here 1>mbed-os\features\filesystem\FileSystem.cpp(130,7): error : invalid use of incomplete type 'class mbed::File' 1> class Managed : public F { 1> ^~~~~~~ 1> mbed-os\features\filesystem\FileSystem.cpp(18): 1> mbed-os\features\filesystem\FileSystem.h(39,7): note : forward declaration of 'class mbed::File' 1> class File; 1> ^~~~ 1> mbed-os/features/filesystem/FileSystem.cpp: In member function 'virtual int mbed::FileSystem::open(mbed::FileHandle**, const char*, int)': 1>mbed-os\features\filesystem\FileSystem.cpp(141,19): error : cannot convert 'Managed*' to 'mbed::File*' in initialization 1> File *f = new Managed; 1> ^~~~~~~~~~~~~ 1>mbed-os\features\filesystem\FileSystem.cpp(142,16): error : invalid use of incomplete type 'class mbed::File' 1> int err = f->open(this, path, flags); 1> ^~ 1> mbed-os\features\filesystem\FileSystem.cpp(18): 1> mbed-os\features\filesystem\FileSystem.h(39,7): note : forward declaration of 'class mbed::File' 1> class File; 1> ^~~~ 1>mbed-os\features\filesystem\FileSystem.cpp(144,16): warning : possible problem detected in invocation of delete operator: [-Wdelete-incomplete] 1> delete f; 1> ^ 1>mbed-os\features\filesystem\FileSystem.cpp(141,11): warning : 'f' has incomplete type 1> File *f = new Managed; 1> ^ 1> mbed-os\features\filesystem\FileSystem.cpp(18): 1> mbed-os\features\filesystem\FileSystem.h(39,7): note : forward declaration of 'class mbed::File' 1> class File; 1> ^~~~ 1> mbed-os\features\filesystem\FileSystem.cpp(144,16): note : neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined 1> delete f; 1> ^ 1>mbed-os\features\filesystem\FileSystem.cpp(148,13): error : cannot convert 'mbed::File*' to 'mbed::FileHandle*' in assignment 1> *file = f; 1> ^ 1> mbed-os\features\filesystem\FileSystem.cpp(18): 1> mbed-os\features\filesystem\FileSystem.h(39,7): note : class type 'mbed::File' is incomplete 1> class File; 1> ^~~~ 1> mbed-os/features/filesystem/FileSystem.cpp: In instantiation of 'class Managed': 1> mbed-os\features\filesystem\FileSystem.cpp(153,18): note : required from here 1>mbed-os\features\filesystem\FileSystem.cpp(130,7): error : invalid use of incomplete type 'class mbed::Dir' 1> class Managed : public F { 1> ^~~~~~~ 1> mbed-os\features\filesystem\FileSystem.cpp(18): 1> mbed-os\features\filesystem\FileSystem.h(38,7): note : forward declaration of 'class mbed::Dir' 1> class Dir; 1> ^~~ 1> mbed-os/features/filesystem/FileSystem.cpp: In member function 'virtual int mbed::FileSystem::open(mbed::DirHandle**, const char*)': 1>mbed-os\features\filesystem\FileSystem.cpp(153,18): error : cannot convert 'Managed*' to 'mbed::Dir*' in initialization 1> Dir *d = new Managed; 1> ^~~~~~~~~~~~ 1>mbed-os\features\filesystem\FileSystem.cpp(154,16): error : invalid use of incomplete type 'class mbed::Dir' 1> int err = d->open(this, path); 1> ^~ 1> mbed-os\features\filesystem\FileSystem.cpp(18): 1> mbed-os\features\filesystem\FileSystem.h(38,7): note : forward declaration of 'class mbed::Dir' 1> class Dir; 1> ^~~ 1>mbed-os\features\filesystem\FileSystem.cpp(156,16): warning : possible problem detected in invocation of delete operator: [-Wdelete-incomplete] 1> delete d; 1> ^ 1>mbed-os\features\filesystem\FileSystem.cpp(153,10): warning : 'd' has incomplete type 1> Dir *d = new Managed; 1> ^ 1> mbed-os\features\filesystem\FileSystem.cpp(18): 1> mbed-os\features\filesystem\FileSystem.h(38,7): note : forward declaration of 'class mbed::Dir' 1> class Dir; 1> ^~~ 1> mbed-os\features\filesystem\FileSystem.cpp(156,16): note : neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined 1> delete d; 1> ^ 1>mbed-os\features\filesystem\FileSystem.cpp(160,12): error : cannot convert 'mbed::Dir*' to 'mbed::DirHandle*' in assignment 1> *dir = d; 1> ^ 1> mbed-os\features\filesystem\FileSystem.cpp(18): 1> mbed-os\features\filesystem\FileSystem.h(38,7): note : class type 'mbed::Dir' is incomplete 1> class Dir; 1> ^~~ 1> mbed-os/features/filesystem/FileSystem.cpp: In instantiation of 'int Managed::close() [with F = mbed::Dir]': 1> mbed-os\features\filesystem\FileSystem.cpp(162,1): note : required from here 1>mbed-os\features\filesystem\FileSystem.cpp(133,27): error : incomplete type 'mbed::Dir' used in nested name specifier 1> int err = F::close(); 1> ~~~~~~~~^~ 1> mbed-os/features/filesystem/FileSystem.cpp: In instantiation of 'int Managed::close() [with F = mbed::File]': 1> mbed-os\features\filesystem\FileSystem.cpp(162,1): note : required from here 1>mbed-os\features\filesystem\FileSystem.cpp(133,27): error : incomplete type 'mbed::File' used in nested name specifier ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== --- features/filesystem/FileSystem.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/features/filesystem/FileSystem.cpp b/features/filesystem/FileSystem.cpp index 4fea36f1a0..b356b0a037 100644 --- a/features/filesystem/FileSystem.cpp +++ b/features/filesystem/FileSystem.cpp @@ -15,6 +15,8 @@ */ #include "mbed.h" +#include "filesystem/Dir.h" +#include "filesystem/File.h" #include "filesystem/FileSystem.h" #include