yashsingh1/xdaforums huggingface dataset:
[Windows RT Development and Hacking] bartekxyz:
Hi, I'm trying to recompile ScummVM for Windows RT and everything seems to go well, after changing solution platform and configuration building goes well, but at 99% there is an error:

Error	2	error MSB6006: "cmd.exe" exited with code 9009.	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets	172	5	scummvm

Could anyone help?

EDIT: Possibly I found source of a problem:

31>------ Rebuild All started: Project: scummvm, Configuration: Release ARM ------
31> Performing Custom Build Tools
31> 'nasm.exe' is not recognized as an internal or external command,
31> operable program or batch file.
31> Performing Custom Build Tools
31> 'nasm.exe' is not recognized as an internal or external command,
31> operable program or batch file.
31>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(172,5): error MSB6006: "cmd.exe" exited with code 9009.
========== Rebuild All: 30 succeeded, 1 failed, 0 skipped ==========

From ScummVM dev wiki:

"Additional tools

You will need to download and install nasm which is used for assembler versions of our scalers."

Must find a way to cut it from source.

EDIT: Ok, there were 2 scalers written in ASM, I deleted those so nasm is no longer needed, also scummvm make use of libmad - MPEG audio decoder library which has some inline assembly so I was forced to get rid of it. Still there are 6 errors I can't resolve:

31>C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(1182): warning C4005: 'ARRAYSIZE' : macro redefinition
31> ..\..\common/util.h(58) : see previous definition of 'ARRAYSIZE'
31>D:\Programy\VS2011\VC\include\setjmp.h(122): warning C4005: 'setjmp' : macro redefinition
31> ..\..\common/forbidden.h(189) : see previous definition of 'setjmp'
31>D:\Programy\VS2011\VC\include\setjmp.h(175): error C2146: syntax error : missing ';' before identifier 'SYMBOL'
31>D:\Programy\VS2011\VC\include\setjmp.h(175): warning C4229: anachronism used : modifiers on data are ignored
31>D:\Programy\VS2011\VC\include\setjmp.h(175): error C2182: 'FORBIDDEN_look_at_common_forbidden_h_for_more_info' : illegal use of type 'void'
31>D:\Programy\VS2011\VC\include\setjmp.h(175): error C2495: 'FORBIDDEN_look_at_common_forbidden_h_for_more_info' : '__declspec(noreturn)' can only be applied to function declarations or definitions
31>D:\Programy\VS2011\VC\include\setjmp.h(175): error C2143: syntax error : missing ';' before '!'
31>D:\Programy\VS2011\VC\include\setjmp.h(175): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
31>D:\Programy\VS2011\VC\include\setjmp.h(175): error C2059: syntax error : '%'
[Windows RT Development and Hacking] schettj:
Have you looked at common_forbidden.h for more info?

These errors usually happen when some header file has ifdef blocks for x86 and x64 and an a final else block that errors. When you compile for arm, you hit that else block. You'll need to figure out the "right" way to do whatever they're doing for arm.

setjump/longjump usually do crap with the pc and stack pointers, so it will be cpu specific. google for arm setjmp.h to get some ideas of what you'll have to do to make it work for arm...
[Windows RT Development and Hacking] GoodDayToDie:
Also, unless those assembly files were merely optional optimizations for C/C++ code that you can use instead, simply "removing" chunks of assembly is likely to break things. You havne't gotten to the linker, yet; it may conlain of missing program entry points when you do unless you have substitutes for those assembly functions.
[Windows RT Development and Hacking] bartekxyz:
Those assembly lines were used by two scalers. Also there is nice tool in scummvm source that you can use to customize project, example:

C:\Users\Bartek\Desktop\scummvm-1.5.0\dists\msvc10>create_project.exe ..\.. --ms
vc --disable-nasm --disable-mad --disable-freetype
Enabled engines:

