Developing in the new Version of Microsoft Visual Studio
Hello! I'm new here.
I want to get into creating plugins using the DAZ SDK. I'm working on a Windows 64bit environment. I've downloaded the latest version of the SDK and installed the latest version of Microsoft Visual Studio 2022 Community, but now I see in the documentation that I needed Microsoft Visual Studio 2010. How critical is this? Can I still work in Microsoft Visual C++ 2022?

Comments
You can. I am.
The key thing is to set the correct options in CMake. I've just closed my computer down, but from memory I used the Visual Studio 14 (2015) generatoe with v100 set in the text field box below. I think it was called arguments or something. I can't remember if I downloaded the VS14 tools separately, if they are downloadable from within Visual Studio 22 installer or if they were already bundled, but rest assured it is possible. I wouldn't want to say it's easy, but it could be - a lot of my trials and tribulations were about figuring out what I needed to do rather than doing anything particularly complicated.
This is discussed in the documentation, ./docs/compile_win.html
More recently 2019 and 2022 have been used, but still compiling using the 2010 version.
Hello! I use VS 2015. Although I think the 2017 version is the best (just can’t leave my old reliable lady).
I think it's better to first try to compile the examples supplied with DAZ SDK. They are already configured correctly for Visual Studio. If you start with your own project, then it may not work due to the incorrect location of the SDK and moc compiler folders. It is also easy to make errors in the directives for creating moc files, etc. As a result, you will not find out the real reason why your project did not compile: an error in its creation or incompatibility of the SDK with the new version of Visual Studio.
How does one even get their hands on the Visual Studio 2010 Built Tools these days?
I can't seem to find them anywhere on the internet :)
Install
The new (old) toolset should then show up in VS.
Brilliant! Thanks!
I will give it a try now :)
I was able to get Visual Studio 2010 (v100) to show up as a Toolset option in Visual Studio 2022 however, when I try to compile with that toolset I'm getting a bunch of permision denied errors.
Has anyone encounted this problem?
We are told that DS has been developed in Visual C++ 6.0, and Visual Studio 2005, 2008, 2010, 2015, 2017, 2019 and 2022 - 2012 has not been used. The SDK refers to 2010 and 2017. Recent work has been done in 2017 and 2022, using the 2010 (v100) compiler for DS 4.x.x.x.
Calm down there big fella! I was just asking :)
I need VS 2022 for Unreal Engine development and getting 2022 and another (ancient) version of VS to happy coexist on the one machine is proving very challenging. I think I'm going to spin up a virtual machine for Daz plugin development.
We are told that Daz is careful to install 2010 and its service pack first, then the later versions - ideally, install all versions in ascending order of release to avoid the risks of path errors.
Thank you.
Yes, I'm struggling to get everything installed on Windows 11.
2010 complains about missing .net 4.6, which complains about missing Win 7 SDK. When I try to install .net 4.6 it says it, or a newer version, is already installed and won't proceed.
I'll keep bashing away at it though :)
I stopped using VS2019/2022 for some reason I can no longer remember. I currently use VS2017 however, just did a test compile of one of my plug-in projects using VS2022. Did not get any 'Can not open ...' errors. I did however get some other permission errors (e.g. create/find files).
To fix I just needed to give VS2022 permission to modify the appropreate folders (Windows Security/Ransomware protection).
Have not yet had time to check if the compiled dll runs without errors though.
If you install Visual Studio 2010 Professional or Ultimate, Windows 7 SDK (and dotnet framework) will be installed automatically.
Yes, that is solved by:
1) opening your "C:\Program Files\DAZ 3D\DAZStudio4 Public Build" and "C:\Program Files\DAZ 3D\DAZStudio4 Public Build/plugins" (or leave off the Public Build portion if need be) folders via Properties and going to the Security tab and editing the permissions for the two folders to have "Full Control" for the Users\ in the access control list, then when the build process tries to copy the sdk_*.dll files to your DAZ 3D install it can copy them to there, or remove them when you do a make clean.
1) Oops, my bad, I didn't enlarge your image and thought you were having trouble copying the linked plugin .dll into your DAZ Studio plugin folder. For the problem you have there I have seen in the past sed scripts and other build scripts actually create and/or edit header files depending on both the build environment and the target enviroment so maybe that is your problem there: those scripts are trying to edit those files and don't have permissions.
I do have a big question though, I can configure and build the Win32 version of the plugins no problem using the above links posted by OmniFlux and VS 2022 Community (or Visual Studio Express 2010), Windows 7.1 SDK, and CMake/CMake-GUI 3.17 but those are 32 bit plugins and I need 64 bit plugins and I have been unable to get CMake-GUI 3.17 to configure cmake files that correctly build for the Visual Studio 2010 x64 64 bit VC compiler/linker/libraries. Anyone have an suggestions? Is there a step by step set of instructions for getting CMake 3.17 or similar to configure the DAZ SDK for 64 bit plugin builds with Visual Studio 2022 Community or Visual Studio Professional 2015 (if I can find my key after a decade past now)? I may have too much Visual Studio 2010/Windows 7.1 SDK installed (I have what OmniFlux posts PLUS Visual Studio Express 2010 installed plus Windows Update did a couple of Service Packs and updates to that after I installed it).
OK, I think I'll just go buy a used copy of MS VS 2010 Professional but before I do I figured I'd ask here one more time:
I manually set the vsvarsamd64 file
As OmniFlux stated:
Install
I've done that and to test I try to compile and link the Windows 7.1 SDK Samples\begin\simple\simple.c console app and I get this error:
The kernel32.lib is actually missing in the VS 2010 lib\amd64 directory, I checked, but there is one present in the Windows 7.1 SDK lib\x64 directory, I checked. I guess though, contrary to my expectations these libraries are NOT the same libraries and so aren't interchangable and so I really do need to some how but a copy of MS Visual Studio 2010 Professional if I'm ever going to compile those dlls as 64-bit plugins.
As luck would have it, I have an old Microsoft Visual Studio 2010 Professional key so will just use that key but before I do, If someone would like to correct me on the above I'm all ears since it's said to work using that method as well.
I don't know about editing vsvarsamd64 as I launch everything from inside Visual Studio, but I can launch the "
Windows SDK 7.1 Command Prompt" shortcut, run "setenv /Release /xp", and all the environment variables are setup correctly.I prefer cmake to configure Visual Studio.
I can send you the basic configuration if you want.
OK, thanks. I will try the Windows SDK 7.1 Command Prompt to see it can compile the samples.
Yes, could you please? I am a UNIX guy and knoow nothing of all the Windows OS variables their different environments need. I am going to PM you my email address.
I already ordered the MS VS 2010 Professional DVD but lucky it only cost $15 since I have a key already.
OK, @MehdiZangenehBar, I got your response to my PM. I agree, could you post in the forums your working configuration for VS C++ 2010 x64(.i.e. amd64) architecture for the cmake setup so I can compile the DAZ Studio plugins as 64 bit? Thanks a lot.
Thanks, again, I tested it and it works fine. I will compare the Windows SDK 7.1 command prompt environment variables with what I was trying to setup yesterday.
OK, this is a very basic project that i build using Visual Studio Code.
Visual Studio 2010 Ultimate installed.
VSCode and it's C++ extensions installed.
CMake 3.24.4 installed, this is highest/last version that will support VS 2010.
please download entire project, open up the cmakelist.txt and change the SDK path to your installed SDK.
I am windows user, so I am not sure what you should change based on your operations system, so check the files one by one, specially c_cpp_properties and CMakeLists
So, if everything works , you can open folder using VSCode,There is a shellaunch file build.ps1, you can run .\build.ps1 command in powershell terminal in VSCode.
plugin will be build in Kodak folder in daz plugin folder/kodak/kodak.dll
then a kodak menu will be added to the daz menus. then you can run action from it.
note that if you build this way, no need to open Visual Studio editor at all. all can be done using VSCode
Thanks, the Visual Studio 2010 Professional DVD I ordered is shipping from eBay tooday so I'll be able to try you Basic Project soon. Thanks very much!
OK, some notes for next time what worked for me to build the DAZ Studio 4.5+ SDK:
I am running the newest Windows 11 plus patches and an AMD Ryzen 7 5700 CPU with 128GB RAM and a PNY GeForce RTX 4070 12GB GPU..
1) I installed all the toolkits and DAZ Studuo 4.5+ SDK as directed in the link to the instructions that Richard Haseltine gave above. The document will be found also in the SDK documentation, e.g. here is where my copy of the document is on my local hard drive, yours will by in the location you have installed the DAZ Studio 4.5+ SDK:
1) I ordered on eBay a 15 year old copy of Microsoft Visual Studio 2010 Professional for $15. It came from an MSDN Subscription DVD that the seller was parting out. The seller supplied no product key but I owned a product key myself so that wasn't important. However, I had forgotten that MSDN supplied Visual Studio and other products supplied on the MSDN subscription were made by Microsoft not to require a product key anyway so my product key wasn't needed to use Visual Studio 2010 Professional. That should inform you if you even need to buy an old EOL Microsoft product in the future and all you can find is the product on a CD or DVD being parted out of an old MSDN subscription. On first startup I configured Visual Studio 2010 Professional to use a setup best for C++ (rather than C# etc).
2) I installed the Windows 7.1 SDK and the patch for the VC++ 2020 x64 compiler linked to above by OmniFlux:
3) I allowed Windows 11 to update my system for the many patches required after a full install of the 15 year old MSDN Visual Studio 2010 Professional and rebooted.
4) I started the CMake 3.24 GUI and configured it to use the DAZ Studio 4.5+ SDK directory and build diirectory, plus I specified manually build to the x64 target withh the v100 flag in thhe CMake-gui. I generated. The I had to manually add the location of my DAZ Studio .EXE location for the build process to copy liinked programs and plugiins to the DAZ Studio plugins location so I can test them. You'll see that VARIABLE in the CMake GUI list of environment variables you eiither paste the correct path in or you can navigate to it with a File System browser. Then you tell CMake-GUI to generate the make files again. You will have to add permissiions for you as a Users\ in the Windows security space to be allowed full access (probably get by with less but I'm not worried) in your DAZ Studio EXE directory location. Newer versions of CMake than 3.24 are missing the option for Visual Studio 2010 compile chain.
5) OK, now you're ready to go. Open Visual Studio 2010, open a project and navigate to the DAZ Studio 4.5+ SDK build/x64 directory the DAZ Studio SDK build instructions had you create earlier. Open the .sdl file. The target should already be x64 but change from debug to release (debug is OK too, you are just getting this setup so you can edit your own plugins it you like) and then tell VS to build all. It does that and copies the plugins to the DAZ Studio EXE directory plugin.
6) Open DAZ Studio and go to About Installed Plugins and they should all be there and green. If they are not the build failed and didn't copy them there or the build succeeded and had no permissions to copy them there or both the build succeeded and it did copy them there but the plugins are red because they are Win32 instead of x64. Check and coorrect your cMake configration.
That's it.
I didn't bother trying to get the build process to work with VS 2022 Community or VS Code 2022 yet, but I think it will be relatively straight forward.
Thanks everyone for your help.