[MtoA] Command-line compiling with Visual Studio 2010 Express

  1. Open a Visual Studio Command Prompt (Start > All Programs > Microsoft Visual Studio 2010 Express > Visual Studio Command Prompt)
  2. Set up the environment for 64-bit compilation:

    CALL "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 /Release

And now you’re ready to go. For example, if you were following the basic extensions tutorial, you set some environment variables:

set ARNOLD_PATH=C:\solidangle\arnold\Arnold-
set MTOA_PATH=C:\solidangle\mtoadeploy\2014
set MAYA_PATH="C:\Program Files\Autodesk\Maya2014"

Note that we included the quotation marks in MAYA_PATH, since the path includes an embedded space. An alternative would be to use the quotation marks in the cl and link commands.

cl /c translator1.cpp /EHsc /MD /DNT_PLUGIN /DREQUIRE_IOSTREAM /I%MAYA_PATH%\include /I%MTOA_PATH%\include /I%ARNOLD_PATH%\include
cl /c extension1.cpp /EHsc /MD /DNT_PLUGIN /DREQUIRE_IOSTREAM /I%MAYA_PATH%\include /I%MTOA_PATH%\include /I%ARNOLD_PATH%\include
link /dll extension1.obj translator1.obj /LIBPATH:%ARNOLD_PATH%\lib /LIBPATH:%MAYA_PATH%\lib /LIBPATH:%MTOA_PATH%\lib ai.lib OpenGl32.lib glu32.lib Foundation.lib OpenMaya.lib OpenMayaRender.lib OpenMayaUI.lib OpenMayaAnim.lib OpenMayaFX.lib mtoa_api.lib

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s