SCUMM
v7 & v8 games
HE71+ games
AGI
AGOS
AGOS 2 games
CGE
Cinematique evo 1
Magic Composer
Cinematique evo 2
Dragon History
Drascula: The Vampire Strikes Back
Dreamweb
Gobli*ns
Groovie
Hugo Trilogy
Legend of Kyrandia
Lands of Lore
Lure of the Temptress
MADE
Mohawk
Parallaction
Flight of the Amazon Queen
SAGA
IHNM
SCI
Beneath a Steel Sky
Broken Sword
Broken Sword II
Teen Agent
Tinsel
Toonstruck
Touche: The Adventures of the Fifth Musketeer
TsAGE
Bud Tucker in Double Trouble

Disabled engines:

Groovie 2 games
Eye of the Beholder
The Last Express
Where in Time is Carmen Sandiego?
Riven: The Sequel to Myst
Myst
SAGA 2 games
SCI32 games
Broken Sword 2.5
TestBed: the Testing framework
3 Skulls of the Toltecs

Enabled features:

zlib (compression) support
Ogg Vorbis support
FLAC support
libpng support
Theora decoding support
Bink video support
Scalers
HQ scalers
16bit color support
integrated MT-32 emulator
Taskbar integration support
Translation support
System language detection support

Disabled features:

libmad (MP3) support
FreeType support
IA-32 assembly support
OpenGL support
Virtual keyboard support
Keymapper support

C:\Users\Bartek\Desktop\scummvm-1.5.0\dists\msvc10>

Still, those setjmp errors, specifically in line:

_CRTIMP __declspec(noreturn) void __cdecl longjmp(_In_ jmp_buf _Buf, _In_ int _Value) throw(...);

It's beyond me so I'm forced to give up.
[Windows RT Development and Hacking] irony_delerium:
libmad builds fine - it just needs to be built with /D FPM_DEFAULT or /D FPM_64BIT instead of any other potential option. scummvm probably has a config.h for libmad that has:

#define FPM_INTEL

in it (or similar in the C/C++ macro list in VS), which causes x86 assembler to be used in the fixed-point routines.
[Windows RT Development and Hacking] bartekxyz:
Good to know. BTW, setjmp errors are gone - adding "#define FORBIDDEN_SYMBOL_ALLOW_ALL" at the beginning of backends/saves/windows/windows-saves.cpp solved this problem. Still I was expecting it to be easier job so don't know if I will handle this.

EDIT: Building went ok, now there are errors during code generation. Could anybody look at this?:

Error	11	error LNK1169: one or more multiply defined symbols found	C:\Users\Bartek\Desktop\scummvm-1.5.0\dists\msvc10\Release32\scummvm.exe	1	1	scummvm
Error	9	error LNK2005: "private: __cdecl type_info::type_info(class type_info const &)" (??0type_info@@AAA@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)	C:\Users\Bartek\Desktop\scummvm-1.5.0\dists\msvc10\MSVCRT.lib(ti_inst.obj)	scummvm
Error	10	error LNK2005: "private: class type_info & __cdecl type_info::operator=(class type_info const &)" (??4type_info@@AAAAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)	C:\Users\Bartek\Desktop\scummvm-1.5.0\dists\msvc10\MSVCRT.lib(ti_inst.obj)	scummvm
Error	8	error LNK2005: free already defined in LIBCMT.lib(free.obj)	C:\Users\Bartek\Desktop\scummvm-1.5.0\dists\msvc10\MSVCRT.lib(MSVCR110.dll)	scummvm
Error	7	error LNK2005: malloc already defined in LIBCMT.lib(malloc.obj)	C:\Users\Bartek\Desktop\scummvm-1.5.0\dists\msvc10\MSVCRT.lib(MSVCR110.dll)	scummvm

EDIT2: Already figured it out. So the very first Windows RT build of ScummVM is ready, much still have to be done but that's some start.

http://xdaforums.com/showpost.php?p=37583092&postcount=402
[Windows RT Development and Hacking] mamaich:
There is no MFC library for ARM in Visual Studio, though DLL is present on the device.

We can't use dll2lib to create our own import library from mfc110u.dll as it exports only ordinals, but I was managed to recompile MFC from sources as a static library. As MS provided incomplete sources - some features are not present, for example using OLE controls and MFC controls embedded in dialogs designed in visual studio dialog editor. Creating those controls dynamically would work fine.

More information is here.

LIB sizes are huge (157 Mb debug and 1.2 Gb release builds) as I have not stripped the debug information. Don't be afraid of that - the produced EXE files would be small.

You can recompile MFC yourself like I did, or download LIBs here: http://www.multiupload.nl/FJEYPW5M26

Compressed with 7Zip as it gave the smallest archive size.

For installation - uncompress them into: "\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\lib\arm\" directory, add "#define _AFX_NO_MFC_CONTROLS_IN_DIALOGS" to your stdafx.h and select "use MFC in static library" in your project settings.
[Windows RT Development and Hacking] no2chem:
Good idea mamaich, I haven't had much time lately, but I was able to get a mfc .def with most of the named ordinals by using libtool and dumpbin with the .pdb in the directory. If dumpbin detects a .pdb file, it uses the pdb hints to generate the .def. Microsoft SymServer has the pdb for arm.

The problem I had is with the mfc static part, maybe you could figure that out and we'll have MFC :)
[Windows RT Development and Hacking] mamaich:
Unfortunately I don't have time for that - spending all time on the emulator project.

But it should not be too difficult. After looking at static x86 part - you can see the needed files:

rawdllmainproxy.obj
stdafx.obj
nolib.obj
appmodul.obj
dumpstak.obj
oleexp.obj
sockexp.obj
dllmodul.obj
dllmodulx.obj

All files except for the last one are present. You need to reconstruct the last one manually looking at the dumpbin output. Or maybe we could ask in microsoft forums for this file? :)
[Windows RT Development and Hacking] GoodDayToDie:
Ugh... working on porting Free Download Manager, and it's demanding MFC and ATL, and in particular nafxcw.lib. I don't know MFC very well at all; not sure what it would take to get that file but without it I'm not able to port the program. I've gotten almost all the components ported, but the actual EXE is MFC based.
[Windows RT Development and Hacking] Laos101:
Good luck to everyone making some awesome ports. I hope to feature some of these awesome ports on the website I write for once they're ready
[Windows RT Development and Hacking] gloom:
wrong post
[Windows RT Development and Hacking] DarkoLord:
Is there a way you can link DRV files?

I use the the excellent dll-to-lib.ps1 script it makes a .lib file and I can link it, however the compiled application then wants the DLL file - copying the .drv file to the application folder and renaming it to .dll does work, however it seems a bit redundant...

It's the same with OCX files...
[Windows RT Development and Hacking] irony_delerium:
In dll-to-lib.ps1, change:

&$lib /def:$deffile /out:$libfile /MACHINE:arm

to:

$dllfile = $_.Name

&$lib /def:$deffile /out:$libfile /MACHINE:arm /name:$dllfile

Then run dll-to-lib again; the newly generated .lib files will have the proper library name to link in them.
[Windows RT Development and Hacking] DarkoLord:
Perfect. Thanks!
[Windows RT Development and Hacking] stephensteck:
Remote Debugging

I have gotten my application to load on the Surface RT, but it seems to hang at a certain point. Is there any way to set up remote debugging (the application runs fine on the x86 or x64 platforms) so I can figure out where it is hanging?
[Windows RT Development and Hacking] DarkoLord:
Yes, of course. You can install the remote debugger (get it here or in the VS install dir) on the RT and connect to it with your desktop VS.
[Windows RT Development and Hacking] Myriachan:
I figured out a way to support RT desktop compilation without modifying the compiler's Microsoft.Cpp.ARM.Common.props file, which is nice if you want to distribute your changes to others.

Set up each of your Visual Studio projects to have an ARM target as usual, then close Visual Studio. For each .vcproj file of the solution, do the following:

1. Open the .vcproj file in Notepad or a similar text editor.

2. Find the <PropertyGroup> tag representing the Debug ARM target. An example:

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">

3. Inside that PropertyGroup, add this tag:

<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>

4. Repeat for any other ARM targets you have (typically Release).

That tag is the same as the one you can add to Microsoft.Cpp.ARM.Common.props, but without having to modify your Visual Studio installation. For the extra .lib files, you can always just put them in one of your project directories and add that directory to your library path for the project. Then no changes to Visual Studio 2012 will be required to compile your project.
[Windows RT Development and Hacking] YamiHoshi:
Hi there,

I've almost fully ported an App I always preferred to be Ported.

However, it uses DirectX 8, and I'm getting this error:

error LNK2001: unresolved external symbol Direct3DCreate8

Anybody who can help this girl out again?
[Windows RT Development and Hacking] netham45:
DirectX 8 isn't present on the tablet, you can either port it to render in software mode or port it to one of the versions of DirectX that is present (I want to say DX9/10/11 are present, but in limited forms, but I'm honestly not sure.)
[Windows RT Development and Hacking] Myriachan:
Hi =^-^= Glad I'm not the only girl here. =)

I'd just port it to DirectX 9. I once ported a professional AAA-title Windows game from DirectX 8 to DirectX 9 in about 3 hours. They are really, really similar interfaces.

Do the porting to DirectX 9 on x86 first, then port over to ARM. It'll be easier that way.
[Windows RT Development and Hacking] YamiHoshi:
Porting to DirectX 9 worked, but there's another problem incoming: AVIFIL32.dll is missing.

It's present on my Windows 8 PC, but it doesn't work on the Surface.
[Windows RT Development and Hacking] lilstevie:
if it isn't present in the windows rt system that may be a little bit of an issue. does it provide important functionality for the application?
[Windows RT Development and Hacking] YamiHoshi:
Yes, even a lot, as it's a recording App.

The Source Code I've got still uses VFW, which is a really, really old API.

The original maker of it has already rewritten it to the new one, I'll try to get my brother to ask for the new Code.
[Windows RT Development and Hacking] SixSixSevenSeven:
thats great but we dont have directX 9 either. 9 and 10 are next to non existant on RT. 11 is there I think.
[Windows RT Development and Hacking] netham45:
I wasn't able to find it when I ported over WabbitEmu (has a recording feature), but since it wasn't critical to the app's core functionality I just removed it.
[Windows RT Development and Hacking] GoodDayToDie:
AVI is just a media file container, not an actual codec. Depending on the necessary codec support and the complexity of the API, it may be possible to either implement it yourself or adapt one of the open-source implementations.

Alternatively, you may be able to just rip out AVI support. Nobody sane will mind that much; it's a deprecated and mildly terrible format.
[Windows RT Development and Hacking] YamiHoshi:
I've got the new Code, and it works now.

Download: http://3dscapture.com/forum/viewtopic.php?f=3&t=616

Feel free to re-host it, but it's not like anybody here will find it useful, though.
[Windows RT Development and Hacking] mamaich:
Updated the windows RT MFC library. Download it here: https://drive.google.com/folderview?id=0B25hIeyRmniUZzk0c3hNZmVDSms&usp=sharing

Now you can use MFC controls in dialog templates, COM maybe working, and non-unicode library is present (non-unicode lib is only release build, as debug build fails to run for some reason).

MFC sources with my modifications are attached, so anyone can rebuild them if needed.

Edited 29 apr.

Archive mfc-winrt.7z on google drive contained a wrong uafxcw.lib file - the apps using that lib would not build. Reuploaded a correct archive.
[Windows RT Development and Hacking] mamaich:
Reposting here to keep all porting hints in the same thread.

danesh110 found that beta version of Visual Studio 2012 (VS11) contained the ARM MFC library: http://xdaforums.com/showpost.php?p=40988765&postcount=690

VS11 beta contains both static and DLL MFC versions, both debug and retail. You can download it here: http://download.microsoft.com/downl...-40C9-A53C-E6322E2F033D/VS11_BETA_ULT_ENU.iso, install it, for example, into virtual machine and grab files from "C:\Program Files\Microsoft Visual Studio 11.0\VC\atlmfc\lib\arm" folder.

It is better to use Microsoft-made MFC than my files - as my sources contain some stubs and hacks.

I've compared the MFC sources from VS11 beta with the retail VS2012 - they are more complete in beta. Sources contain files missing from the retail build.
[Windows RT Development and Hacking] chinabull:
Not sure it matters but just want to confirm the vs 2012 express also has the arm compiler included. I have built and run one of our win32 app on my vivotab rt. Of course I have to do the trick for vs 2012 settings and pulled libs from my rt tablet. I have 3 versions of vs 2012 express installed: WP, windows8, windows desktop, btw.
[Windows RT Development and Hacking] chinabull:
You have mentioned in the first post:

"Another serious pitfall.. no in-line assembly support in the MS ARM compiler. So you'll have to write in your assembly in a .S file and link to it."

I tried to add a .S file into the project and the visual studio 2012 express doesn't even want to compile it.

Has anybody actually tried a quick assembly file test? Do I have to get the VS2012 Pro edition?

Thanks.

The file I have used:

test.S:

AREA my_test, CODE, READONLY ; name this block of code

EXPORT test

test proc ; start of a procedure

ldr r0,[r15]

mov pc,lr

endp ; end of a procedure

end ; end of the file

---------- Post added at 02:57 PM ---------- Previous post was at 02:19 PM ----------

I have found a way around it.

1. use the armasm.exe included in the VC express to manually compile the .S into .obj

2. include the .obj into the VS express' project

3. rebuild

Still, it'll be really nice to be able to do it automatically in the VS IDE.

If anybody find any way to achieve it, please let me know.
[Windows RT Development and Hacking] bfosterjr:
Add the .s file to the project then open its properties...

General->ItemType ... change this to Custom Build Tool.. and hit apply.

You can then specify a command line for which to build the file using armasm.exe

Cheers!
[Windows RT Development and Hacking] chinabull:
Worked like a charm. Thanks.
[Windows RT Development and Hacking] bfosterjr:
8.1 Preview

All,

FWIW, the 8.1 preview SDK and WDK have full arm support and tools - desktop apps and drivers.

Just mentioning it here for people that might not have already discovered this.

I haven't yet used any of te included libraries yet, but will give them a shot soon

Cheers!
[Windows RT Development and Hacking] noloader:
Dumbin missing

It sounds like dumpbin is not on your path. Navigate to Programs -> Visual Studio -> Tools, and then set the appropriate environment (it puts the tools on path).

---------- Post added at 11:10 PM ---------- Previous post was at 10:59 PM ----------
[Windows RT Development and Hacking] chinabull:
Are you talking about the express version of the VS or professional/ultimate version?

Please clarify.

Thanks.
[Windows RT Development and Hacking] mamaich:
No need to clarify as it is obvious - express version would not contain them by its design goal, as it is "express".
[Windows RT Development and Hacking] bfosterjr:
I'm not aware of any "express" version of the _SDK_.
[Windows RT Development and Hacking] chinabull:
I don't know if it's because of the windows phone SDK I installed or not, my visual studio 2012 express has Arm tools and I can build windows desktop app for my tf600 windows rt tablet.

That is why I am asking about if 2013 express has arm tools.
[Windows RT Development and Hacking] screamer333:
sorry guys, maybe wrong topic for this question,

but, is there are a chance that ported WM5/6 arm app could be run on RT?
[Windows RT Development and Hacking] SixSixSevenSeven:
not easily. Windows mobile ran on ARMv6 (often soft float) whereas RT is ARMv7 (specifically the THUMB mode). The apps used different API's too.

