Install Visual Studio 2017 or Visual Studio 2015 or Visual Studio 2013. All editions, including the free Community Edition, are supported.
Note: Ensure “C++ Common Tools” is selected. This option can be found under Programming languages → Visual C++ → Common Tools for Visual C++.
When installing Visual Studio 2017, make sure you select “Desktop development with C++”. Also, in the right column of the Visual Studio 2017 install screen, make sure that the “VC++ 2015.3 v140 toolset option” is checked. If you previously installed Visual Studio 2017 without that toolset option checked, it can be added later as follows:
Install dependencies from the web and add to PATH
The following is an example command to update your PATH for building IoTivity, assuming all dependencies have been installed to their default locations on a 64-bit machine. Note: this command must be run from an administrator command prompt:
setx PATH %PATH%;C:\Python27\;C:\Python27\Scripts;C:\Program Files\CMake\bin;C:\Program Files\7-Zip
If the above command causes a max buffer overflow error, you can instead use “Start → System → Advanced system settings → Environment Variables”, then select the “Path” System variable and click “Edit…”. Then add the following paths:
*Note: may have to set up proxy for https
Open a Command Prompt and use the “run.bat” convenience script to call into SCons.
Or call into SCons directly.
scons TARGET_OS=windows TARGET_ARCH=amd64 \ RELEASE=0 WITH_RA=0 TARGET_TRANSPORT=IP SECURED=1 WITH_TCP=1 WITH_UPSTREAM_LIBCOAP=1 \ BUILD_SAMPLE=ON LOGGING=OFF TEST=1
For Visual Studio 2017: from the Start menu, select and click the “VS2017 Pro Command Console”, and do “set vs140” before cd'ing into the iotivity directory building with “run build”.
At the end of the run log, you should see the following:
scons: done building targets.
You should be able to run the samples that are built in the following sub-directory:
|SimpleServer and SimpleClient||A basic sample for hosting, discovering and performing GET, PUT, POST and OBSERVE operations on a resource. We recommend that you start with these two apps.|
|MediaServer and WinUIClient||WinUIClient is a Win32 GUI application for managing the MediaServer application. MediaServer is an application that allows remote control over the PC running the app: specifically volume and playback (play/pause) control|
|ProvisioningClient SampleServer_JustWorks SampleServer_RandomPin||Example for demonstrating Provisioning Manager|
|OCServer and OCClient||An advanced version of SimpleServer/SimpleClient for hosting, discovering and performing GET, PUT, POST and OBSERVE operations on a resource. Allows user to specify 1 of 20 different sequences.|
Source code location of the sample code:
Provisioning Source code location of the sample code:
OCServer/OCClient Source code location of the sample code (works on Windows from this directory):