APPLICATION NOTE How to Build Basler pylon C++ Applications with Free Microsoft Visual Studio Document Number: AW000644 Version: 03 Language: 000 (English) Release Date: 23 July 2015 INTERNAL USE ONLY (Set it to white if you do not need it) Contacting Basler Support Worldwide Europe, Middle East, Africa Basler AG An der Strusbek 60–62 22926 Ahrensburg Germany Tel. +49 4102 463 515 Fax +49 4102 463 599 support.europe@baslerweb.com The Americas Basler, Inc. 855 Springdale Drive, Suite 203 Exton, PA 19341 USA Tel. +1 610 280 0171 Fax +1 610 280 7608 support.usa@baslerweb.com Asia-Pacific Basler Asia Pte. Ltd. 35 Marsiling Industrial Estate Road 3 #05–06 Singapore 739257 Tel. +65 6367 1355 Fax +65 6367 1255 support.asia@baslerweb.com www.baslerweb.com All material in this publication is subject to change without notice and is copyright Basler AG. AW00064403000 Basler Application Note Table of Contents 1 Introduction ..............................................................................................................................2 2 Steps to be Carried Out ..........................................................................................................3 Step 1 – Installing the Basler pylon Camera Software Suite SDK............................................3 Step 2 – Installing the Desired Free Microsoft Visual Studio Tool............................................4 Step 3 – Preparing C++ Projects...............................................................................................5 Step 4 – Running the Project ....................................................................................................6 Revision History ..............................................................................................................................8 How to Build Basler pylon C++ Applications with Free Microsoft Visual Studio 1 AW00064403000 Basler Application Note 1 Introduction Users of the Basler pylon Camera Software Suite may want to build their own C++ applications without the need to purchase an integrated development environment (IDE). This application note describes an alternative way to build pylon based C++ applications using free Microsoft Visual Studio. Microsoft stopped providing single language programming environments. Therefore, it is necessary to install the complete edition of free Microsoft Visual Studio. This will automatically enable you to build pylon based C++ applications with .NET languages such as C# and Visual Basic (*) as well, which are also supported by the Basler pylon Camera Software Suite. The following two free Microsoft Visual Studio tools are applicable to build pylon based C++ applications: Microsoft Visual Studio Express 2013 for Windows Desktop Microsoft Visual Studio Express 2013 for Windows Desktop does not provide the x64 native compiler. However, you can build 64-bit executables just fine using the x86-x64 cross compiler running on WOW64. Microsoft Visual Studio Community Microsoft Visual Studio Community is the successor of the Express Edition starting with the 2015 release, but is also available in a 2013 release. It is comparable in its functionality to the full Professional Edition. To get an overview of the Visual C++ features available in Microsoft Visual Studio, refer to the following link: https://msdn.microsoft.com/en-us/library/hs24szh9(v=vs.120).aspx. Choose the tool that best suits your needs. (*) The pylon SDK for Visual Basic 6 is no longer included since pylon v4.1.0. How to Build Basler pylon C++ Applications with Free Microsoft Visual Studio 2 AW00064403000 Basler Application Note 2 Steps to be Carried Out To build powerful Windows pylon applications carry out the following steps: 1. Install the Basler pylon Camera Software Suite SDK. 2. Install the desired free Microsoft Visual Studio tool. 3. Prepare the C++ projects. 4. Run the project. In the following, these steps are described in detail. Step 1 – Installing the Basler pylon Camera Software Suite SDK 1. Download the desired or current version of the Basler pylon Camera Software Suite from the Basler website: www.baslerweb.com Basler pylon x86 4.x.x.xxx.exe for a 32-bit Windows operating system or Basler pylon x64 4.x.x.xxx.exe for a 64-bit Windows operating system 2. Install the Basler pylon Camera Software Suite with the pylon SDK for C++ option being enabled. Figure 1: Installation Process – Enabled pylon SDK for C++ Option For detailed information about installing the Basler pylon Camera Software Suite 4.x.x.xxx, the pylon SDK, and your Basler camera, see the Installation and Setup Guide for Cameras Used with pylon for Windows (AW000611). You can download the guide from the Basler website: www.baslerweb.com If you need any assistance in using the SDK, please contact your local Basler Customer Service team. How to Build Basler pylon C++ Applications with Free Microsoft Visual Studio 3 AW00064403000 Basler Application Note Step 2 – Installing the Desired Free Microsoft Visual Studio Tool 1. Be ready to have a Microsoft account registration (email address and password). The Free Microsoft Studio IDE applications are free developer tools for single users and small commercial teams. To download and use them longer than the trial period, a Microsoft account is requested that is easily and free available through registration with a valid email address. 2. Download the desired free Microsoft Visual Studio tool: Microsoft Visual Studio Express 2013 for Windows Desktop or Microsoft Visual Studio Community Refer to the following download link (**) for more information: All Multilanguage: Install & ISO https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs (**) This link may become invalid over time, so we don’t guarantee its availability. System Requirements – Supported Operating Systems Windows 7 SP1 (x86 and x64) Windows 8 (x86 and x64) Windows 8.1 (x86 and x64) Windows Server 2008 R2 SP1 (x64) Windows Server 2012 (x64) Windows Server 2012 R2 (x64) Hardware Requirements 1.6 GHz or faster processor 1 GB of RAM (1.5 GB if running on a virtual machine) 5 GB of available hard disk space 5400 RPM hard drive DirectX 9-capable video card running at 1024 x 768 or higher display resolution Additional Requirements This version of Microsoft Visual Studio works best with Internet Explorer 10 or higher. If Internet Explorer 10 is not installed on your computer, some features might not work as expected. On Windows 8.1 and Windows Server 2012 R2, KB2883200 (available through Windows update) is required. How to Build Basler pylon C++ Applications with Free Microsoft Visual Studio 4 AW00064403000 Basler Application Note 3. Install your downloaded product and register it with your account. At the end of the installation procedure, you will be requested to register your product. You must register the product free of charge within 30 days. If not, it will stop working at the end of the 30-day period. Eventually, you will be given a 14-digit number registration key. You need the key to register and to continue using the free Microsoft Visual Studio tool beyond the initial 30-day period. Step 3 – Preparing C++ Projects There are several sample projects available within the Basler pylon Camera Software Suite SDK installation, located under e.g.: C:\Program Files\Basler\pylon 4\Samples\C++ The available solution files (*.sln) are created with former Microsoft Visual Studio releases to keep a certain backwards compatibility. However, they are unidirectional upgradable when being opened. The advantage of using the existing solution files is that all necessary project settings are pre-configured. No matter whether you want to start your own project from scratch or begin adding pylon support to existing projects, there are a few things to consider. Please refer to the pylon documentation files, which include some information on how to set up the IDE for pylon use. The pylon documentation files will be installed with the pylon SDK and are, for example, located under: C:\Program Files\Basler\pylon 4\doc\PylonCppSDK.chm Please refer to the following sections for more information: Programmer's Guide: Common Settings for Building Applications with pylon Advanced Topics: Settings for Building Applications with pylon IDE Settings 1. To configure the C/C++ compiler, add the following include directories for Release and Debug project configurations. Figure 2: Settings for Configuring the C/C++ Compiler How to Build Basler pylon C++ Applications with Free Microsoft Visual Studio 5 AW00064403000 Basler Application Note 2. To configure the linker, add the following library directories for Release and Debug project configurations. Figure 3: Settings for Configuring the Linker 3. Enable the run-time type information for Release and Debug project configurations. Figure 4: Enabling the Run-Time Type Information Step 4 – Running the Project If you want to use a pylon SDK sample, simply click the Start button in the IDE or press F5. Your pylon sample program should build and run. If you want to start a new x86 project, open Microsoft Visual Studio Express 2013 for Windows Desktop or Microsoft Visual Studio Community and proceed as follows: 1. In the File menu click New Project. 2. In the New Project dialog expand the Visual C++ node in the Product Types tree. How to Build Basler pylon C++ Applications with Free Microsoft Visual Studio 6 AW00064403000 Basler Application Note Figure 5: New Project Dialog 3. Click on the Win32 Application template, give your project a name, and click OK. 4. In the Win32 Application Wizard dialog box, make sure that Windows application is selected as application type and that ATL is not selected. 5. Consider the information described in Step 3 – Preparing C++ Projects. 6. Click the Finish button to generate the project. 7. Test your project by clicking the Start button in the IDE or by pressing F5. Your Win32 application should build and run. If you want to create an x64 project, the same procedure is still valid. However, the linked pylon folders to binary files have to be adapted. To change the platform: 1. In the Build menu click Configuration Manager. 2. In the Configuration Manager dialog open the Active solution platform drop down list and select <New…>. 3. In the New Solution Platform dialog open the Type or select the new platform drop down list, select x64 and click OK. How to Build Basler pylon C++ Applications with Free Microsoft Visual Studio 7 AW00064403000 Basler Application Note Revision History Document Number Date Changes AW00064401000 1 Apr 2008 Initial release version of this document. AW00064402000 30 Jul 2008 Updated contact addresses and phone numbers. AW00064403000 23 Jul 2015 Update due to new underlying software releases. Revision of the entire document. How to Build Basler pylon C++ Applications with Free Microsoft Visual Studio 8