GENERAL HOW TO

What target bit setting should I use to compile ZOS-API extensions?

Relating to: Programming ZOS

OpticStudio run as 64-bit applications on Windows machines. When users compile their own custom executables as user extensions or user analyses via the ZOS-API, there is the potential that these applications can run as 32-bit. This can result in a mismatch between OpticStudio (64-bit) and the 32-bit extension which causes the plug-in to fail (see Trouble Running OpticStudio User Extensions and Analyses | Zemax Community for more details). We recommend that you always compile targeting the 64-bit platform, unless there is a specific reason that your code must be compiled as 32-bit.

Important: This is not the default setting if you are using an IDE like Visual Studio.

In Microsoft Visual Studio, you can change this setting in the Project Properties on the Build tab, shown below. Make sure that all Configurations are updated (Debug and Release).