SDK Installation and Environment Setup
This section describes how to set up Mech-Vision SDK for each supported language.
Prerequisites
-
Mech-Vision 2.2.0 or later is installed.
-
SDK files are located in the
developmentsubdirectory of the Mech-Vision installation directory.
C++ Environment Setup
System Requirements
-
C version: C17 or later
-
Compiler: MSVC 2017 or later
-
Build tool: CMake 3.20 or later
Configure CMakeLists.txt
Add the following content in CMakeLists.txt to include SDK headers and link the static library:
cmake_minimum_required(VERSION 3.20)
project(my_project)
set(CMAKE_CXX_STANDARD 17)
add_executable(demo demo.cpp)
# Set the SDK path
set(VISION_SDK_DIR path/to/development/cpp)
# Include header directories
target_include_directories(demo PRIVATE ${VISION_SDK_DIR}/include)
# Link the static library
target_link_directories(demo PRIVATE ${VISION_SDK_DIR}/lib)
target_link_libraries(demo PRIVATE mmind_vision_sdk)
Start the Vision Service
Before running your program, start the Vision service.
Method 1: Start manually
path/to/mmind_vision.exe --server
Method 2: Start via SDK API
#include "vision_sdk/vision_sdk.h"
#include <thread>
using namespace mmind;
int main()
{
vision::initialize();
vision::startServer();
std::this_thread::sleep_for(std::chrono::seconds(5));
vision::closeServer();
vision::uninitialize();
return 0;
}