Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Error ./src/core.h:30:10: fatal error: 'fmt/core.h' file not found #14

Open
0xHorace opened this issue Jun 16, 2024 · 3 comments
Open

Comments

@0xHorace
Copy link

on macos

fixed by specifying brew install paths in the makefile:
BREW_INC_DIR := /opt/homebrew/Cellar/fmt/10.2.1_1/include
BREW_LIB_DIR := /opt/homebrew/Cellar/fmt/10.2.1_1/lib

@rishi-wqd190004
Copy link

hi @0xE-acc could you share where you made the changes?
I made the above changes here:

# Every folder in ./src will need to be passed to the compiler so that it can find header files
BREW_INC_DIR := /opt/homebrew/Cellar/fmt/10.2.1_1/include
BREW_LIB_DIR := /opt/homebrew/Cellar/fmt/10.2.1_1/lib
INC_FLAGS := $(addprefix -I,$(BREW_INC_DIR))

Also heres the info I have been trying to run on:
M1-8GB
Target: arm64-apple-darwin23.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bi

@rishi-wqd190004
Copy link

rishi-wqd190004 commented Aug 1, 2024

Also here is the complete error I have been getting when I run make:

grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
[-e pattern] [-f file] [--binary-files=value] [--color=when]
[--context[=num]] [--directories=action] [--label] [--line-buffered]
[--null] [pattern] [file ...]
error: write on a pipe with no reader
expr: syntax error
Using compiler: g++ version
mkdir -p build/./src/
g++ -DMACOS -I./src -I./src/tl -I./src/nlohmann -I./src/liboai -I./src/liboai/core -I./src/liboai/include -I./src/liboai/include/core -I./src/liboai/include/components -I./src/liboai/components -I./src/treehh -I./src/toml++ -I./src/toml++/impl -I/opt/homebrew/Cellar/poppler/24.04.0/include/poppler/cpp -I/opt/homebrew/Cellar/poppler/24.04.0/include/poppler -MMD -MP -std=c++20 -Wall -Wextra -O3 -march=native -c src/tool_registry.cpp -o build/./src/tool_registry.cpp.o
In file included from src/tool_registry.cpp:1:
In file included from ./src/tool_registry.h:3:
./src/core.h:36:10: fatal error: 'fmt/core.h' file not found
#include <fmt/core.h>
^~~~~~~~~~~~
1 error generated.
make: *** [build/./src/tool_registry.cpp.o] Error 1

@0xHorace
Copy link
Author

0xHorace commented Sep 9, 2024

@rishi-wqd190004 apologies for the delay. Here's what that portion of my Makefile looks like. I just realized I added a second INC_FLAGS

INC_DIRS := $(shell find $(SRC_DIRS) -type d)
INC_FLAGS := $(addprefix -I,$(INC_DIRS))

# Add Homebrew include directory to INC_FLAGS
BREW_INC_DIR := /opt/homebrew/Cellar/fmt/10.2.1_1/include
BREW_LIB_DIR := /opt/homebrew/Cellar/fmt/10.2.1_1/lib
INC_FLAGS += -I$(BREW_INC_DIR)```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants