[Haskell-cafe] Trying desperately to make a c library binding on Windows
nicu.ionita at acons.at
Thu Mar 17 21:19:29 UTC 2016
I am really stuck with my try to make a Haskell binding for the library
bayesopt on Windows.
In theory it looks all simple, just put some lines in the cabal
extra-lib-dirs: /path/to/the/lib -- contains the file libbayesopt.a
But whatever I tried, I can't step over the configuration phase, coz I
get (I'm compiling with stack):
on a foreign library:
* Missing C library: /j/BO/lib/libbayesopt.a
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 I comment those lines out, then the configure phase succeeds, the
library is compiled (i.e. my binding library), but a test executable in
the same project does of course not compile, as symbols are missing:
In-place registering BaseOh-0.1.0.0...
Preprocessing executable 'test' for BaseOh-0.1.0.0...
[1 of 2] Compiling Optimisation.Stochastic.BayesOpt (
ghc.exe: unable to load package `BaseOh-0.1.0.0'
\HSBaseOh-0.1.0.0-GdNObdePATgDIW1I2OVwEc.o: unknown symbol
-- While building package BaseOh-0.1.0.0 using:
Does somebody have some idea, what is going on?
I am on Win 7, using stack (configured for lts-4.2) under MinGW.
(I'm using inline-c to make the bindings, and the same trick for include
- include-dirs: ... - worked fine.)
Thanks, and sorry for the longer email.
More information about the Haskell-Cafe