odb -d mysql --generate-query --generate-schema person.hxx


In file included from /usr/local/Cellar/odb-2.4.0-i686-macosx/lib/odb/i686-apple-darwin10/include/c++/4.9.3/bits/postypes.h:40:0,
                 from /usr/local/Cellar/odb-2.4.0-i686-macosx/lib/odb/i686-apple-darwin10/include/c++/4.9.3/bits/char_traits.h:40,
                 from /usr/local/Cellar/odb-2.4.0-i686-macosx/lib/odb/i686-apple-darwin10/include/c++/4.9.3/string:40,
                 from <standard-odb-prologue>:7:
/usr/local/Cellar/odb-2.4.0-i686-macosx/lib/odb/i686-apple-darwin10/include/c++/4.9.3/cwchar:44:19: fatal error: wchar.h: No such file or directory
 #include <wchar.h>
2

There are 2 best solutions below

0
On

Try reinstalling your XCode Command Line Tools like shown in this link with

xcode-select --install

This helped me today with compiling a program with gcc-9 installed with brew on Mac OS X Catalina to which I updated yesterday.

Mac OS updates usually mess up the location of the headers, this may be your case, too.

See also this question

0
On

Try to specify the include directory of XCode command line tools by adding to your odb the following:

-I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include

if this doesn't work, double check the path. Sometimes you would find the SDK directory is MacOSX xx.xx.x instead of MacOSX.sdk