无法使用IDEA和SBT运行LWJGL [英] Can't get LWJGL to run using IDEA and SBT
问题描述
我一直在脑子里挣扎了一个多小时,谷歌似乎无法给我一个决定性的答案。
我正在使用scala和sbt插件 IntelliJ IDEA 13.1.3
, Scala 2.11.1
和 SBT 0.13
认为我很聪明我将LWJGL的Maven存储库添加到我的build.sbt
libraryDependencies + =org.lwjgl.lwjgl%lwjgl%2.9.1
后来发现我需要[将编译器指向LWJGL本机]。
现在这里是问题:要求SBT下载库,不要将它们放在任何项目目录中,这使得指向库有点困难。
我尝试使用[ sbt-lwjgl-plugin ]没有任何运气,甚至像文档建议的那样强迫早期版本的SBT。
<那么我发现自己处于僵局,我该怎么办?手动下载库并将其转储到项目目录中?或者有更自动的方式来处理这个问题吗?
您可以简单地包含LWJGL(与本地人一起)将以下代码段添加到 build.sbt
:
libraryDependencies ++ = {
val version =3.1.6
Seq(
lwjgl,
lwjgl-glfw,
lwjgl-opengl
//在这里添加更多模块
).flatMap {
module => {
Seq(
org.lwjgl%module%version,
org.lwjgl%module%version classifiernatives-windows//更改linux / mac
)
}
}
}
I've been scratching myself in the head for a little over an hour with this, nothing on Google seems to be able to give me a decisive answer.
I'm using IntelliJ IDEA 13.1.3
with the scala and sbt plugins, Scala 2.11.1
, and SBT 0.13
Thinking I was clever I added the Maven repository for LWJGL to my build.sbt
libraryDependencies += "org.lwjgl.lwjgl" % "lwjgl" % "2.9.1"
Only to later find out that I need to [point the compiler to the LWJGL natives].
Now here's the problem: Asking SBT to download libraries, doesn't put them in any of the project's directories, making the pointing to the libraries a tad difficult.
I tried using the [sbt-lwjgl-plugin] without any luck, even forcing an earlier version of SBT like the documentation suggests.
So I'm finding myself at an impasse, what am I supposed to do? Manually download the library and dump it into the project directories? Or is there a more automatic way for me to deal with this?
You can include LWJGL (with the natives) by simply adding the following snippet to your build.sbt
:
libraryDependencies ++= {
val version = "3.1.6"
Seq(
"lwjgl",
"lwjgl-glfw",
"lwjgl-opengl"
//Add more modules here
).flatMap {
module => {
Seq(
"org.lwjgl" % module % version,
"org.lwjgl" % module % version classifier "natives-windows" //Change if linux/mac
)
}
}
}
这篇关于无法使用IDEA和SBT运行LWJGL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!