Charles Durham
Charles Durham

Reputation: 1707

using cabal to build ffi library that works in ghci

I'm trying to package up an ffi library with cabal. Compiling a module with the library works and runs fine, but I get an unknown symbol error in one of the extra-libraries dependencies when loading/running in ghci.

I know that people recommend compiling a separate shared library for ghci, like in this question: linking extra libraries/objects failed

However, I'm not sure how to rectify this within cabal. Could anybody explain to me what standard practice is in this case?

Thanks!

Upvotes: 1

Views: 319

Answers (1)

chpatrick
chpatrick

Reputation: 471

Have you tried starting GHCi with cabal repl? Alternatively, you can run ghci -lyourlib to link against the extra-libraries.

Upvotes: 1

Related Questions