Skip to content

Windows Install

Simon Ninon edited this page Feb 14, 2018 · 7 revisions

Requirement

This library currently uses C++11.

It has the following depencies:

Compiling and installing

Visual Studio Solution

Not available yet.

CMake

This documentation aims to provide the building steps for a Windows environment containing the following tools:

  • Appropriate terminal/shell
  • Git (throw command-line)
  • CMake (throw command-line)
  • VS 2015+ (for advanced C++11 support)

The library is based on cmake for the compilation. In order to build the library, you have to open a terminal and follow these steps:

# Clone the project
git clone --recursive https://github.com/thibault-martinez/iota.lib.cpp.git
# Go inside the project directory
cd iota.lib.cpp
# Get dependencies submodule
git submodule update --init
# Generate the VC++ solution using CMake
cmake .
# Generate the VC++ solution using CMake, for x64 platform
cmake . -G "Visual Studio 15 2017 Win64" # Or any other valid platform/compiler version.

This will generate an iota.sln file (that is, a Visual Studio solution).

  • Open this file with Visual Studio.
  • Build the solution in the configuration (Debug, Release, ...) and for the platform (32, 64) of your choice.

Then, you can update your VC++ project configuration:

  • VC++ Directories > Include Directories: Add IOTA_FOLDER_PATH/includes (with the appropriate value of IOTA_FOLDER_PATH).
  • VC++ Directories > Library Directories: Add IOTA_FOLDER_PATH/{Debug|Release|...}/ (with the appropriate value of IOTA_FOLDER_PATH and configuration).
  • Linker > Input > Additional Dependencies: Add iota.lib.

Finally, you just have to include <iota/iota> in your source files.

Customizing compilation and installation

Please refer to this page of the wiki.

Troubleshooting

Runtime Library

If you have a warning like the following when trying to link the library with your project:

error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug'

This is because there is a conflict between the Runtime Library used to compile iota and the Runtime Library used by another library you are using.

By default, iota is compiled using /MT mode, but you can use the MSVC_RUNTIME_LIBRARY_CONFIG cmake variable to override this setting.

Please refer to this page of the wiki.

ws2_32

Sometimes, it appears that CMake does not get along very well with Visual Studio and fails to generate project files with linkage against ws2_32.

If you get errors such as undefined external symbol _impl_socket, this is probably the case.

If so, manually add it the link as follow: (tacopie)Project->Properties->Librarian->Additional Dependencies->(input)ws2_32.lib