Errors from 2022 SDK files

Errors from 2022 SDK files

tboggsKFHNT
Explorer Explorer
1,986 Views
5 Replies
Message 1 of 6

Errors from 2022 SDK files

tboggsKFHNT
Explorer
Explorer

Hi everyone.  So I'm using vs 2019 for compiling my plugin.  I've created my plugin so that I have multiple versions that work for 3ds max 2019, 2020, 2021.  I have downloaded the 2022 SDK and have specified throughout my code for functions that have been updated from 2021 to 2022 and so on.  My code compiles and builds for the 2021 version.  However, I am receiving errors from the maxtypes.h and matrix3.h header files when building the 2022 version.  VS is telling me:

 

  • illegal statement or sub-expression for constexpr in the TimeToTicksSec function of the maxtypes.h file
  • 'a' and 'b' cannot be modified because it is being accessed through a const object for the SetPartA and SetPartB functions of the maxtypes.h file
  • 'return': cannot convert from 'const Class_ID to 'Class_ID &' for the Class_ID = operator in the maxtypes.h file
  • attribute 'decprecated("Matrix3 and DMatrix3 are now initialized to identity by default

I understand the last one means that the Matrix3(BOOL) constructor doesn't need to be used.  However, I am unsure of how to silence this warning as described in the header file.

 

Where these errors coming from in my code?  What is making them appear?  Please help.

 

I cannot show my code as the code itself is confidential.

0 Likes
1,987 Views
5 Replies
Replies (5)
Message 2 of 6

klvnk
Collaborator
Collaborator

just edit the max headers

0 Likes
Message 3 of 6

tboggsKFHNT
Explorer
Explorer

While this would work to fix the issue on my end.  This would not solve fixing the issue for the entire team and future development.

0 Likes
Message 4 of 6

klvnk
Collaborator
Collaborator

guess your going to need to read up on constexpr then.

0 Likes
Message 5 of 6

tboggsKFHNT
Explorer
Explorer

I understand constexpr.  My issue is that I never explicitly call the TimeToTicksSec() function so I'm unsure where the function is being called from.  Is there a resource that shows all of the functions/classes/objects that call TimeToTicksSec()?

0 Likes
Message 6 of 6

eric.brosseau
Autodesk
Autodesk

Hi @tboggsKFHNT ,

Compiling a plugin for different versions of 3ds Max and using different versions of the VS toolset can bring a lot of issues. I concur.

 

I suspect that even though you are using VS 2019, that you might be not using the appropriate compiler.

 

Make sure you are using the proper toolset and 3ds Max SDK version when building your plugin for a given 3ds Max version. For each of the 3ds Max SDK, there are a WindowsTargetPlatformVersion and PlatformToolset properties in the Max SDK from file maxsdk\ProjectSettings\propertySheets\3dsmax.general.project.settings.props which creates the proper build environment, specific to the targeted 3ds Max version. It needs to be taken into account when compiling a plugin. In fact, the specific props file should be included in your VS project (vcxproj) and make sure the SDK source is the one for the targeted 3ds Max version.

 

However, this will not resolve all the problems you have. You might also have to adapt you code to changes we have made to the 3ds Max SDK (const references or deprecated methods).

 

I hope it helps. You should not have to tweak the SDK to solve part of the problems you are going thru.

 

Eric Brosseau
Senior Software Developer, 3ds Max, Autodesk