# AngelScript on WindowsRT

This topic is 1343 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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.

Edited by NiteLordz

##### Share on other sites

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.

##### Share on other sites

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.

##### Share on other sites

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

##### Share on other sites

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?

##### Share on other sites

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... ?

##### Share on other sites

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:

• 16
• 9
• 15
• 9
• 11