Open thomasjm opened 6 years ago
Which lts
are you using?
if impl(ghc < 8.2)
c-sources: src/Network/Mosquitto.c
i.e do not include c-sources
for the newer c-inline
and ghc-8.2+
I'm using lts-10.0
, and have not specified any c-sources
.
I have a Windows project that's organized using the standard template generated by
stack new
nowadays, with1) a
library
section with the majority of the dependencies and source files 2) a short executable which depends on the library, and 3) a test suite which depends on the library.In the library section, I have a module which uses
inline-c
to do a simple Windows system call.The main executable builds successfully if I run
stack build
. But, when I try to runstack test
I get a linker error:I'm guessing that somehow the C file is getting generated/linked twice, once for the main library/executable and once for the test suite. I've tried a
NOINLINE
pragma but it didn't help. I'm not sure if it's significant that one symbol is in.stack-work\install
and one is in.stack-work\dist
.This is also slightly hard to reproduce -- for a little while it disappeared and the test suite ran fine, then it started happening again. I tried to make a minimal repro project but have so far failed to reproduce in a simpler setting. I've tried some combinations of
stack clean
and re-building but no luck.Any chance you can shed any light on this? Thanks!