Building the sample

Generate vs progect under windows

  • Generate vs progect under windows

  1. create vsbuild folder under windows/samples/c

  2. using command line tools or using mingw under msys2,enter vsbuild and using cmake command to generate VS project,detail command like follows:

    cd vsbuild
    
    cmake .. -G "Visual Studio 12 2013"  //according to your VS version
    

The generated VS project is shown below

../../_images/win_C1.jpg
  1. Open dmcam_c_sample.sln, compile to generate C excutable program.

VS project and version show as table 3-1:

Table3-1 VS version

Version

Number

Visual Studio 2005

8

Visual Studio 2008

9

Visual Studio 2010

10

Visual Studio 2012

11

Visual Studio 2013

12

Visual Studio 2015

14

Visual Studio 2017

15

After successfully generating the VS project, use VS to open the project and generate the solution. The following figure shows the sample_capture_frames program after generating the solution
../../_images/win_C2.jpg
  • Generate excutable program under windows

  1. Create build folder under windowssamplesc

  2. Enter build folder and generate excutable file via cmake,detail’s command are as follows:

    cd build
    
    cmake .. -G "MSYS Makefiles"
    
    make -j
    
  3. Run excutable via double click it

  • Run in linux

  1. Copy libdmcam.so to /usr/lib

  2. Open terminal,install cmake:

    sudo apt-get install cmake
    
  3. Create build folder under linux/sample/c,and run the following commands:

    cd build
    cmake .. -G "Unix Makefiles"
    make -j
    
After generating the executable file, the executable file shown in the following figure is displayed under the build folder:
../../_images/win_C3.jpg

Run the excutable program

C++ Sample process

C++ Samples please refer to C Samples.