Open alexnauda opened 6 years ago
Forgot to mention, this works fine if I run something like openfl test cpp
or any other target, from either Terminal or as a bash run config in IntelliJ. So Haxe and openfl seem to be working fine on my machine; it's just the Haxe Toolkit Support plugin in IntelliJ that I can't figure out.
This sounds like the known problem of things not working if you run IntelliJ IDEA via a launch icon. If you start idea from the same command shell/Terminal as your working project, then everything will work correctly. (IIRC, the path to start idea is /Applications/IntelliJ IDEA/Contents/bin/idea.sh)
The issue is that the command shell environment isn't used when starting from an icon (or the launcher); only a minimal environment is passed to IDEA. To get the same environment that you set up for your command shell, you have to start IDEA from a command shell.
We've been thinking about adding the extra data needed to the SDK configuration. We haven't gotten to that yet.
(BTW. I'm sure that there are at least two other bugs that address this issue, but I can't find them at the moment. :/ )
Starting it from the command line after exporting HAXE_STD_PATH does get past that error, but I still can't get it working. I still get "Unresolved symbol..." and "Unresolved type" errors in the editor. Debugging with the C++ target now gives me: Error:(2, 7) Type not found : openfl.events.Event
I tried adding openfl 7,1,2 and lime 6,2,0 to the classpath of the SDK, which removes the "Unresolved symbol..." and "Unresolved type" errors in the editor, but doesn't change the behavior of the Debug build.
I added Global Library entries for openfl 7,1,2 and lime 6,2,0 and added those as dependencies to the project, and I get a new error:
/usr/local/lib/haxe/lib/lime/6,2,0/lime/system/System.hx
Error:(322, 14) Class
Am I missing some other settings, either in environment variables or in the plugin preferences or the module settings?
I got the debugger working using the openfl Flash target and following the instructions here: https://www.youtube.com/watch?v=kvFg1Zee4h4
And still starting IntelliJ from the shell as you suggested, after exporting HAXE_STD_PATH.
@alexnauda, good job! @EricBishton, I guess we need add such things into FAQ.
Thanks for yr help, i had this problem too. Here's a handy stackoverflow answer on how to set a global environment variable on OSX... https://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x#588442
Still can't get it to work. Here my variable path
I'm starting Idea using Terminal line /Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea
which is executed from project directory.
It is so frustrating, please help.
@JokerDen Try things in this order: 1) Make sure that you can get a "Hello World" app to build and run outside of IntelliJ. 2) From that working command shell, start IDEA. 3) Make sure that "/usr/local/lib/haxe/std" is the first and only entry in both the Classpath and Sourcepath tabs for your Haxe SDK (File->Project Structure...->SDKs). 4) Make sure that your project is pointing at the Haxe SDK.
As far as the Path Variables that you reference in your screen shot, I don't think that the plugin is paying attention to that (but we probably should be).
There is a working example project using hxcpp and hxcpp-debugger on Windows at: https://github.com/HaxeFoundation/intellij-haxe/tree/master/ExampleProjects/HxcppDebugging I will test that on Mac shortly.
@EricBishton Thanks for reply.
/Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea
.@jokerden Please post screen shots of your project and module configurations (all tabs). Also post the contents of the messages pane (at least the first half dozen lines and the relevant error messages from the compiler).
@EricBishton Here they are (sorry for uncropped images):
@EricBishton I have the exact same issue and my setup is identical to @JokerDen l. I added the environment var to IntelliJ and launchd.conf. I also tried launching Intellij via the terminal too. Now if I Install (with IntelliJ open) Have 3.4.4 and run the Haxelib setup and update the SDK in the project the project will build no problem. I sent you an email too... and we had a brief chat.
I just want to confirm jrmarkham's solution. I had the exact same problem (standard library not found) and identical paths setup in the IDE and launchd.conf.
Reverting from Haxe 3.4.7 to Haxe 3.4.4 resolved the problem.
Re-opening because it seems like a few people have been running into this again. Though the issue appears to be related to the Haxe version now, not just the Mac environment.
I found a way to fix it. You just need to add path to std lib in lime config. In my case it was /usr/admin/.lime/config.xml Hope it helps to somebody=)
@kiloT Thank you, this worked!
me who still not work =(
@kantaphat7 We can't possibly begin to help you without knowing the problem you are having. Let's have some particulars, please:
What error message are you seeing?
Which IDE? What Version?
Which OS? What Version?
Which version of Haxe?
Which version of the plugin?
What is in your environment? (Go to the console within the IDE and run "set". Paste the output.)
Can I have the full folder/file path please?
Nevermind
Nope I do need the folder/file path
If I use command prompt its "Standard library not found. You may need to set your HAXE_STD_PATH
environment variable" error message
i found the folder ".lime"
ok now i have another error 'Error: "C:\Users\my user is not gonna be here\ .lime\config.xml" contains invalid XML data'
fixed, i didnt have haxe fml
and still fml, not fixed
i cant get it to work and nobody likes me
i quit this page
I found a way to fix it. You just need to add path to std lib in lime config. In my case it was /usr/admin/.lime/config.xml Hope it helps to somebody=)
it wont work @kiloT
I'm trying to use this plugin in a Mac and can't get a run config or debug config to work... IntelliJ 2017.2.2 Haxe Toolkit Support 0.11.2 OSX El Capitan 10.11.6 Haxe 3.4.5 Haxelib 3.3.0 openfl 7.1.2
After I installed the Haxe Toolkit Support plugin, I import a new project from sources (based on an openfl sample) and it detected Haxe sources and selected the Haxe 3.4.5 SDK. In Project Structure > Platform Settings > SDKs > Haxe 3.4.5, in the Classpath tab, it shows /usr/local/lib/haxe/std, which is where my std library is located.
I created a run configuration for the application (this is C++ target but I get the same thing with any target). When I try to run it I get:
Information:2/24/18, 4:19 PM - Compilation completed with 2 errors and 0 warnings in 69ms Error:Compilation failed /Applications/IntelliJ IDEA.app/Contents/bin Information:/usr/local/lib/haxe/haxe -main Main -debug -cp /Users/alex/w/WeatherGraph/Source -cpp .exe Information:Standard library not found Information:No additional error information available. Error: (Command exited with an error code) 1
I thought maybe I need to create a Haxe Library under Global Libraries for the std library. When I do that and add it under Dependencies, I get a different error:
Information:2/24/18, 4:29 PM - Compilation completed with 3 errors and 0 warnings in 145ms Error:Compilation failed /Applications/IntelliJ IDEA.app/Contents/bin Information:/usr/local/lib/haxe/haxe -main Main -debug -cp /Users/alex/w/WeatherGraph/Source -cp /usr/local/lib/haxe/std -cp /usr/local/lib/haxe/std -cpp .exe Information:No additional error information available. Error: (Command exited with an error code) 1 /usr/local/lib/haxe/std/Std.hx Error:(23, 7) Please don't add haxe/std to your classpath, instead set HAXE_STD_PATH env var
I do have the HAXE_STD_PATH env var set, under Preferences > Appearance & Behavior > Path Variables, to the same path (/usr/local/lib/haxe/std). Still doesn't work.
Any suggestions?