Greetings, I’m trying to use hw-kafka-client, but cabal says this when I run cabal build
Configuring library for hw-kafka-client-5.3.0..
Error: cabal-3.10.3.0: Missing dependency on a foreign library:
I’m using macOS, librdkafka is installed via brew
When I install hw-kafka-client I’ve put extra flags to find where include and lib folders for librdkafka exist
cabal install hw-kafka-client --extra-include-dirs=/opt/homebrew/Cellar/librdkafka/2.6.1/include --extra-lib-dirs=/opt/homebrew/Cellar/librdkafka/2.6.1/lib
It was build successfully
However, when I put hw-kafka-client to cabal file it starts telling that hw-kafka-client was not built
build-depends: base ^>=4.19.1.0,
text,
transformers,
hw-kafka-client
max@nakatomi core % cabal build
Resolving dependencies...
Build profile: -w ghc-9.8.2 -O1
In order, the following will be built (use -v for more details):
- hw-kafka-client-5.3.0 (lib) (requires build)
- core-0.1.0.0 (lib) (first run)
- core-0.1.0.0 (exe:core) (first run)
Starting hw-kafka-client-5.3.0 (lib)
Failed to build hw-kafka-client-5.3.0. The failure occurred during the
configure step.
Build log ( /Users/max/.cabal/logs/ghc-9.8.2/hw-kfk-clnt-5.3.0-6caa0bcf.log ):
Configuring library for hw-kafka-client-5.3.0..
Error: cabal-3.10.3.0: Missing dependency on a foreign library:
* Missing (or bad) C library: rdkafka
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the
library file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
Error: cabal: Failed to build hw-kafka-client-5.3.0 (which is required by
exe:core from core-0.1.0.0). See the build log above for details.
What I missed?
Thanks in advance