Compiling Maya 2020 C++ Plugin with Visual Studio 15 Confusing Build Errors

173 views
Skip to first unread message

Alex Gaidachev

unread,
Feb 4, 2020, 2:44:23 AM2/4/20
to Python Programming for Autodesk Maya
Okay this one is a tad confusing for me because I set the environment settings right to compile Maya 2020 Plugins using the 2020Devkit and built the project and right off the bat, it starts to complain:

1>------ Build started: Project: smoothWeights, Configuration: Debug x64 ------
1>smoothWeightsTool.cpp
1>d:\installed programs\autodesk\maya2020\include\maya\mboundingbox.h(53): warning C4003: not enough arguments for function-like macro invocation 'min'
1>d:\installed programs\autodesk\maya2020\include\maya\mboundingbox.h(53): error C2059: syntax error: ')'
1>d:\installed programs\autodesk\maya2020\include\maya\mboundingbox.h(53): error C2334: unexpected token(s) preceding ':'; skipping apparent function body
1>d:\installed programs\autodesk\maya2020\include\maya\mboundingbox.h(54): warning C4003: not enough arguments for function-like macro invocation 'max'
1>d:\installed programs\autodesk\maya2020\include\maya\mboundingbox.h(64): error C2143: syntax error: missing ')' before ';'
1>d:\installed programs\autodesk\maya2020\include\maya\mboundingbox.h(64): error C2059: syntax error: ')'
1>d:\installed programs\autodesk\maya2020\include\maya\mboundingbox.h(64): error C2238: unexpected token(s) preceding ';'
1>d:\installed programs\autodesk\maya2020\include\maya\mboundingbox.h(66): error C2059: syntax error: '}'
1>d:\installed programs\autodesk\maya2020\include\maya\mboundingbox.h(66): error C2143: syntax error: missing ';' before '}'
...
...
1>d:\installed programs\autodesk\maya2020\include\maya\mplugarray.h(73): error C3646: 'begin': unknown override specifier
1>d:\installed programs\autodesk\maya2020\include\maya\mplugarray.h(73): error C2059: syntax error: '('
1>d:\installed programs\autodesk\maya2020\include\maya\mplugarray.h(73): error C2238: unexpected token(s) preceding ';'
1>d:\installed programs\autodesk\maya2020\include\maya\mplugarray.h(74): error C3646: 'end': unknown override specifier
1>d:\installed programs\autodesk\maya2020\include\maya\mplugarray.h(74): error C2059: syntax error: '('
1>d:\installed programs\autodesk\maya2020\include\maya\mplugarray.h(74): error C2238: unexpected token(s) preceding ';'
1>d:\installed programs\autodesk\maya2020\include\maya\mplugarray.h(76): error C3646: 'begin': unknown override specifier

..
..

1>d:\installed programs\autodesk\maya2020\include\maya\mfloatvectorarray.h(87): error C2059: syntax error: '('
1>d:\installed programs\autodesk\maya2020\include\maya\mfloatvectorarray.h(87): error C2238: unexpected token(s) preceding ';'
1>d:\installed programs\autodesk\maya2020\include\maya\mfloatvectorarray.h(88): error C3646: 'cend': unknown override specifier
1>d:\installed programs\autodesk\maya2020\include\maya\mfloatvectorarray.h(88): error C2059: syntax error: '('
1>d:\installed programs\autodesk\maya2020\include\maya\mfloatvectorarray.h(88): error C2238: unexpected token(s) preceding ';'
1>d:\installed programs\autodesk\maya2020\include\maya\mpointarray.h(37): error C2143: syntax error: missing ';' before '<'
1>d:\installed programs\autodesk\maya2020\include\maya\mpointarray.h(37): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\installed programs\autodesk\maya2020\include\maya\mpointarray.h(37): error C2238: unexpected token(s) preceding ';'
1>d:\installed programs\autodesk\maya2020\include\maya\mpointarray.h(38): error C2143: syntax error: missing ';' before '<'

It's complaining about Autodesk Maya's 2020 header files. What the heck is going on here?

Justin Israel

unread,
Feb 4, 2020, 12:21:28 PM2/4/20
to python_in...@googlegroups.com
It may be having trouble parsing a macro definition in that header which could then mess up parsing for the rest of the file. Are you using the right compiler version for Maya 2020? If the compiler is too old then it may not support modern syntax used in the header. I don't do windows compiling so I don't know what VS compiler version that would be, or if I am even correct in my guess. 

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/af573e6f-507b-4eea-8f15-b3a645723f65%40googlegroups.com.

Alex Gaidachev

unread,
Feb 5, 2020, 6:56:19 PM2/5/20
to Python Programming for Autodesk Maya
Hi Justin,

Thank you for your response. I've done some research, and judging from this website link here: https://around-the-corner.typepad.com/adn/2019/12/maya-2020-api-update-guide.html
It would appear that for windows, to compile Maya2020 plugins, I needed to download and use a new SDK kit: Windows SDK Version 10.0.10586.0

And so I've rebuilt a really simple radialNode plugin from Maya. Came up with some weird linker errors:
ucrtd.lib
msvcrtd.lib
msvcprtd.lib
.. and so on.
Anyways it was all really dumb, so I gave up and then decided to download and install the Visual Studio 2019 version, set it to run the latest SDK version and then it worked.
so, so dumb.

Justin Israel

unread,
Feb 5, 2020, 7:11:47 PM2/5/20
to python_in...@googlegroups.com
Glad you got it working. I don't know the difference between the
Visual Studio compiler version and the windows SDK version. Must have
needed both to be the right (latest) versions.

Justin
> --
> You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/cdd3585c-a12a-4d26-9135-ff63ce3c62ce%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages