I am using MACOS Mojave version 10.14.3 and need to use GNU compiler and not clang.
I installed gcc compiler using brew install gcc
.
Then I installed fmt library using brew install fmt
.
I put #include <fmt/format.h>
at the top of my C++ script
Then I type:
/usr/local/bin/g++-8 -O0 -g3 -Wall -c -fmessage-length=0 -std=c++17 -MMD -MP -MF"src/trail2.d" -MT"src/trail2.o" -o "src/trail2.o" "../src/trail2.cpp"
However I get this error:
fatal error: fmt/format.h: No such file or directory
Same happens when I try using the boost library.
When I use clang, fmt and boost are found without problem.
Just in case I am using Eclipse IDE for C/C++ Developers. Version: 2018-12 (4.10.0).
To be specific, how can I get fmt library to work with the gcc I installed with brew?
What I have in my Mac at /usr/local/Cellar is:
drwxr-xr-x 3 aaa staff 96 Feb 22 22:07 gcc
drwxr-xr-x 3 aaa staff 96 Feb 23 01:58 fmt
What I have in my Mac at /usr/local/Cellar is:
lrwxr-xr-x 1 aaa admin 29 Feb 22 22:07 c++-8 -> ../Cellar/gcc/8.2.0/bin/c++-8
lrwxr-xr-x 1 aaa admin 29 Feb 22 22:07 cpp-8 -> ../Cellar/gcc/8.2.0/bin/cpp-8
lrwxr-xr-x 1 aaa admin 29 Feb 22 22:07 g++-8 -> ../Cellar/gcc/8.2.0/bin/g++-8
lrwxr-xr-x 1 aaa admin 29 Feb 22 22:07 gcc-8 -> ../Cellar/gcc/8.2.0/bin/gcc-8
Thanks for the help in advanced
g++
frontend program where to find the header and library files. Use the-I
(upper-case i) option to specify where the header files are installed, and the-L
and-l
(lower-case L) options for any linker libraries. – Deas/usr/local/Cellar
my guess is that you need to add-I/usr/local/Cellar
. Since I don't know howbrew
organizes its packages when installed, perhaps something like-I/usr/local/Cellar/fmt/include
? You can add the directory in your Eclipse project settings somewhere (Preprocessor settings tab or similar?), but then usually without the actual-I
option. – Deas/usr/local/lib
I have this:lrwxr-xr-x 1 aaa admin 32 Feb 23 01:58 libfmt.a -> ../Cellar/fmt/5.3.0/lib/libfmt.a
– Cabasset