Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSVC ARM builds #6682

Closed
10 tasks done
janisozaur opened this issue Nov 17, 2017 · 10 comments · Fixed by #16887
Closed
10 tasks done

MSVC ARM builds #6682

janisozaur opened this issue Nov 17, 2017 · 10 comments · Fixed by #16887
Labels
build Pertains to compilation, language standard, external dependencies. Windows (OS) Related to the Windows version of OpenRCT2.

Comments

@janisozaur
Copy link
Member

janisozaur commented Nov 17, 2017

OS: Windows 10
Commit/Build: 36236d8

List of (known) issues preventing MSVC from creating ARM (UWP) builds. This is also collecting all the roadblocks not in OpenRCT2 itself, but also in its dependencies.

@janisozaur janisozaur added bug Something went wrong. build Pertains to compilation, language standard, external dependencies. Windows (OS) Related to the Windows version of OpenRCT2. labels Nov 17, 2017
@IntelOrca IntelOrca removed the bug Something went wrong. label Nov 19, 2017
@janisozaur
Copy link
Member Author

janisozaur commented Nov 25, 2017

Log from attempt at building x86-uwp version:

windows.c(61): error C2220: warning treated as error - no 'object' file generated 
windows.c(61): warning C4013: 'GetModuleHandle' undefined; assuming extern returning int 
windows.c(61): warning C4047: '=': 'HMODULE' differs in levels of indirection from 'int' 
windows.c(136): error C2065: 'SHFILEOPSTRUCTW': undeclared identifier 
windows.c(136): error C2146: syntax error: missing ';' before identifier 'fileop' 
windows.c(136): error C2065: 'fileop': undeclared identifier 
windows.c(137): error C2065: 'fileop': undeclared identifier 
windows.c(137): error C2224: left of '.hwnd' must have struct/union type 
windows.c(138): error C2065: 'fileop': undeclared identifier 
windows.c(138): error C2224: left of '.wFunc' must have struct/union type 
windows.c(138): error C2065: 'FO_DELETE': undeclared identifier 
windows.c(139): error C2065: 'fileop': undeclared identifier 
windows.c(139): error C2224: left of '.pFrom' must have struct/union type 
windows.c(140): error C2065: 'fileop': undeclared identifier 
windows.c(140): error C2224: left of '.pTo' must have struct/union type 
windows.c(141): error C2065: 'fileop': undeclared identifier 
windows.c(141): error C2224: left of '.fFlags' must have struct/union type 
windows.c(141): error C2065: 'FOF_NOCONFIRMATION': undeclared identifier 
windows.c(141): error C2065: 'FOF_SILENT': undeclared identifier 
windows.c(143): error C2065: 'fileop': undeclared identifier 
windows.c(143): error C2224: left of '.fAnyOperationsAborted' must have struct/union type 
windows.c(144): error C2065: 'fileop': undeclared identifier 
windows.c(144): error C2224: left of '.lpszProgressTitle' must have struct/union type 
windows.c(145): error C2065: 'fileop': undeclared identifier 
windows.c(145): error C2224: left of '.hNameMappings' must have struct/union type 
windows.c(147): warning C4013: 'SHFileOperationW' undefined; assuming extern returning int 
windows.c(147): error C2065: 'fileop': undeclared identifier 
windows.c(156): warning C4133: 'function': incompatible types - from 'char 
windows.c(159): warning C4133: 'function': incompatible types - from 'char 
windows.c(317): warning C4013: 'lstrlenW' undefined; assuming extern returning int 
windows.c(404): warning C4013: 'MoveFileW' undefined; assuming extern returning int 
windows.c(487): warning C4013: 'SHGetFolderPathW' undefined; assuming extern returning int 
windows.c(487): error C2065: 'CSIDL_PERSONAL': undeclared identifier 
windows.c(487): error C2065: 'CSIDL_FLAG_CREATE': undeclared identifier 
windows.c(516): warning C4013: 'RegOpenKeyW' undefined; assuming extern returning int 
windows.c(520): warning C4013: 'RegQueryValueExW' undefined; assuming extern returning int 
windows.c(522): warning C4013: 'RegCloseKey' undefined; assuming extern returning int 
windows.c(555): warning C4013: 'RegOpenKeyA' undefined; assuming extern returning int 
windows.c(563): warning C4013: 'RegQueryValueExA' undefined; assuming extern returning int 
windows.c(589): warning C4133: 'function': incompatible types - from 'LPSTR' to 'LPWSTR' 
windows.c(659): warning C4133: 'function': incompatible types - from 'LPSTR' to 'LPWSTR' 
windows.c(673): warning C4133: 'function': incompatible types - from 'LPSTR' to 'LPWSTR' 
windows.c(696): warning C4133: 'function': incompatible types - from 'LPSTR' to 'LPWSTR' 
windows.c(771): warning C4013: 'SHGetKnownFolderPath' undefined; assuming extern returning int 
windows.c(771): error C2065: 'FOLDERID_Fonts': undeclared identifier 
windows.c(831): error C2065: 'UNLEN': undeclared identifier 
windows.c(831): error C2057: expected constant expression 
windows.c(831): error C2466: cannot allocate an array of constant size 0 
windows.c(831): error C2133: 'username': unknown size 
windows.c(833): error C2065: 'UNLEN': undeclared identifier 
windows.c(834): warning C4013: 'GetUserName' undefined; assuming extern returning int 
windows.c(872): warning C4013: 'lstrcpyW' undefined; assuming extern returning int 
windows.c(909): warning C4013: 'RegSetValueW' undefined; assuming extern returning int 
windows.c(913): warning C4013: 'RegCreateKeyW' undefined; assuming extern returning int 
windows.c(966): warning C4013: 'RegDeleteTreeA' undefined; assuming extern returning int 
windows.c(971): warning C4013: 'RegDeleteTreeW' undefined; assuming extern returning int 
windows.c(988): warning C4013: 'SHChangeNotify' undefined; assuming extern returning int 
windows.c(988): error C2065: 'SHCNE_ASSOCCHANGED': undeclared identifier 
windows.c(988): error C2065: 'SHCNF_IDLIST': undeclared identifier 
windows.c(1002): error C2065: 'SHCNE_ASSOCCHANGED': undeclared identifier 
windows.c(1002): error C2065: 'SHCNF_IDLIST': undeclared identifier 
windows.c(1020): warning C4013: 'RegCreateKeyA' undefined; assuming extern returning int 
windows.c(1021): warning C4013: 'RegSetValueA' undefined; assuming extern returning int 
windows.c(1022): warning C4013: 'RegSetKeyValueA' undefined; assuming extern returning int 
windows.c(1038): warning C4013: 'RegSetKeyValueW' undefined; assuming extern returning int 
windows.c(61): warning C4013: 'GetModuleHandle' undefined; assuming extern returning int 
windows.c(61): warning C4047: '=': 'HMODULE' differs in levels of indirection from 'int' 
windows.c(147): warning C4013: 'SHFileOperationW' undefined; assuming extern returning int 
windows.c(156): warning C4133: 'function': incompatible types - from 'char 
windows.c(159): warning C4133: 'function': incompatible types - from 'char 
windows.c(317): warning C4013: 'lstrlenW' undefined; assuming extern returning int 
windows.c(404): warning C4013: 'MoveFileW' undefined; assuming extern returning int 
windows.c(487): warning C4013: 'SHGetFolderPathW' undefined; assuming extern returning int 
windows.c(516): warning C4013: 'RegOpenKeyW' undefined; assuming extern returning int 
windows.c(520): warning C4013: 'RegQueryValueExW' undefined; assuming extern returning int 
windows.c(522): warning C4013: 'RegCloseKey' undefined; assuming extern returning int 
windows.c(555): warning C4013: 'RegOpenKeyA' undefined; assuming extern returning int 
windows.c(563): warning C4013: 'RegQueryValueExA' undefined; assuming extern returning int 
windows.c(589): warning C4133: 'function': incompatible types - from 'LPSTR' to 'LPWSTR' 
windows.c(659): warning C4133: 'function': incompatible types - from 'LPSTR' to 'LPWSTR' 
windows.c(673): warning C4133: 'function': incompatible types - from 'LPSTR' to 'LPWSTR' 
windows.c(696): warning C4133: 'function': incompatible types - from 'LPSTR' to 'LPWSTR' 
windows.c(771): warning C4013: 'SHGetKnownFolderPath' undefined; assuming extern returning int 
windows.c(834): warning C4013: 'GetUserName' undefined; assuming extern returning int 
windows.c(872): warning C4013: 'lstrcpyW' undefined; assuming extern returning int 
windows.c(909): warning C4013: 'RegSetValueW' undefined; assuming extern returning int 
windows.c(913): warning C4013: 'RegCreateKeyW' undefined; assuming extern returning int 
windows.c(966): warning C4013: 'RegDeleteTreeA' undefined; assuming extern returning int 
windows.c(971): warning C4013: 'RegDeleteTreeW' undefined; assuming extern returning int 
windows.c(988): warning C4013: 'SHChangeNotify' undefined; assuming extern returning int 
windows.c(1020): warning C4013: 'RegCreateKeyA' undefined; assuming extern returning int 
windows.c(1021): warning C4013: 'RegSetValueA' undefined; assuming extern returning int 
windows.c(1022): warning C4013: 'RegSetKeyValueA' undefined; assuming extern returning int 
windows.c(1038): warning C4013: 'RegSetKeyValueW' undefined; assuming extern returning int 
windows.c(61): error C2220: warning treated as error - no 'object' file generated 
windows.c(136): error C2065: 'SHFILEOPSTRUCTW': undeclared identifier 
windows.c(136): error C2146: syntax error: missing ';' before identifier 'fileop' 
windows.c(136): error C2065: 'fileop': undeclared identifier 
windows.c(137): error C2065: 'fileop': undeclared identifier 
windows.c(137): error C2224: left of '.hwnd' must have struct/union type 
windows.c(138): error C2065: 'fileop': undeclared identifier 
windows.c(138): error C2224: left of '.wFunc' must have struct/union type 
windows.c(138): error C2065: 'FO_DELETE': undeclared identifier 
windows.c(139): error C2065: 'fileop': undeclared identifier 
windows.c(139): error C2224: left of '.pFrom' must have struct/union type 
windows.c(140): error C2065: 'fileop': undeclared identifier 
windows.c(140): error C2224: left of '.pTo' must have struct/union type 
windows.c(141): error C2065: 'fileop': undeclared identifier 
windows.c(141): error C2224: left of '.fFlags' must have struct/union type 
windows.c(141): error C2065: 'FOF_NOCONFIRMATION': undeclared identifier 
windows.c(141): error C2065: 'FOF_SILENT': undeclared identifier 
windows.c(143): error C2065: 'fileop': undeclared identifier 
windows.c(143): error C2224: left of '.fAnyOperationsAborted' must have struct/union type 
windows.c(144): error C2065: 'fileop': undeclared identifier 
windows.c(144): error C2224: left of '.lpszProgressTitle' must have struct/union type 
windows.c(145): error C2065: 'fileop': undeclared identifier 
windows.c(145): error C2224: left of '.hNameMappings' must have struct/union type 
windows.c(147): error C2065: 'fileop': undeclared identifier 
windows.c(487): error C2065: 'CSIDL_PERSONAL': undeclared identifier 
windows.c(487): error C2065: 'CSIDL_FLAG_CREATE': undeclared identifier 
windows.c(771): error C2065: 'FOLDERID_Fonts': undeclared identifier 
windows.c(831): error C2065: 'UNLEN': undeclared identifier 
windows.c(831): error C2057: expected constant expression 
windows.c(831): error C2466: cannot allocate an array of constant size 0 
windows.c(831): error C2133: 'username': unknown size 
windows.c(833): error C2065: 'UNLEN': undeclared identifier 
windows.c(988): error C2065: 'SHCNE_ASSOCCHANGED': undeclared identifier 
windows.c(988): error C2065: 'SHCNF_IDLIST': undeclared identifier 
windows.c(1002): error C2065: 'SHCNE_ASSOCCHANGED': undeclared identifier 
windows.c(1002): error C2065: 'SHCNF_IDLIST': undeclared identifier 

@IntelOrca any chance you can help out with any of that?

@IntelOrca
Copy link
Contributor

These will all be things that are not available in UWP, e.g. registry, common file dialogs etc. You will have to exclude those features from compilation until you find an alternative.

@janisozaur
Copy link
Member Author

Yeah, I know. I was hoping more of you could look into path resolution, as this will need to be implemented anyway. There are also some instances of lstrcpyW that might need changing to something else.

We can live without file deletion.

@IntelOrca
Copy link
Contributor

IntelOrca commented Nov 25, 2017

You would have to move to using Windows 10 API. When I looked into using the game bar API awhile ago, I found using these APIs a pain in C++ because they are built for .NET and therefore have to be accessed via COM mechanisms.

@IntelOrca
Copy link
Contributor

IntelOrca commented Nov 29, 2017

This is an example of how you might get files in C++:

auto folderPicker = ref new FolderPicker();
folderPicker->SuggestedStartLocation = PickerLocationId::DocumentsLibrary;
folderPicker->FileTypeFilter->Append("*");

create_task(folderPicker->PickSingleFolderAsync()).then(
    [](StorageFolder^ folder)
    {
        create_task(folder->GetFilesAsync()).then(
            [](IVectorView<StorageFile^>^ files)
            {
                for each (auto file in files)
                {
                    wprintf(L"%s\n", file->Path->Data());
                }
            });
    });

Access is granted to a folder when the user selects it via the folder picker.

Or in C#:

var folderPicker = new FolderPicker();
folderPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
folderPicker.FileTypeFilter.Add("*");
var folder = await folderPicker.PickSingleFolderAsync();
foreach (var file in await folder.GetFilesAsync())
{
    Console.WriteLine(file.Path);
}

@janisozaur
Copy link
Member Author

So far this has mostly concerned UWP builds, but it is possible to target desktop as well: http://pete.akeo.ie/2017/05/compiling-desktop-arm-applications-with.html

@janisozaur
Copy link
Member Author

With microsoft/vcpkg#2633 merged ask the libraries we use are capable of producing builds targeting UWP. The remaining work is in OpenRCT2 itself.

@janisozaur
Copy link
Member Author

vcpkg now supports arm-windows triplet (microsoft/vcpkg#2371) and there's no need to fully support UWP.

I haven't yet checked status of our required libraries when using this triplet.

@janisozaur
Copy link
Member Author

There were builds uploaded to https://github.com/janisozaur/arm64-binaries/tree/master/openrct2

@janisozaur
Copy link
Member Author

screenshot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Pertains to compilation, language standard, external dependencies. Windows (OS) Related to the Windows version of OpenRCT2.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants