AngelScript on WindowsRT

Started by
13 comments, last by WitchLord 8 years, 2 months ago

I am in the process of porting my engine to Windows Store and Windows Phone 8. I have encountered a problem with scripting however. On all platforms the library compiles. Upon execution of and start up is when the problem shows.

I have traced through start up, and when i get to this line of code

engine->RegisterObjectType("Array<class T>", 0, asOBJ_REF | asOBJ_TEMPLATE);

that fails with an error code of -7, and "configFailed" is then set to true, at which none of my scripts compile. All of this runs perfectly fine on Windows 8 (Desktop apps). I am not sure what configuration setup i need to have for Windows RT or WP8.

Thanks for any help

It is also throwing a -17 error, InvalidConfiguration. This leads me to think i am missing a setting or define that is needed.

Code makes the man
Advertisement

It is strange that RegisterObjectType() returns -7 (asNOT_SUPPORTED). Are you certain that it is this call that returns this error?

Anyway, I guess Windows RT requires a different configuration in as_config.h to work properly with native calling conventions. Can you provide a list of the predefined macros that the compiler uses when compiling for Windows RT? I'll need that to see what can be used to identify Windows RT as the target and decide how to configure the library for it.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

i have tracked it down further, and found that the calling convention is not supported, thus returning -17, invalid configuration. after that, all other register calls return -7.

Code makes the man

as for preprocessor defines, is there anything in particular you would like? i program mostly in windows store and RT, and i know a few of the triggers i go off of, and i have a few custom ones that i use within the engine.

this url provides a few of the techniques that i use to define my application for my enterprise solutions as i have to support ARM, X86, X64 and Windows Phone 8.

http://social.msdn.microsoft.com/Forums/windowsapps/en-US/3965645c-978c-4148-b32c-1853f7fd22b3/platform-defined-macros-for-windows-store-app?forum=winappswithnativecode

Code makes the man

Probably the only thing that needs to change in as_config.h is the following:

Line 465 :

#ifdef _ARM_

to

#if defined(_ARM_) || defined(_M_ARM)

Can you give that a try and see if it resolves the problem?

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Applying that addition, i receive 6 unresolved errors for


Error	1	error LNK2019: unresolved external symbol armFunc referenced in function "unsigned __int64 __cdecl CallSystemFunctionNative(class asCContext *,class asCScriptFunction *,void *,unsigned long *,void *,unsigned __int64 &)" (?CallSystemFunctionNative@@YA_KPAVasCContext@@PAVasCScriptFunction@@PAXPAK2AA_K@Z)	D:\Development\KeefersKorner\Aurora\Development\Build\WinStore\Engine\Urho3D\AngelScript.lib(as_callfunc_arm.obj)	Urho3D

all stemming from as_callfunc_arm.obj

On line 646 i also saw that define, so i applied the additional define there, but no joy.

Would it be easier to discuss more real time, email, etc... ?

Code makes the man

The missing symbols armFunc?? are implemented in as_callfunc_arm_msvc.asm. You'll need to include this when compiling the library for ARM CPUs.

Since it is an assembler file you'll probably need to use a custom build option. Unfortunately I don't know the command line tool for compiling arm assembler routines, but I suppose it is similar to what is used for x64:

ml64.exe /c /nologo /Fo$(OutDir)as_callfunc_x64_msvc_asm.obj /W3 /Zi /Ta %(RootDir)%(Directory)\%(Filename)%(Extension)

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

So i have it compiling (well assembling) the as_callfunc_arm_msvc.asm file. It compiles out the library, upon linking i get an error message saying the obj file can not be found.


Error	1	error LNK1181: cannot open input file 'C:\@Projects\TFS Cloud\Aurora\Development\Temp\Store\AngelScript\Debug\as_callfunc_arm_msvc.obj'	C:\@Projects\TFS Cloud\Aurora\Development\Build\WinStore\Third Party\AngelScript\LINK	AngelScript

I am using Visual Studio 2013, and i have added the Microsoft masm Build Customization File target as checked, and also in the properties of the asm file i have "Item Type" set to Microsoft Macro Assembler, and under "Object File" i have "Make All Symbols Public" set to yes.

I apologize, but my lack of asm skills is very apparent lol.

Thanks much in advance

Code makes the man

Sounds like the assembly output file (as_callfunc_arm_msvc.obj) didn't end up in the directory where the linker expected it.

Can you send me the MSVC project file (*.vcxproj) for the library? I'll see if I can spot the mistake.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I have attached the project file that you requested.

Code makes the man

This topic is closed to new replies.

Advertisement