I am fairly new to windows development I come from a macOS, Unix background. On macOS Apple requires 64bit and most development tools give no option for 32bit.
It looks like win supports 64bit, so is there any reason why development on a Win PC should be built-in 32bit mode? Looks like you have to specifically select 64 bit vs 64 bit as default build.
Not sure if I am missing something here.
Second question; is there any reason to use DLL over static or vice versa. I know static will increase the size of the exe, but other than that is there any good reason to choose one over the other.
Thanks.
Windows 32bit or 64bit - static vs dynamic
-
- Earned a small fee
- Posts: 23
- Joined: Wed Mar 06, 2019 10:33 pm
Re: Windows 32bit or 64bit - static vs dynamic
I personally ship only 32bit versions of my Windows applications, because...
a) There are still 32bit Windows versions out there and having a 32 and 64bit version of an app is just more work maintaining.
b) 64bit applications have no real advantage over 32bit unless your app needs to access more than 2GB RAM or if it's performance critical *and* benefits from 64bit code.
While 64bit code is a little faster because it can utilize more CPU registers, it's also about 30% bigger, so part of that advantage is eaten up by more frequent cache misses.
As for static vs dynamic. There is hardly any reason to use dynamic linking. I even link the CRT statically in order to get an executable that is free from any external dependencies.
The only situation where i would use dynamic linking is if the application used external plugins which depend on wxWidgets, too.
a) There are still 32bit Windows versions out there and having a 32 and 64bit version of an app is just more work maintaining.
b) 64bit applications have no real advantage over 32bit unless your app needs to access more than 2GB RAM or if it's performance critical *and* benefits from 64bit code.
While 64bit code is a little faster because it can utilize more CPU registers, it's also about 30% bigger, so part of that advantage is eaten up by more frequent cache misses.
As for static vs dynamic. There is hardly any reason to use dynamic linking. I even link the CRT statically in order to get an executable that is free from any external dependencies.
The only situation where i would use dynamic linking is if the application used external plugins which depend on wxWidgets, too.
Use the source, Luke!
-
- Earned a small fee
- Posts: 23
- Joined: Wed Mar 06, 2019 10:33 pm
Re: Windows 32bit or 64bit - static vs dynamic
Thank you doublemax for the input and direction, I will proceed with all of your recommendations.