Slick2D - Jar'ed Game can't load jinput-linux64 library - lwjgl

I'm working on a game that's using Slick2d library, I'm using Eclipse IDE, 64-bit java 7, on Linux Ubuntu. In IDE i don't have any problems when i run the game (java-7 64-bit is also set for the project), but when i'm trying to run an exported jar, i get the following error:
java.lang.UnsatisfiedLinkError: no jinput-linux64 in java.library.path
I have the natives folder set properly using:
System.setProperty("org.lwjgl.librarypath", "/<my_natives_folder>");
I don't have "no lwjgl in java.library.path" problem, only this, and only when i run the exported jar.
I found some similar problems on the stack, but none of them seems to solve the problem why the game is running without errors in IDE but not from the jar.
Thanks for any help :)

JInput classes are loaded up front, so you can't set it as a system property in code, it needs to be set on the command line.
I got round this by having a launcher for application, it sets up all the properties then loads the classes by name from the class loader, not imported. This means that the properties are set up before the classes are loaded and the libraries statically loaded from those classes.
HTH

Related

Windows Runtime Component Add As Link With Different Namespace

I have been trying to create background tasks in my universal app solution. As separate Windows Runtime Component project is required to contain background tasks, I have add one to my solution. In the tasks I am accessing a class that resides in my shared project and in order to do so I use add as link. Although there seems to be no errors when I try to compile the project I get the following errors.
"winmdexp.exe" exited with code -1073741819.
Metadata file 'C:\...\BackgroundTasks.winmd' could not be found...
I believe it might be caused by the fact that the classes that I add as link doesn't have the same major namespace as background task project.
Does anyone know a solution to this problem.
Thanks in advance.
As stated in Creating Windows Runtime Components in C# and Visual Basic, all public types must have a root namespace that matches the assembly name. I believe by adding a class as a link to my Windows Runtime Component project, I broke the same root namespace restriction and as the project didn't compile successfully metadata file was not created.
In order to solve this problem at first I changed output type of my project to class library and it compiled without a problem. Unfortunately background tasks didn't run when I tried to trigger them from lifecycle events.
So in the end I moved the classes that was shared between my "Shared" and background tasks project into a class library project and this solved my problem.

Error accessing WinRT sensors in C++ desktop application

I am trying to access the WinRT sensors from a Win32 desktop application using C++/CX as mentioned here: https://software.intel.com/en-us/articles/using-winrt-apis-from-desktop-applications
When I include the C++/CX header file it causes an error when building the Win32 project.
Exact error text: "error C1190: managed targeted code requires a '/clr' option."
Since I am not using /clr code at all, this is a confusing error.
Any suggestions? Please educate me if there is a better way to do this.
The error you are getting is because you are compiling some files without /ZW option for compiler. Since you are able compile at least some files with WinRT extensions, but not others, your project configuration is inconsistent.
The option /ZW (enable WinRT extensions) has to be configured on the level of project (and not on the level of individual files). There are two ways to ensure your settings are consistent. First method is through UI in Visual Studio -- you have to go through all platforms/configurations on the project and ensure /ZW is enabled, then got through all indivudual .cpp files, and ensure they don't override project level settings. This is tedious and error prone. The easier method is to open .vcxproj in notepad and do the following:
Add this section at the beginnig of the file, under root Project node:
<ItemDefinitionGroup>
<ClCompile>
<CompileAsWinRT>true</CompileAsWinRT>
</ClCompile>
</ItemDefinitionGroup>
Search and remove any other places where <CompileAsWinRT> is defined.

mxmlc load-externs is ignored

I develop an ActionScript 3 project using FlashDevelop 4.
I have a main SWF holding all the code.
I want to export some of the main SWF code into modules.
I created a module to hold the separated logic (by extending ModuleBase).
I don't want the module SWF to reference anything that is available in the main SWF so i ran the main SWF compilation with -link-report and got a report.xml file holding all the main SWF references.
I tried to compile the module (mxmlc) while excluding any class or library in the main SWF using the load-externs=report.xml option.
The compilation gave me an error saying that some libraries references are missing, but the error message referenced classes that are suppose to be included only in the main SWF.
I checked the report.xml file and it does show that these classes are referenced.
I tried to run the compilation in 3 different ways and always got the same result:
Using the build current file in FlashDevelope and giving the file a header of the command that should be ran.
Using command line (windows).
Using Ant build script.
Does anyone have any idea why this could happen?
I would be happy to supply more information about my problem if it helps anyone guide me to a solution.
Thanks for the help!
It turns out that it did not ignore the load-externs.
The load-externs excluded some of the libraries and therefor these libraries were not found during compile time.
I solved the problem by adding the libraries path to the compilation.
This was done by addind the flag: -l+=lib\

