- Install Visual Studio 2012, 2013, or 2015.
- Ensure that the correct version of the SDK was downloaded that matches the Visual Studio and CPU.
- Set up environment variable, ALLJOYN_SDK_HOME to point to the AllJoyn SDK root folder.
- Click on the Start menu.
- In the Search programs and files field, type: "edit environment".
- Select Edit environment variables for your account.
- Click the New... button.
- Type "ALLJOYN_SDK_HOME" for the "Variable name" box.
- Enter location of the AllJoyn™ SDK in the "Variable value" box.
- Click OK.
Build the samples
- Inside the compiled SDK exists visual studio projects.
- Navigate to the cpp/sample folder and pick a sample application you wish to run.
- Open up the Visual Studio project contained.
Change the build settings to match the target SDK (Release/Debug) and CPU (Win32/x64).
NOTE: These must match or you will receive build errors.
Click the menu option Build>Rebuild. When the build is complete, open the (CPU)/(SDK Version) folder to find the .exe files contained.
Double-click the applications to open them. A command prompt appears that contains logging information.
Adding to a new/existing project
Visual Studio 2012, 2013, or 2015
Click on C/C++.
Edit Additional Include Directories and add $(ALLJOYN_SDK_HOME)\inc.
NOTE: ALLJOYN_SDK_HOME setup in Set up step 3 above.
Select Preprocessor under C/C++.
Edit Preprocessor Definitions and add QCC_OS_GROUP_WINDOWS and UNICODE.
Click on Linker.
Edit Additional Library Directories and add $(ALLJOYN_SDK_HOME)\lib.
Click on Input found under the "Linker" section.
Enter the following libraries: "alljoyn.lib;ajrouter.lib;ws2_32.lib;Secur32.lib;crypt32.lib;Bcrypt.lib;Ncrypt.lib;iphlpapi.lib".
Click OK. You are now ready to start using the AllJoyn APIs.
Perform the following steps at a high level. Changes may be needed due to how the existing Makefile is structured.
- Open your Makefile.
Create a new variable named ALLJOYN_DIST to point to the AllJoyn SDK.
ALLJOYN_DIST := <path_to_dist>
Create a new variable named ALLJOYN_LIB to point to the AllJoyn library.
ALLJOYN_LIBS := -l$(ALLJOYN_DIST)/cpp/lib/alljoyn.lib -l$(ALLJOYN_DIST)/cpp/lib/ajrouter.lib -l$(ALLJOYN_DIST)/cpp/lib/BundledRouter.obj
ALLJOYN_REQUIRED_LIBS := -lws2_32.lib -lSecur32.lib -lcrypt32.lib -lBcrypt.lib, -lNcrypt.lib -liphlpapi.lib
Modify CXXFLAGS if present, or add to compile command:
Modify the include section to add:
$(ALLJOYN_LIB) $(ALLJOYN_REQUIRED_LIBS)to the Linker command: