Skip to content

Latest commit

 

History

History
119 lines (87 loc) · 5.34 KB

vscpp_settings.md

File metadata and controls

119 lines (87 loc) · 5.34 KB

How to setup environment in Visual Studio for Maya C++ API

Visual Studio Suggestion

Visual Studio 2012 update 5

Variable Definition

  • $(MayaInstallationPath) : Your Maya installation directory
  • $(MayaPluginPath) : Your Maya plug-ins directory

Configuration

[Release]

General in Release

  • Configuration Properties -> Project Defaults -> Configuration Type -> Dynamic Library
  • Configuration Properties -> General -> Target Extension -> .mll

C/C++ in Release

NDEBUG
WIN32
_WINDOWS
_USRDLL
NT_PLUGIN
_HAS_ITERATOR_DEBUGGING=0
_SECURE_SCL=0
_SECURE_SCL_THROWS=0
_SECURE_SCL_DEPRECATE=0
_CRT_SECURE_NO_DEPRECATE
TBB_USE_DEBUG=0
__TBB_LIB_NAME=tbb.lib
REQUIRE_IOSTREAM
AW_NEW_IOSTREAMS
Bits64_

  • Configuration Properties -> C/C++ -> Code Generation -> Runtime Library -> Multi-threaded DLL (/MD)
  • Configuration Properties -> C/C++ -> Code Generation -> Enable String Pooling -> True

Linker in Release

  • Configuration Properties -> Linker -> General -> Additional Library Directories -> $(MayaInstallationPath)\lib
  • Configuration Properties -> Linker -> Input -> Additional Dependencies -> (Fill below)

Foundation.lib
OpenMaya.lib
OpenMayaAnim.lib (optional)
OpenMayaFX.lib (optional)
OpenMayaRender.lib (optional)
OpenMayaUI.lib (optional)

  • Configuration Properties -> Linker -> Advanced -> Randomized Base Address -> No (/DYNAMICBASE:NO)
  • Command Line -> Additional Options -> /export:initializePlugin /export:uninitializePlugin

[Debug]

General in Debug

  • Configuration Properties -> Project Defaults -> Configuration Type -> Dynamic Library
  • Configuration Properties -> General -> Target Extension -> .mll

C/C++ in Debug

  • Configuration Properties -> C/C++ -> General -> Additional Include Directories -> $(MayaInstallationPath)\include
  • Configuration Properties -> C/C++ -> General -> Debug Information Format -> ProgramDatabase (/Zi)
  • Configuration Properties -> C/C++ -> General -> Warning Level -> Level3 (/W3)
  • Configuration Properties -> C/C++ -> Optimization -> Optimization -> Disabled (/Od)
  • Configuration Properties -> Preprocessor -> Preprocessor Definitions -> (Fill below)

_DEBUG
WIN32
_WINDOWS
_USRDLL
NT_PLUGIN
_HAS_ITERATOR_DEBUGGING=0
_SECURE_SCL=0
_SECURE_SCL_THROWS=0
_SECURE_SCL_DEPRECATE=0
_CRT_SECURE_NO_DEPRECATE
TBB_USE_DEBUG=0
__TBB_LIB_NAME=tbb.lib
REQUIRE_IOSTREAM
AW_NEW_IOSTREAMS
Bits64_

  • Configuration Properties -> C/C++ -> Code Generation -> Runtime Library -> Multi-threaded Debug DLL (/MDd)
  • Configuration Properties -> C/C++ -> Code Generation -> Enable String Pooling -> True

Linker in Debug

  • Configuration Properties -> Linker -> General -> Additional Library Directories -> $(MayaInstallationPath)\lib
  • Configuration Properties -> Linker -> Input -> Additional Dependencies -> (Fill below)

Foundation.lib
OpenMaya.lib
OpenMayaAnim.lib (optional)
OpenMayaFX.lib (optional)
OpenMayaRender.lib (optional)
OpenMayaUI.lib (optional)

  • Configuration Properties -> Linker -> Advanced -> Randomized Base Address -> No (/DYNAMICBASE:NO)
  • Command Line -> Additional Options -> /export:initializePlugin /export:uninitializePlugin

Additional (Helper)

Copy .mll file to your plug-in folder after build

  • Configuration Properties -> Build Events -> Post-Build Event -> xcopy /Y "$(TargetPath)" "$(MayaPluginPath)"