Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

This is a pretty complex topic, but I can give you some general pointers. First, yes the openstudio_utilities.dll has other binary dependencies. That is to say it depends on other dll libraries to work. The Qt dlls for instance are one dependency. On windows these dlls need to be in the same directory as the utilities dll or they need to be installed to your system path. In order to see precisely what library dependencies are required for a particular openstudio dll, I suggest that you use Dependency Walker.

The other thing about accessing a C++ API like in OpenStudio, is that you need header files. These are the source code files ending in .hpp that define what functions are available. Your code needs to include these header files so you can use classes and functions defined in the dll libraries. Here's the catch. OpenStudio hasn't formalized the process for third parties to use the C++ API so we don't install the header files with our installer package. You'd have get them from our source repository and that can be tricky because a given header file typically depends on other header files.

In my opinion the easiest way to build a third party app on OpenStudio C++ is to first checkout OS source and compile the project. Some time ago I created an example project derived from OpenStudio. It is CMake based just like OS is. It is a little out of date but you can take a look at the general idea, here.

The OS team recognizes the fact that dependencies (of which we have several big ones) are a significant burden to getting started with the C++ code. To address the issue we are actively trying to pair down these dependencies in our core libraries like OS Model and Utilities.

Finally I want to emphasize that most of the complexity is unique to accessing OpenStudio through C++. We distribute ruby bindings and C# bindings on windows out of the box. You get them automatically when you run the OS installer. Those languages don't require header files, so you load the libraries and start coding.

This is a pretty complex topic, but I can give you some general pointers. First, yes the openstudio_utilities.dll has other binary dependencies. That is to say it depends on other dll libraries to work. The Qt dlls for instance are one dependency. On windows these dlls need to be in the same directory as the utilities dll or they need to be installed to your system path. In order to see precisely what library dependencies are required for a particular openstudio dll, I suggest that you use Dependency Walker.

The other thing about accessing a C++ API like in OpenStudio, is that you need header files. These are the source code files ending in .hpp that define what functions are available. Your code needs to include these header files so you can use classes and functions defined in the dll libraries. Here's the catch. OpenStudio hasn't formalized the process for third parties to use the C++ API so we don't install the header files with our installer package. You'd have You need to get them from our source repository and that can be tricky because a given header file typically depends on other header files.

In my opinion the easiest way to build a third party app on OpenStudio C++ is to first checkout OS source and compile the project. Some time ago I created an example project derived from OpenStudio. It is CMake based just like OS is. It is a little out of date but you can take a look at the general idea, here.

The OS team recognizes the fact that dependencies (of which we have several big ones) are a significant burden to getting started with the C++ code. To address the issue we are actively trying to pair down these dependencies in our core libraries like OS Model and Utilities.

Finally I want to emphasize that most of the complexity is unique to accessing OpenStudio through C++. We distribute ruby bindings and C# bindings on windows out of the box. You get them automatically when you run the OS installer. Those languages don't require header files, so you load the libraries and start coding.