.dll Question Compiling with maximum compability in VS2019

asbjos

tuanibrO
Addon Developer
Joined
Jun 22, 2011
Messages
696
Reaction score
259
Points
78
Location
This place called "home".
Hello, users have reported trouble with running my MFD's, a problem which is fixed if I compile with VS2015 instead of VS2019.

Of course, it's not a big deal to compile with VS2015. But as I personally use VS2019 for coding, it would be a benefit if it exported compatible files itself.
Is there a way to make my VS2019-made dll's compatible by changing a setting in VS2019?

For reference, here are my current project properties: https://www.orbiter-forum.com/media/albums/vs2019-project-properties.1160/
 

GLS

Well-known member
Orbiter Contributor
Addon Developer
Joined
Mar 22, 2008
Messages
5,878
Reaction score
2,870
Points
188
Website
github.com
The problems come from the runtime libraries used in the addon not being in the users PC. You can add a requirement to your addon stating that "Redistributable xyz" (xyz = whatever version you compiled, usually a year I think) needs to be installed. Or you can change the project settings to include all those static libraries: C/C++ >> Code Generation >> Runtime Library >> MT (or MTd for debug). This will make you addon larger.
Which option is better has been the topic of many debates, but for what it's worth, I prefer the first option.

Other than that, to compile with CPU instructions that even a very old CPU would have: C/C++ >> Code Generation >> Enable Enhanced Instruction Set >> SSE.
This would loose a bit of performance (probably nothing or too small to care), but it would mean that you could use a 1990s PC. :ROFLMAO: VS2017 defaults to SSE2, so that should already cover the last 20 years. AVX should probably cover the last 10 years. Anyway you probably don't need to change this unless really needed (for compatibility or performance).
 
Top