C++ Maya Plugin Environment Mac

28 views
Skip to first unread message

Soham Parmar

unread,
Oct 24, 2020, 8:48:53 AM10/24/20
to Python Programming for Autodesk Maya
Hi,
I am trying to create node with cpp, I have never tried this before.
I am getting error while compiling I don't know what mistake I am doing, I think I am getting linker error.

below is the drive link for my folders and cmakeFiles. (I have reduced folder structure. and I am using cmake file which chad has provided on git.)

I am attaching my build log file to understand the error I am getting.

Any help would be really appreciated.
Thanks in advance.

c++PluginCompileLOG.txt

Justin Israel

unread,
Oct 24, 2020, 6:22:10 PM10/24/20
to python_in...@googlegroups.com
Is that your complete CmakeLists.txt file? Have you tried using MAYA_LIBRARIES instead of MAYA_LIBRARY as the linker library variable?
Have you tried using this as a more complete reference? 

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/7cbe5143-b31c-424b-8c34-abfb1c00714dn%40googlegroups.com.

Marcus Ottosson

unread,
Oct 25, 2020, 3:30:07 AM10/25/20
to python_in...@googlegroups.com
Since Maya 2018 or so, each devkit example ships with a CMakeLists.txt file which takes much of the hassle out of the way.

Here's the gist of it.

```bash
cd /path/to/mayadevkit
export DEVKIT_LOCATION=$(pwd)
cd devkit/plug-ins/footPrintNode
mkdir build
cd build
cmake .. -GNinja
cmake --build .
```

And presto, about 2 seconds later you've got a Maya plug-in built. From there, you could search for `DEVKIT_LOCATION

Marcus Ottosson

unread,
Oct 25, 2020, 3:32:36 AM10/25/20
to python_in...@googlegroups.com

(Accidentally posted too soon)

..from there, you could search for DEVKIT_LOCATION in the devkit folder to find out how Maya supplies some helper files you can either build upon or copy/paste to customise for your own custom builds. They’ll tell you about some of the variables relevant to various platforms and what suffixes they use for the built plug-in etc.

With that, I haven’t needed to search online for tutorials on how to build anymore, so I would wipe what you know from pre-2018 and start from there. :)

Hope it helps!

Soham Parmar

unread,
Oct 29, 2020, 2:51:12 PM10/29/20
to python_in...@googlegroups.com
Thank you so much your help guys.

I have managed to build plugin I changed link_directories to link_libraries and it worked.

Now I opened Plugin-in Manager in Maya.
I simply browse to that path and loaded it. But I got this error in Maya.

// Error: file: /Applications/Autodesk/maya2018/Maya.app/Contents/scripts/others/pluginWin.mel line 909: Unable to dynamically load : /Users/soham/Downloads/mayaplugin/build/src/sampleplugin.bundle
dlopen(/Users/soham/Downloads/mayaplugin/build/src/sampleplugin.bundle, 1): Symbol not found: __ZN10MPxCommand6redoItEv
  Referenced from: /Users/soham/Downloads/mayaplugin/build/src/sampleplugin.bundle
  Expected in: /Applications/Autodesk/maya2018/Maya.app/Contents/MacOS/libOpenMaya.dylib
 in /Users/soham/Downloads/mayaplugin/build/src/sampleplugin.bundle // 
// Error: file: /Applications/Autodesk/maya2018/Maya.app/Contents/scripts/others/pluginWin.mel line 909: dlopen(/Users/soham/Downloads/mayaplugin/build/src/sampleplugin.bundle, 1): Symbol not found: __ZN10MPxCommand6redoItEv
  Referenced from: /Users/soham/Downloads/mayaplugin/build/src/sampleplugin.bundle
  Expected in: /Applications/Autodesk/maya2018/Maya.app/Contents/MacOS/libOpenMaya.dylib
 in /Users/soham/Downloads/mayaplugin/build/src/sampleplugin.bundle (sampleplugin) // 

I am trying to build same sampleplugin that is provided by chad on cgcircuit.


Hey Marcus,

I tried your way too. But got one question if you can help.
I created new build directory named and “build” I cd into that directory then I am running this command :- 
cmake .. -GNinja
But this is giving error saying CMakeLists.txt does not exists.
So I am confused what should I write in that CmakeLists file.


Thanks & Regards,
Soham Parmar.

Sent from my MacBook Pro.

Reply all
Reply to author
Forward
0 new messages