简体   繁体   English

如何运行砖应用程序?

[英]How to run brick application?

I need to install bhoogle .我需要安装bhoogle I've already installed cabal by stack install hoogle command and I've created default database.我已经通过stack install hoogle命令安装了 cabal 并且我已经创建了默认数据库。 I don't know how to run application with the GUI.我不知道如何使用 GUI 运行应用程序。 I have bhoogle repo downloaded on my Mac and stack ghci Setup nor stack ghci App/Main doesn't work.我在 Mac 上下载了 bhoogle 存储库, stack ghci Setupstack ghci App/Main都不起作用。 No GUI is being displayed.没有显示 GUI。 I think that all the requirements are satisfied, but the method of running the app is wrong.我认为所有要求都满足了,但是运行该应用程序的方法是错误的。

Although your solution works, I don't think it's ideal, since the point of having entrypoints defined in a .cabal file is so that you can let stack do the grunt work (navigating the directories to the main hs file).尽管您的解决方案有效,但我认为它并不理想,因为在 .cabal 文件中定义入口点的目的是让堆栈完成繁重的工作(将目录导航到主hs文件)。

If you want to install bhoogle system-wide, as its purpose suggests, then you can stack install bhoogle from anywhere outside of a stack directory.如果您想在系统范围内安装bhoogle ,正如其目的所暗示的那样,那么您可以从堆栈目录之外的任何位置stack install bhoogle

If, however, you want to compile and run it without installing it, bhoogle uses make , so you can build it with make and then fetch the executable from the .stack-work directory.但是,如果你想编译和不安装运行, bhoogle用途make ,这样你就可以建立它make ,然后从获取可执行.stack-work目录。 Alternatively, from stack 1.9.1, you can use stack run , an analog to cabal run .或者,从 stack 1.9.1 开始,您可以使用stack run ,它类似于cabal run For earlier versions of stack, you can use stack build --exec bhoogle .对于较早版本的堆栈,您可以使用stack build --exec bhoogle

关键是使用以下命令运行它: stack App/Main.hs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM