Page 1 of 1

Windows 32bit or 64bit - static vs dynamic

Posted: Thu Jul 18, 2019 10:09 am
by BobsTheDude
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.

Re: Windows 32bit or 64bit - static vs dynamic

Posted: Thu Jul 18, 2019 10:23 am
by doublemax
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.

Re: Windows 32bit or 64bit - static vs dynamic

Posted: Thu Jul 18, 2019 10:53 am
by BobsTheDude
Thank you doublemax for the input and direction, I will proceed with all of your recommendations.