Running the PIDL Compiler

1. Windows

You can use the PIDL add-on to create and compile PIDL files conveniently, but if it is not available, please set up PIDL Custom Build in the following way.

1-1. Setting up PIDL Custom Build in a Visual Studio project

Here are the details of each of the build settings.

Command line: <Path where PIDL.exe is located>\PIDL.exe "%(FullPath)" -outdir .

Description: Compiling %(Filename).pidl ...

Output: %(RootDir)%(Directory)%(Filename)_common.cpp;%(RootDir)%(Directory)%(Filename)_common.h;%(RootDir)%(Directory)%(Filename)_proxy.cpp;%(RootDir)%(Directory)%(Filename)_proxy.h;%(RootDir)%(Directory)%(Filename)_stub.cpp;%(RootDir)%(Directory)%(Filename)_stub.h;%(Outputs)

Additional dependency: <Path where PIDL.exe is located>\PIDL.exe

  • PIDL.exe is located in the util folder of ProudNet.

  • You must set the same settings for both the Debug and Release builds.

Once you are all set up, compile the PIDL file and if it is done successfully, you should see the output like below.

1>---— Start build: Project: ..., Configuration: Release Win32 ---—
1>Compiling TestC2C.pidl ...
1>The build log was saved to "...".
1>ProudNetTest_2005 - Error: 0, Warning: 0
========== Build: Success 1, Fail 0, Latest 0, Omit 0 ==========

Visual Studio 2005 and 2008 versions support Custom Build Rules, which are automatically set up each time you add a PIDL file without the need for custom build settings. However, Visual Studio 2010 and later versions can use Build customizations.

2. Linux

Example of installing the open source Mono library on Ubuntu ※ The open-source Mono project supports Linux, Windows, and Mac OS.

$sudo apt-get install mono-gmcs
$sudo apt-get install mono-runtime

3. C#

RMI is also available in the C# language, so the PIDL compiler also generates proxy and stub code for the C# language.

Running as follows generates the proxy and stub code for the C# language. (Existing -clr is the same as -cs.)

PIDL.exe -cs <input-file-name>

It is recommended to use proxy and stub created in C# language as commonly used modules. As with PIDL, this module requires input of a PIDL file from a C# project and custom build.

The proxy,stub generated after building C2S.pidl is as follows.

  • C2S_common.cs

  • C2S_proxy.cs

  • C2S_stub.cs

Include these files in your C# project (.csproj). However, these files are build output and should not be placed in source control (e.g. SVN, etc.), as you may get writing errors on read-only files.

We recommend opening the .csproj file in an editor and modifying it as follows.

<Target Name="BeforeBuild">
<Compile Include="C2S_common.cs" />
<Compile Include="C2S_proxy.cs" />
<Compile Include="C2S_stub.cs" />
<Target Name="AfterBuild">

The proxy and stub generated in the C# language are the class with the same name as in C++, and the usage is the same.

- Setting public, internal, and private for RMI proxy and stub class

The access modifiers for the proxy, stub, and common classes that the PIDL compiler generates are internal by default. These classes can be used from different sources within the same module (or assembly), but not from other modules.

However, if you want to build a module that collects these classes separately and use the classes in this module in other modules, you may want to change the access modifier to public.

In this case, set the access modifier properties for the class that the PIDL compiler generates as follows.

// This will let proxy, stub and common classes to have access modifier 'public'.
[marshaler(clr)=MyMarshaler, access=public]
global MyC2S 3000

Last updated