Softimage SDK Programmer's Guide > C++ API Development > Building C++ Plug-ins >

# Compiling Plug-ins

About the Softimage Version

There are two pieces of Softimage Version information: the runtime version, which is available from the Application::GetVersion function, and the version which is used for the compilation check. The compilation version is accessible via the XSI_VERSION preprocessor define.

Recommended Setup

- For Linux, the recommended compiler is gcc-4.1.2.

- For Windows the recommended development environment is Visual Studio 2010 SP1.

Note

You can create Visual Studio 2008 or Visual Studio 2010 projects from the plug-in wizard.

Compiling Plug-ins on Linux

1. In a shell (tcsh) window, type:

   source <Softimage home directory>/.xsi_2012

   This ensures that environment variables such as XSISDK_ROOT are set (otherwise you'll get build and link errors).

   Tip

   In the Plug-in Tree, right-click the Plug-ins node and choose Command Prompt to open an xterm window.

2. Change directories to the location of the plug-in source code.

3. To remove all intermediate files before building the example, run this command:

   gmake clean

4. To compile the example, run this command:

   gmake

5. Load the plug-in into Softimage by doing one of the following:

   - In the Plug-in Manager, click Update All.

   - In the Plug-in Manager, click Load, locate the plug-in .SO, and click OK.

   - In the Plug-in Manager, right-click on the User folder and select Update.

Tip

You can compile both 32-bit and 64-bit plug-ins for Linux and differentiate them using the path: for example, $xsi_home/Application/bin/linux/x86/MyPlugin.so and Application/bin/linux/x64/MyPlugin.so. For more information, see Cross-Platform Deployment.

Compiling Plug-ins on Windows

In order to compile Softimage plug-ins for both the x86 and x64 platforms, you need to launch Visual Studio with the proper options, which you can set up using a batch file (.bat) as demonstrated below.

1. If you are using Visual Studio 2010, you can set the batch file that most closely fits your situation:

   - Using a 32-bit environment to compile Softimage x86 plug-ins

   - Using a 32-bit environment to compile Softimage x64 plug-ins

   - Using a 64-bit environment to compile Softimage x86 plug-ins

   - Using a 64-bit environment to compile Softimage x64 plug-ins

   Note

   Using these batch files to set up and launch Visual Studio ensures that environment variables such as XSISDK_ROOT are set properly in order to avoid build and link errors. This is because these batch files simulate opening a Softimage command prompt to start Visual Studio.

2. In Visual Studio open the project file .vcproj.

   If a Source Control dialog box appears, click OK, and then in the Change Source Control dialog box, click Work Disconnected.

3. From the Build menu, click Configuration Manager.

4. Select one of the following from the Active solution configuration drop-down list:

   - If you are building Softimage win32 plug-ins, choose either Debug or Release.

   - If you are building Softimage x64 plug-ins, choose either Debug x64 or Release x64.

5. Select one of the following from the Active solution platform drop-down list:

   - If you are building plug-ins in a 32-bit environment, choose either Win32.

   - If you are building Softimage x64 plug-ins, choose New... and then type x64 on the New Solution Platform dialog.

6. Build the DLL.

   The first time you build the plug-in, you will be prompted to save a Solution File (.sln).

7. Load the plug-in into Softimage by doing one of the following:

   - In the Plug-in Manager, click Update All.

   - In the Plug-in Manager, click Load, locate the plug-in .DLL, and click OK.

Batch Files to Configure .NET 2010

To set up a 32-bit environment for compiling Softimage x86 plug-ins

- Save the following snippet in a batch file (for example, VC32XSIx86.bat):

  Important

  The path names in the following snippet are provided for demonstration only. Don't forget to use:

  - your actual Softimage installation directory instead of C:\Softimage\Softimage_2012

  - your actual Visual Studio installation directory instead of C:\Program Files\Microsoft Visual Studio 10.0

    @echo off

    call "C:\Softimage\Softimage_2012\Application\bin\Setenv.bat"
    call  "C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86

    set PATH
    set XSISDK_ROOT="C:\Softimage\Softimage_2012\XSISDK"

    "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" /useenv

    echo on

To set up a 32-bit environment for compiling Softimage x64 plug-ins

- Save the following snippet in a batch file (for example, VC32XSIx64.bat):

  Important

  The path names in the following snippet are provided for demonstration only. Don't forget to use:

  - your actual Softimage installation directory instead of C:\Softimage\Softimage_2012_x64

  - your actual Visual Studio installation directory instead of C:\Program Files\Microsoft Visual Studio 10.0

    @echo off

    call "C:\Softimage\Softimage_2012_x64\Application\bin\Setenv.bat"
    call "C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" amd64

    set PATH
    set XSISDK_ROOT="C:\Softimage\Softimage_2012_x64\XSISDK"

    "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" /useenv

    echo on

To set up a 64-bit environment for compiling Softimage x86 plug-ins

- Save the following snippet in a batch file (for example, VC64XSIx86.bat):

  Important

  The path names in the following snippet are provided for demonstration only. Don't forget to use:

  - your actual Softimage installation directory instead of C:\Softimage\Softimage_2012

  - your actual Visual Studio installation directory instead of C:\Program Files (x86)\Microsoft Visual Studio 10.0

    @echo off

    call "C:\Softimage\Softimage_2012\Application\bin\Setenv.bat"
    call  "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86

    set PATH
    set XSISDK_ROOT="C:\Softimage\Softimage_2012\XSISDK"

    "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" /useenv

    echo on

To set up a 64-bit environment for compiling Softimage x64 plug-ins

- Save the following snippet in a batch file (for example, VC64XSIx64.bat):

  Important

  The path names in the following snippet are provided for demonstration only. Don't forget to use:

  - your actual Softimage installation directory instead of C:\Softimage\Softimage_2012_x64

  - your actual Visual Studio installation directory instead of C:\Program Files (x86)\Microsoft Visual Studio 10.0

    @echo off

    call "C:\Softimage\Softimage_2012_x64\Application\bin\Setenv.bat"
    call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" amd64

    set PATH
    set XSISDK_ROOT="C:\Softimage\Softimage_2012_x64\XSISDK"

    "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" /useenv

    echo on