Zemax has the wonderful ability to add user-defined surfaces and objects, but they have to be compiled by the user into a dll. With the Community version of Visual Studio 2019, does anybody know (a) which components of Visual Studio need to be installed, (b) what settings are needed in order to “Attach to Process…” in order to debug, and (c) what settings are needed to compile routines correctly.
The background here is that the user has to look through a set of examples to work out how to do anything, and these are mostly in C, probably from 20 years ago. There are 2 very useful articles about how to compile a dll, and debug a dll, but they are for C++, with no explanation about when and why C++ is needed. Some VS2017 compiler settings are given, but a lot of others are not mentioned, and there is no information about how to install Visual Studio. The ability to debug a file is phenomenal, but they do not attach with VS2017 and VS2019, and there is a message that “A Development License is required…”. What are the installation requirements, and the settings, in order to debug in the recent VS versions? Separately, and a reason for needing debugging to work, some code that worked with one type of surface did not work with another type. Ultimately the problem went away when the code was converted to C++ and optional 'C++ (v141 and v142) Universal Windows Platform tools' were added to VS19 (though this did not fix the problem with debugging). This is all very muddled, with code that compiles correctly in C in one situation not working in another, but changing it to C++ and compiling it with special C++ tools seeming to fix the problem. This took an enormous amount of time. The answers to the 3 questions above should help in the future (though even converting from C to C++ is a pain, and perhaps the wording changes that are needed across the set of C files can be clearly summarized somewhere).