Reputation: 11
I'm trying to use Spire in an Eclipse project. I've cloned it from the repo and used sbt package to get a jar (I want to use the latest version as the one available on Maven Central does not have everything I need).
I've created an SBT project and added the jar inside a /lib folder at the root of the project. Now everything works fine, except when I want to use macros from Spire, such as cfor. I use sbt to compile, and get following compilation error message :
the macro implementation not found: cfor (the most common reason for that is that you cannot use macro implementations in the same compilation run that defines them)
Which is weird, since the macros are contained in a Jar. What am I missing here?
Edit : as requested, a minimal example to show what fails for me https://github.com/Baccata/scala.macros.tests
Upvotes: 1
Views: 161
Reputation: 11
Found the answer,
I had just forgotten the macro jar ... the error message being what it is, I didn't think of the obvious.
Upvotes: 0
Reputation: 13048
Looks like you need to reference both spire
and spire-macros
to be able to use macros in Spire.
libraryDependencies += "org.spire-math" %% "spire" % "0.7.1"
libraryDependencies += "org.spire-math" %% "spire-macros" % "0.7.1"
Upvotes: 1