简体   繁体   English

在IntelliJ中打开Haxe项目时出现“未解析的符号”

[英]“Unresolved Symbol” when opening a Haxe project in IntelliJ

I want to try out the Haxe programming language to create a game. 我想尝试使用Haxe编程语言来创建游戏。 When I use the Flash Develop application on Windows, all references are found as there is a Project-file included. 当我在Windows上使用Flash Develop应用程序时,会找到所有引用,因为包含了一个项目文件。

But when I open the same on my Mac, or Windows, the references are not found, giving me the error "Unresolved symbol". 但是当我在我的Mac或Windows上打开相同的内容时,找不到引用,给出错误“未解析的符号”。

Do you know how I can map/import/define these resources/references/symbols?? 你知道我如何映射/导入/定义这些资源/参考/符号吗? :-) :-)

The below is a screenshot of the issue... 以下是该问题的截图...

Thanks in advance... :-) 提前致谢... :-)

在此输入图像描述

In IDEA 13, open the Module Settings for your Haxe project, go to Modules > Dependencies, and click the plus sign to add a new dependency. 在IDEA 13中,打开Haxe项目的Module Settings,转到Modules> Dependencies,然后单击加号以添加新的依赖项。 Select "Library..." then click the New Library button and select Haxe from the drop-down. 选择“Library ...”,然后单击New Library按钮并从下拉列表中选择Haxe。 Navigate to the library's location on your disk (for example, I found flixel in /usr/lib/haxe/lib/flixel). 导航到磁盘上的库位置(例如,我在/ usr / lib / haxe / lib / flixel中找到了flixel)。

Following the above procedure resolved this issue for me for flixel, flixel addons, and openfl. 按照上述步骤为我解决了flixel,flixel addons和openfl这个问题。 However, the HaxeFlixel template project (and many classes in HaxeFlixel) also reference other classes in the "flash" package, such as flash.display.Sprite. 但是, HaxeFlixel模板项目 (以及HaxeFlixel中的许多类)也引用了“flash”包中的其他类,例如flash.display.Sprite。 IntelliJ is still reporting "Unresolved symbol" on the package and "Unresolved type" on those classes. IntelliJ仍然在包上报告“Unresolved symbol”,在这些类上报告“Unresolved type”。 Since the project runs fine from the command line, I believe this is an issue with the Haxe Plugin, but I haven't been able to figure out how to get around it. 由于项目从命令行运行良好,我相信这是Haxe插件的一个问题,但我无法弄清楚如何解决它。

  1. As far as I know, IntelliJ plugin is a bit out of date. 据我所知,IntelliJ插件有点过时了。
  2. These are not from haxe std library. 这些不是来自haxe std库。 You need to install and add corresponding libraries. 您需要安装并添加相应的库。 (haxe compiler takes them as -lib <name> , and I guess there should be some list to add them to in your project settings in IntelliJ. (haxe编译器将它们作为-lib <name> ,我想应该有一些列表可以将它们添加到IntelliJ的项目设置中。

However, the HaxeFlixel template project (and many classes in HaxeFlixel) also reference other classes in the "flash" package, such as flash.display.Sprite. 但是,HaxeFlixel模板项目(以及HaxeFlixel中的许多类)也引用了“flash”包中的其他类,例如flash.display.Sprite。 IntelliJ is still reporting "Unresolved symbol" on the package and "Unresolved type" on those classes. IntelliJ仍然在包上报告“Unresolved symbol”,在这些类上报告“Unresolved type”。

flash.* imports should be able to resolve, if you have set up Haxe SDK(toolkit) Some HaxeFlixel classes is tricky to parse(have some generics). flash。* import应该能够解决,如果你已经设置了Haxe SDK(工具包)一些HaxeFlixel类很难解析(有一些泛型)。

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

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