VerifyError: Error #1014: class could not be found

I'm developing AS3 project using Flash Builder 4.5 (also with library Away3D 4.0 and Flex 4.5.1 SDK).
Also, I add my own SWC library, which I compile previously into my project.
It works find if I import class in my SWC library, however I want my swf run in a stand-alone flash player 11.
I follow this tutorial:
http://help.adobe.com/en_US/flashbuilder/using/WSe4e4b720da9dedb5-4dd43be212e8f90c222-7ffb.html
Now, I could run my app in a flash player 11, but I got an error in run time:
VerifyError: Error #1014: XXX class could not be found
And XXX is my class in SWC library. How should I fix this?
Merged into code means this, in project properties -> Flex Build Path -> Library Path -> Framework Linkage. Framework lingage has two options Merged into code and RSL. Chose Merged into code. This should solve your problem.
We had this problem when trying to build a project using a Native Extension.
Classes within the NE weren't being found at runtime, but were accessible in Flash Builder.
It turned out that by default the .ANE file wasn't copied to the device.
To fix this, change the following project property:
ActionScript Build Packaging -> Apple iOS -> Native Extensions -> Check 'Package' for the ANE
No idea why it wasn't included by default. When you uncheck 'Package' you get a warning telling you that it may cause runtime issues!
In my case, we had a nested reference to the same library which needed to load before the other library also using it. This fix can be accomplished by unchecking the 'Automatically determine library ordering based on dependencies' and moving the library up in the chain of Build path libraries. Flash Builder was unable to determine the correct order base on dependencies because we had 2 different versions of the same library. The error would only happen during run time.
I had this problem after installing AIR 3.9 and trying to upgrade a project.
It was also saying there was an RSL error, before throwing a succession of #1014 errors.
It worked after I set the textLayout.swc link type in Advanced ActionScript Settings to 'merged into code' instead of the default (RSL)
Hope this helps!
Since I landed on this page searching for this error message and none of the above solutions worked for me, here's how I finally managed to work around it:
It seems that this error happens particularly when you include old libraries that were compiled with the old compiler but compile your app with the new one. Unfortunately the error sometimes fires and when you compile again it doesn't; at other times it works fine in the debug version but then it fails in the release.
What worked for me is to include dummy objects in your main app which are instances of the class that the verify error complains about:
import some.classpath.to.TheClassThatFailsOnVerify;
function YourMainApp(){
var dummy:TheClassThatFailsOnVerify = new TheClassThatFailsOnVerify ();
}
At least in my case the errors only fired for classes that were not used directly in the app but only internally in the swc library code, so by having the dummy objects in the main app I force Flash Builder to include those classes in the compilation.
In some cases you might have to first find the swc that contains the class in question since it's not part of the library swc you use but it's again a library that that swc uses itself.

The definition of base class ByteArrayAsset was not found

I'm using FlashDevelop4.0.0 RC1 to create AS3 library project, in which I want to import Away3D library. I follow this tutorial to set up my FD.
http://www.mclelun.com/blog/2011/08/flashdevelop-stage3d-away3d/
However, FD generate error message when I use ExportSWC4.2 plugin to compile the project, I got error message said that
at away3d\materials\methods\TerrainDiffuseMethod_NormalizeKernel.as(10): The definition of base class ByteArrayAsset was not found
Can anyone help me with that? Thanks!
p.s.
I also have issue like the following link
http://sourceforge.net/tracker/index.php?func=detail&aid=3401191&group_id=252536&atid=1127375
not sure if it's related to my problem.
Are you downloading the zip package from http://away3d.com/download/ or accessing via SVN / GIT?
http://away3d.com/images/uploads/releases/away3d_4_0_110915.zip
Not sure about their GIT, but I found the SVN repo dated.
I did not see ByteArrayAsset anywhere in the inheritance chain within my version:
away3d.materials.methods.TerrainDiffuseMethod
away3d.materials.methods.BasicDiffuseMethod
away3d.materials.methods.LightingMethodBase
away3d.materials.methods.ShadingMethodBase
mx.core.ByteArrayAsset is an Adobe class.
There's a NormalizeSplats Pixel Bender linkage, but I did not see any Normalize Kernel.
I'd recommend grabbing the Broomstick ZIP package - I had no issues building the SWC with Flash Builder targeting Flash Player 11.