One way to track such errors is to start from scratch:
#include "filepath/ui.h" int main () { return 0; }
Will it compile? (This works fine with the small ui.h snippet you provided.)
Errors like these are often caused by the absence of a semicolon in the previous class declaration. So try to get the problem:
struct Foo { int foo; }
This, of course, does not compile. I get an intricate trace of the path from my testmain.cpp to the /ui.h file path to the line ... and I end up with
/usr/include/i386/_types.h:37: error: two or more data types in declaration of '__int8_t'
So this is not a mistake, but the missing semicolon is the creation of a mess. Your error does not occur deep within the <string> , so let's do our test program #include <string> before trying to recreate the error:
And an error message
In file included from testmain.cpp:5: filepath/ui.h:6: error: expected unqualified-id before 'namespace'
And here it is. Thus, some other heading that you #include before filepath / ui.h has a poorly formed class declaration.
Adding
Sometimes this helps to use a different compiler. g ++ is known for its poor handling of this common programming error. Compiling above with clang tutorials
testmain.cpp:4:2: error: expected ';' after struct
So tada, clang resets the problem.
What happens is that when the compiler encounters a problem, it applies some fix to your code to make it grammatically correct. The compiler error message is based on this auto-correction. Remember well: this auto-correction as a whole is a very good thing. Without it, the compiler would have to shut down on the first error. Since programmers inevitably make more than one mistake, hunting for them one by one will be a pain in the rear.
I don't have the faintest idea which stupid g ++ correction is used to fix a missing semicolon problem, except that it doesn't add an obvious semicolon. clang adds the missing semicolon, and he complains about it.