If you have the source for an app it may be portable. It equally may not.
[Windows RT Development and Hacking] GoodDayToDie:
Architecture difference shouldn't be *too* big a problem unless they were using assembly or something crazy like that, but it may make porting require a bit more futzing with the compile options. The difference between the CE and NT versions of the WIn32 API are almost certain to be a bigger problem. It's possible to code portably between those OSes - I know somebody who had an app that could be compiled fro both WinMo and x86 desktop Windows from the same source code - but it's likely something that not many people bothered to do.
[Windows RT Development and Hacking] CraigHumphrey:
VS 2013 Preview works as well

Hey People,

just tried the Platform.Common.Props hack on VS 2013 Ultimate Preview (v12.0.20617.1) and it works a treat, though you have to modify the file in the C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms\ARM folder instead. (note: the V120, not V110).

Later'ish

Craig
[Windows RT Development and Hacking] Myriachan:
There's no need to modify the VS2013 installation at all if you edit your project files in Notepad: http://xdaforums.com/showpost.php?p=39230921&postcount=48

This is better because you can just distribute your project files to others, rather than rely upon them hacking their local VS installation as well.
[Windows RT Development and Hacking] GoodDayToDie:
For bonus points, I'm pretty sure there's a template somewhere which can be modified so that the edit is present in all your new projects by default...
[Windows RT Development and Hacking] Đonny:
Driver / Keyboard layout

Hey guys, really great job with this and with jail-breaking WinRT!

Has anybody managed to build a driver successfully.

I'm trying to build a keyboard layout. It's really not a driver but from compilation point of view it sorta is.

When I try to build from Visual Studio I get

The target "Build" does not exist in the project

(the same project builds on x86).

When I try to build from command line (to avoid MSBuild) I'm getting a lot of errors like these:

C:\Program Files (x86)\Windows Kits\8.0\include\um\winnt.h(7736) : error C4013: 'ReadAcquire8' undefined; assuming extern returning int

or

C:\Program Files (x86)\Windows Kits\8.0\include\um\winnt.h(7999) : error C4013: 'WriteNoFence64' undefined; assuming exte
C:\Program Files (x86)\Windows Kits\8.0\include\um\winnt.h(18832) : error C2065: 'CP15_TPIDRURW' : undeclared identifier

r

But I'm not sure I my command line for CL is good. I took x86 command line from Visual Studio and replaced a few stuff.

cl /GS /analyze- /W4 /Zc:wchar_t- /I"obj\Win32\Win8 Debug" /I"..\..\inc" /Zi /Gm- /Od /FI"C:\Program Files (x86)\Windows Kits\8.0\Include\Shared\warning.h" /fp:precise /D "_X86_=1" /D "i386=1" /D "STD_CALL" /D "WIN32_LEAN_AND_MEAN=1" /D "_WIN32_WINNT=0x0602" /D "WINVER=0x0602" /D "WINNT=1" /D "NTDDI_VERSION=0x06020000" /D "DBG=1" /D "_WINDLL" /errorReport:prompt /WX /Zc:forScope /RTC1 /Oy- /MDd /Fa"obj\Win32\Win8 Debug" /nologo /Fo"obj\Win32\Win8 Debug" /Fp"obj\Win32\Win8 Debug\CzRuQYNm.pch" CzRuQYNm.C CzRuQYNm.DEF

The DLL which represents keyboard layout is actually very simple - it just exports one function which returns a structure. So, it may be possible to compile it against some fake H files with a lot of stuff removed. I really don't need any "ReadAcquire8".

I'd appreciate any hint how to proceed, or if somebody managed to build keyboard layout successfully and can provide some guidance, it'd be great.

I'm attaching a project I'm trying to build.
[Windows RT Development and Hacking] mamaich:
I've successfully built test drivers for RT, but only from GUI.

I have not looked into your code, but my guess is that you are trying to use the API that is not present on RT. MS have removed lots of obsolete kernel APIs in RT.