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

Add scripts for arm64 building #193

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

hwine
Copy link

@hwine hwine commented Aug 13, 2023

WIP

Also, ignore build_arm64 output
@hwine
Copy link
Author

hwine commented Aug 13, 2023

Current Status:

Build errors
update.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl wxHtmlWindow::SetHTMLBackgroundImage(class wxBitmap const &)" (?SetHTMLBackgroundImage@wxHtmlWindow@@UEAAXAEBVwxBitmap@@@Z) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
os\win-vind\build_arm64\src\win-vind.vcxproj]
..\..\libs\wxWidgets\lib\vc_arm64_lib\wxpng.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'ARM64' [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
..\..\libs\wxWidgets\lib\vc_arm64_lib\wxtiff.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'ARM64' [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
..\..\libs\wxWidgets\lib\vc_arm64_lib\wxjpeg.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'ARM64' [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
..\..\libs\wxWidgets\lib\vc_arm64_lib\wxzlib.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'ARM64' [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
..\..\libs\wxWidgets\lib\vc_arm64_lib\wxregexu.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'ARM64' [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
..\..\libs\wxWidgets\lib\vc_arm64_lib\wxexpat.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'ARM64' [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
C:\Users\hwine\repos\win-vind\build_arm64\Release\win-vind.exe : fatal error LNK1120: 569 unresolved externals [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]

tools/arm64-build-wxwidgets.bat Outdated Show resolved Hide resolved
if %errorlevel% neq 0 exit /b %errorlevel%
rem call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
rem if %errorlevel% neq 0 exit /b %errorlevel%
call "c:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat"
Copy link
Owner

@pit-ray pit-ray Aug 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VsDevCmd.bat builds 32bit x86-native by default, so you should use vsvarsamd64_arm64.bat to build arm64 code.

https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-160

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's what those docs say, but it's not what is on my machine.

Listing
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools> ls


    Directory: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        2023-04-21     13:27                1033
d-----        2023-04-21     13:26                devinit
d-----        2023-04-21     11:07                en
d-----        2023-04-21     11:07                vsdevcmd
-a----        2023-04-21     17:49          50592 errlook.exe
-a----        2023-04-21     17:49           7427 errlook.hlp
-a----        2023-04-21     17:49          36272 guidgen.exe
-a----        2023-04-21     17:48          20486 Launch-VsDevShell.ps1
-a----        2023-04-21     17:48            103 LaunchDevCmd.bat
-a----        2023-04-21     17:49          31152 makehm.exe
-a----        2023-04-21     17:48          35728 Microsoft.VisualStudio.DevShell.dll
-a----        2023-04-21     17:52         115559 spyxx.chm
-a----        2023-04-21     17:52         695208 spyxx.exe
-a----        2023-04-21     17:52         163200 spyxxhk.dll
-a----        2023-04-21     17:52         181136 spyxxhk_amd64.dll
-a----        2023-04-21     17:52         115559 spyxx_amd64.chm
-a----        2023-04-21     17:52         945080 spyxx_amd64.exe
-a----        2023-04-21     17:51         319384 vcconvertengine.dll
-a----        2023-04-21     17:51         369600 VCProjectConversion.dll
-a----        2023-04-21     17:48          11073 VsDevCmd.bat
-a----        2023-04-21     17:48            611 VsMSBuildCmd.bat


C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools>

FWIW since I'm no longer comfortable at a windows command line, I am doing this all from VS-Code. I'm running the batch files from a powershell-opened-in-vscode.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tried BuildTools edition of Visual Studio, not Community.
There are these various command line tools in the C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build, but the arm64 tool does not exist.
Even worse, I cannot find the arm64 option for the BuildTools edition in the Visual Studio Installer.

However, if you install Visual Studio 2019 Comminy rather than BuildTools, these command files are available in the C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build.
The arm compiler is not install as default, you should enable MSVC v 142 - VS 2019 C++ ARM64 Build tool of Desktop development with C++ in Visual Studio Installer.

@@ -0,0 +1,8 @@
@REM from https://github.com/pit-ray/win-vind/issues/191#issuecomment-1671656805

call "c:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\VsDevCmd.bat"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the environment is automatically selected within cmake, there is no need to call VsDevCmd.bat here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cmake isn't in my path until I make that call. As noted above, I'm using VSCode.

Should I try this from VS-Studio (community version)? Will this call cause problems?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you call VsDevCmd.cmd, the paths of installed extensions into the Visual Studio are loaded.
We assume that the cmake is installed independently from Visual Studio, so you do not need to call the VsDevCmd.bat and need to install cmake independently.

You can install cmake in various ways, such as winget, Chocolatey, installer, and so on.
Please see also https://github.com/pit-ray/win-vind/blob/master/CONTRIBUTING.md#softwares .

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay - this is getting a bit complex to just try out the app. 😭 Let me spend some time on the x86 machine to see if win-vind will work for me, before I try to turn my machine into a dev box.

That'll take a while (probably a month with everything else going on). Thanks for your help.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Please feel free to message me.

@pit-ray
Copy link
Owner

pit-ray commented Aug 15, 2023

@hwine
Thanks for the great pull request.
I added some reviews to your codes.

Tweaked a few things, and down to one linker error concerning a missing
wxmsw31u_html.lib
@hwine
Copy link
Author

hwine commented Aug 15, 2023

FWIW - I got rid of a lot of the linker errors by following report here and disabling unicode. That just leaves a linker error for the unicode dependent widget you use: wxmsw31u_html.lib.

There was another change I made regarding linking libraries, so I'm going to rebuild with unicode enabled.

Stay tuned :D

@hwine
Copy link
Author

hwine commented Aug 16, 2023

Okay - if I build wxWidgets with Unicode support, I get all the ugly "wrong machine type" linker errors, in addition to "unresolved external symbol". This feels like a wxWidgets build issue, but it's beyond me.

(error messages)

update.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl wxScrollHelper::DoShowScrollbars(enum wxScrollbarVisibility,enum wxScrollbarVisibility)" (?DoShowScrollbars@wxScrollHelper@@MEAAXW4wxScrollbarVisibility@@0@Z) [C:\Users\hwine\repos\win-vi 
nd\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2019: unresolved external symbol "public: static class wxSize __cdecl wxScrolledT_Helper::FilterBestSize(class wxWindow const *,class wxScrollHelper const *,class wxSize const &)" (?FilterBestSize@wxScrolledT_Helper@@SA?AVwxSize@@PEBVwxWindow@@PEBVwxScr 
ollHelper@@AEBV2@@Z) referenced in function "protected: virtual class wxSize __cdecl wxScrolled<class wxPanel>::DoGetBestSize(void)const " (?DoGetBestSize@?$wxScrolled@VwxPanel@@@@MEBA?AVwxSize@@XZ) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2019: unresolved external symbol "public: static __int64 __cdecl wxScrolledT_Helper::FilterMSWWindowProc(unsigned int,__int64)" (?FilterMSWWindowProc@wxScrolledT_Helper@@SA_JI_J@Z) referenced in function "public: virtual __int64 __cdecl wxScrolled<class 
 wxPanel>::MSWWindowProc(unsigned int,unsigned __int64,__int64)" (?MSWWindowProc@?$wxScrolled@VwxPanel@@@@UEAA_JI_K_J@Z) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2001: unresolved external symbol "public: virtual class wxClassInfo * __cdecl wxScrolledWindow::GetClassInfo(void)const " (?GetClassInfo@wxScrolledWindow@@UEBAPEAVwxClassInfo@@XZ) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2001: unresolved external symbol "public: virtual class wxClassInfo * __cdecl wxHtmlFilter::GetClassInfo(void)const " (?GetClassInfo@wxHtmlFilter@@UEBAPEAVwxClassInfo@@XZ) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2001: unresolved external symbol "public: virtual class wxClassInfo * __cdecl wxHtmlFilterPlainText::GetClassInfo(void)const " (?GetClassInfo@wxHtmlFilterPlainText@@UEBAPEAVwxClassInfo@@XZ) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj 
]
update.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl wxHtmlFilterPlainText::CanRead(class wxFSFile const &)const " (?CanRead@wxHtmlFilterPlainText@@UEBA_NAEBVwxFSFile@@@Z) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2001: unresolved external symbol "public: virtual class wxString __cdecl wxHtmlFilterPlainText::ReadFile(class wxFSFile const &)const " (?ReadFile@wxHtmlFilterPlainText@@UEBA?AVwxString@@AEBVwxFSFile@@@Z) [C:\Users\hwine\repos\win-vind\build_arm64\src\w 
in-vind.vcxproj]
update.obj : error LNK2019: unresolved external symbol "protected: __cdecl wxHtmlWindowMouseHelper::wxHtmlWindowMouseHelper(class wxHtmlWindowInterface *)" (??0wxHtmlWindowMouseHelper@@IEAA@PEAVwxHtmlWindowInterface@@@Z) referenced in function "public: __cdecl wxHtmlWindow:: 
wxHtmlWindow(class wxWindow *,int,class wxPoint const &,class wxSize const &,long,class wxString const &)" (??0wxHtmlWindow@@QEAA@PEAVwxWindow@@HAEBVwxPoint@@AEBVwxSize@@JAEBVwxString@@@Z) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl wxHtmlWindowMouseHelper::OnCellMouseHover(class wxHtmlCell *,int,int)" (?OnCellMouseHover@wxHtmlWindowMouseHelper@@MEAAXPEAVwxHtmlCell@@HH@Z) [C:\Users\hwine\repos\win-vind\build_arm64\sr 
c\win-vind.vcxproj]
update.obj : error LNK2001: unresolved external symbol "protected: virtual bool __cdecl wxHtmlWindowMouseHelper::OnCellClicked(class wxHtmlCell *,int,int,class wxMouseEvent const &)" (?OnCellClicked@wxHtmlWindowMouseHelper@@MEAA_NPEAVwxHtmlCell@@HHAEBVwxMouseEvent@@@Z) [C:\U 
sers\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2001: unresolved external symbol "public: virtual class wxClassInfo * __cdecl wxHtmlWindow::GetClassInfo(void)const " (?GetClassInfo@wxHtmlWindow@@UEBAPEAVwxClassInfo@@XZ) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2019: unresolved external symbol "public: virtual __cdecl wxHtmlWindow::~wxHtmlWindow(void)" (??1wxHtmlWindow@@UEAA@XZ) referenced in function "public: virtual void * __cdecl wxHtmlWindow::`scalar deleting destructor'(unsigned int)" (??_GwxHtmlWindow@@U 
EAAPEAXI@Z) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2019: unresolved external symbol "public: bool __cdecl wxHtmlWindow::Create(class wxWindow *,int,class wxPoint const &,class wxSize const &,long,class wxString const &)" (?Create@wxHtmlWindow@@QEAA_NPEAVwxWindow@@HAEBVwxPoint@@AEBVwxSize@@JAEBVwxString@ 
@@Z) referenced in function "public: __cdecl wxHtmlWindow::wxHtmlWindow(class wxWindow *,int,class wxPoint const &,class wxSize const &,long,class wxString const &)" (??0wxHtmlWindow@@QEAA@PEAVwxWindow@@HAEBVwxPoint@@AEBVwxSize@@JAEBVwxString@@@Z) [C:\Users\hwine\repos\win-v 
ind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl wxHtmlWindow::SetPage(class wxString const &)" (?SetPage@wxHtmlWindow@@UEAA_NAEBVwxString@@@Z) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl wxHtmlWindow::LoadPage(class wxString const &)" (?LoadPage@wxHtmlWindow@@UEAA_NAEBVwxString@@@Z) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2019: unresolved external symbol "public: void __cdecl wxHtmlWindow::SetStandardFonts(int,class wxString const &,class wxString const &)" (?SetStandardFonts@wxHtmlWindow@@QEAAXHAEBVwxString@@0@Z) referenced in function "public: __cdecl vind::gui::Update 
Dialog::UpdateDialog(class wxWindow *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0UpdateDialog@gui@vind@@QEAA@PEAVwxW 
indow@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H1@Z) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl wxHtmlWindow::ReadCustomization(class wxConfigBase *,class wxString)" (?ReadCustomization@wxHtmlWindow@@UEAAXPEAVwxConfigBase@@VwxString@@@Z) [C:\Users\hwine\repos\win-vind\build_arm64\src\w 
in-vind.vcxproj]
update.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl wxHtmlWindow::WriteCustomization(class wxConfigBase *,class wxString)" (?WriteCustomization@wxHtmlWindow@@UEAAXPEAVwxConfigBase@@VwxString@@@Z) [C:\Users\hwine\repos\win-vind\build_arm64\src 
\win-vind.vcxproj]
update.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl wxHtmlWindow::OnSetTitle(class wxString const &)" (?OnSetTitle@wxHtmlWindow@@UEAAXAEBVwxString@@@Z) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl wxHtmlWindow::OnLinkClicked(class wxHtmlLinkInfo const &)" (?OnLinkClicked@wxHtmlWindow@@UEAAXAEBVwxHtmlLinkInfo@@@Z) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl wxHtmlWindow::OnInternalIdle(void)" (?OnInternalIdle@wxHtmlWindow@@UEAAXXZ) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2019: unresolved external symbol "protected: void __cdecl wxHtmlWindow::Init(void)" (?Init@wxHtmlWindow@@IEAAXXZ) referenced in function "public: __cdecl wxHtmlWindow::wxHtmlWindow(class wxWindow *,int,class wxPoint const &,class wxSize const &,long,cla 
ss wxString const &)" (??0wxHtmlWindow@@QEAA@PEAVwxWindow@@HAEBVwxPoint@@AEBVwxSize@@JAEBVwxString@@@Z) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl wxHtmlWindow::SetHTMLWindowTitle(class wxString const &)" (?SetHTMLWindowTitle@wxHtmlWindow@@UEAAXAEBVwxString@@@Z) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl wxHtmlWindow::OnHTMLLinkClicked(class wxHtmlLinkInfo const &)" (?OnHTMLLinkClicked@wxHtmlWindow@@UEAAXAEBVwxHtmlLinkInfo@@@Z) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj] 
update.obj : error LNK2001: unresolved external symbol "public: virtual enum wxHtmlOpeningStatus __cdecl wxHtmlWindow::OnHTMLOpeningURL(enum wxHtmlURLType,class wxString const &,class wxString *)const " (?OnHTMLOpeningURL@wxHtmlWindow@@UEBA?AW4wxHtmlOpeningStatus@@W4wxHtmlUR 
LType@@AEBVwxString@@PEAV4@@Z) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2001: unresolved external symbol "public: virtual class wxPoint __cdecl wxHtmlWindow::HTMLCoordsToWindow(class wxHtmlCell *,class wxPoint const &)const " (?HTMLCoordsToWindow@wxHtmlWindow@@UEBA?AVwxPoint@@PEAVwxHtmlCell@@AEBV2@@Z) [C:\Users\hwine\repos\ 
win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2001: unresolved external symbol "public: virtual class wxWindow * __cdecl wxHtmlWindow::GetHTMLWindow(void)" (?GetHTMLWindow@wxHtmlWindow@@UEAAPEAVwxWindow@@XZ) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2001: unresolved external symbol "public: virtual class wxColour __cdecl wxHtmlWindow::GetHTMLBackgroundColour(void)const " (?GetHTMLBackgroundColour@wxHtmlWindow@@UEBA?AVwxColour@@XZ) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]     
update.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl wxHtmlWindow::SetHTMLBackgroundColour(class wxColour const &)" (?SetHTMLBackgroundColour@wxHtmlWindow@@UEAAXAEBVwxColour@@@Z) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj] 
update.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl wxHtmlWindow::SetHTMLBackgroundImage(class wxBitmap const &)" (?SetHTMLBackgroundImage@wxHtmlWindow@@UEAAXAEBVwxBitmap@@@Z) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]   
update.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl wxHtmlWindow::SetHTMLStatusText(class wxString const &)" (?SetHTMLStatusText@wxHtmlWindow@@UEAAXAEBVwxString@@@Z) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2001: unresolved external symbol "public: virtual class wxCursor __cdecl wxHtmlWindow::GetHTMLCursor(enum wxHtmlWindowInterface::HTMLCursor)const " (?GetHTMLCursor@wxHtmlWindow@@UEBA?AVwxCursor@@W4HTMLCursor@wxHtmlWindowInterface@@@Z) [C:\Users\hwine\re 
pos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2001: unresolved external symbol "protected: virtual struct wxEventTable const * __cdecl wxHtmlWindow::GetEventTable(void)const " (?GetEventTable@wxHtmlWindow@@MEBAPEBUwxEventTable@@XZ) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]    
update.obj : error LNK2001: unresolved external symbol "protected: virtual class wxEventHashTable & __cdecl wxHtmlWindow::GetEventHashTable(void)const " (?GetEventHashTable@wxHtmlWindow@@MEBAAEAVwxEventHashTable@@XZ) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vc 
xproj]
update.obj : error LNK2019: unresolved external symbol "protected: void __cdecl wxSizerItem::DoSetSizer(class wxSizer *)" (?DoSetSizer@wxSizerItem@@IEAAXPEAVwxSizer@@@Z) referenced in function "public: __cdecl vind::gui::UpdateDialog::UpdateDialog(class wxWindow *,class std:
:basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0UpdateDialog@gui@vind@@QEAA@PEAVwxWindow@@AEBV?$basic_string@DU?$char_traits@D@std@ 
@V?$allocator@D@2@@std@@H1@Z) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2019: unresolved external symbol "class wxEventTypeTag<class wxFocusEvent> const wxEVT_SET_FOCUS" (?wxEVT_SET_FOCUS@@3V?$wxEventTypeTag@VwxFocusEvent@@@@B) referenced in function "public: __cdecl wxNavigationEnabled<class wxWindow>::wxNavigationEnabled< 
class wxWindow>(void)" (??0?$wxNavigationEnabled@VwxWindow@@@@QEAA@XZ) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2019: unresolved external symbol "class wxEventTypeTag<class wxChildFocusEvent> const wxEVT_CHILD_FOCUS" (?wxEVT_CHILD_FOCUS@@3V?$wxEventTypeTag@VwxChildFocusEvent@@@@B) referenced in function "public: __cdecl wxNavigationEnabled<class wxWindow>::wxNavi 
gationEnabled<class wxWindow>(void)" (??0?$wxNavigationEnabled@VwxWindow@@@@QEAA@XZ) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2019: unresolved external symbol "class wxEventTypeTag<class wxNavigationKeyEvent> const wxEVT_NAVIGATION_KEY" (?wxEVT_NAVIGATION_KEY@@3V?$wxEventTypeTag@VwxNavigationKeyEvent@@@@B) referenced in function "public: __cdecl wxNavigationEnabled<class wxWin 
dow>::wxNavigationEnabled<class wxWindow>(void)" (??0?$wxNavigationEnabled@VwxWindow@@@@QEAA@XZ) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
update.obj : error LNK2019: unresolved external symbol "class wxEventTypeTag<class wxHtmlLinkEvent> const wxEVT_HTML_LINK_CLICKED" (?wxEVT_HTML_LINK_CLICKED@@3V?$wxEventTypeTag@VwxHtmlLinkEvent@@@@B) referenced in function "public: __cdecl vind::gui::UpdateDialog::UpdateDial 
og(class wxWindow *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0UpdateDialog@gui@vind@@QEAA@PEAVwxWindow@@AEBV?$basic 
_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H1@Z) [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
..\..\libs\wxWidgets\lib\vc_arm64_lib\wxmsw31u_html.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'ARM64' [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
..\..\libs\wxWidgets\lib\vc_arm64_lib\wxmsw31u_adv.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'ARM64' [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
..\..\libs\wxWidgets\lib\vc_arm64_lib\wxmsw31u_core.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'ARM64' [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
..\..\libs\wxWidgets\lib\vc_arm64_lib\wxbase31u.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'ARM64' [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
..\..\libs\wxWidgets\lib\vc_arm64_lib\wxpng.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'ARM64' [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
..\..\libs\wxWidgets\lib\vc_arm64_lib\wxtiff.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'ARM64' [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
..\..\libs\wxWidgets\lib\vc_arm64_lib\wxjpeg.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'ARM64' [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
..\..\libs\wxWidgets\lib\vc_arm64_lib\wxzlib.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'ARM64' [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
..\..\libs\wxWidgets\lib\vc_arm64_lib\wxregexu.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'ARM64' [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
..\..\libs\wxWidgets\lib\vc_arm64_lib\wxexpat.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'ARM64' [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
C:\Users\hwine\repos\win-vind\build_arm64\Release\win-vind.exe : fatal error LNK1120: 569 unresolved externals [C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.vcxproj]
C:\Users\hwine\repos\win-vind [arm64-build+0 ~2 -0 !]> 

x86 apps usually run fine on arm64 -- I'm assuming win-vind has to do something pretty low level that's causing the x86 version not to work. In this day and age, doing away with unicode support is kind of a non-starter.

I'll poke around for a wxWidgets solution, but I've gotta move this to the back burner for now. ☹️

@hwine
Copy link
Author

hwine commented Aug 16, 2023

Interesting, confirmed that when compiling wxWidgets x86 is always generated:

Unicode disabled
C:\Users\hwine\repos\win-vind\libs\wxWidgets\lib\vc_arm64_lib>dumpbin wxmsw31_adv.lib /headers  
Microsoft (R) COFF/PE Dumper Version 14.29.30148.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file wxmsw31_adv.lib

File Type: LIBRARY

FILE HEADER VALUES
             14C machine (x86)
              2C number of sections
        64DCE1E9 time date stamp Wed Aug 16 07:49:13 2023
           6F941 file pointer to symbol table
              7C number of symbols
               0 size of optional header
               0 characteristics
Unicode enabled
C:\Users\hwine\repos\win-vind\libs\wxWidgets\lib\vc_arm64_lib>dumpbin wxmsw31u_adv.lib /headers
Microsoft (R) COFF/PE Dumper Version 14.29.30148.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file wxmsw31u_adv.lib

File Type: LIBRARY

FILE HEADER VALUES
             14C machine (x86)
              2C number of sections
        64DBD324 time date stamp Tue Aug 15 12:33:56 2023
           6F96E file pointer to symbol table
              7C number of symbols
               0 size of optional header
               0 characteristics

As expected win-vind code is being compiled to ARM64

unicode.cpp
C:\Users\hwine\repos\win-vind\build_arm64\src\win-vind.dir\Release>dumpbin /headers unicode.obj 
Microsoft (R) COFF/PE Dumper Version 14.29.30148.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file unicode.obj

File Type: COFF OBJECT

FILE HEADER VALUES
            AA64 machine (ARM64)
              81 number of sections
        64DCF7CC time date stamp Wed Aug 16 09:22:36 2023
            5524 file pointer to symbol table
             20B number of symbols
               0 size of optional header
               0 characteristics

According to this article that shouldn't be a problem, so I'm puzzled. Ahh, but win-vind identifies as ARM64, not the ARM64X mentioned in the article. The "Arm64EC tools" may require VS 2022 per these prerequisites.

@pit-ray I don't know these development tool chains well enough to proceed at this point. It's unclear to me if the Arm64EC tools are available for VS 2019, or even how I'd install them. (I assume moving to VS 2022 drops support for some older platforms you want to continue supporting.) Your guidance appreciated. 😄

@pit-ray
Copy link
Owner

pit-ray commented Aug 19, 2023

@hwine

As indicated in the following URLs, it appears that Visual Studio 2022 v17.4 must be used to native compile with Arm. Otherwise, it seems to be cross-compiled.

However, in general, it should be possible to build with cross-compilation, but, for some reason, the cross-compiled win-vind does not work.

I think you can just use VsDevCmd.bat in the Arm64 version of Visual Studio, but I can't verify this (since I don't have an Arm computer).
In cmake you must change the options to -G "Visual Studio 17 2022" by the -G option.


@REM nmake /f makefile.vc BUILD=release SHARED=0 UNICODE=1 TARGET_CPU=ARM64 RUNTIME_LIBS=static
@REM from https://www.andregarzia.com/2019/12/wxwidgets-works-under-windows-on-arm.html try without unicode
nmake /f makefile.vc BUILD=release SHARED=0 UNICODE=0 TARGET_CPU=ARM64 RUNTIME_LIBS=static
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to support unicode as much as possible, as it is undesirable nowadays not to have unicode support.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I definitely agree -- I tried that purely as a data point, based on that other article. It didn't solve the problem anyway ☹️

@pit-ray pit-ray added enhancement New feature or request accepted Requirement understood and waiting implementation. labels Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Requirement understood and waiting implementation. enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants