Here we describe how to compile OpenBabel on Windows using the Microsoft Visual C++ compiler (MSVC). We recommend the following compiler which is available for free:
You also need to install the Platform SDK.
- Unzip it into a folder that doesn't contain spaces
- Read the install notes in the distribution
- Read more install notes on the web site
- Open "build\msw\wx.dsw"
- Under the default target 'wxregex', open "setup.h" and change
#define wxUSE_STD_IOSTREAM 0
#define wxUSE_STD_IOSTREAM 1
- On the menu, choose "Batch Build", and sort by "Configuration". Select only those configurations of type "Release", and click on Build All.
- Set the environment variable WXWIN to the installation directory of wxWidgets, and restart MSVC.
Compiling one of the OpenBabel GUI targets
The GUI targets, OBGUII and OBabelGUI, need some extra tweaking to get them to work. Here we describe the procedure for OBGUII, but it is the same for OBabelGUI.
- Make sure you have carried out all of the instructions in the section on [Install (MSVC)#Compiling wxWidgets | Compiling wxWidgets].
- Open the OBGUII Properties dialog (by right-clicking on the project name), choose "Preprocessor definitions" and add the following:
- In the same dialog box, add the following to "Linker", "Additional Dependencies":