ApplicationAPI.dllβ The main dynamic library.ApplicationAPI.libβ Import library for linking.sdkdriver.dll- Communication with Drive app.ApplicationAPI.hβ Header file with function declarations.
This project demonstrates how to integrate and use ApplicationAPI.dll in a C++ application using Visual Studio 2022.
The project is structured as follows:
/InitApiDemo
βββ /InitApiDemo # Project directory
β βββ /include # Header files
β β βββ ApplicationAPI.h
β β
β βββ /lib # Library files
β β βββ ApplicationAPI.dll
β β βββ ApplicationAPI.lib
β β βββ sdkdriver.lib
β β
β βββ main.cpp
β βββ pch.cpp
β βββ pch.h
β β
β βββ InitApiDemo.vcxproj # Project file
β
βββ InitApiDemo.sln # Solution file
βββ README.md # This guide
- Open Visual Studio 2022 and load the project (
.slnfile) or create a new C++ console application. - Place library files (.dll, .lib, .h) into proper folders (lib, include).
- Configure Include Directories:
- Go to:
Project Properties β C/C++ β General β Additional Include Directories - Add:
$(ProjectDir)include
- Go to:
- Configure Library Directories:
- Go to:
Project Properties β Linker β General β Additional Library Directories - Add:
$(ProjectDir)lib
- Go to:
- Link Against
ApplicationAPI.lib:- Go to:
Project Properties β Linker β Input β Additional Dependencies - Add:
ApplicationAPI.lib
- Go to:
To ensure ApplicationAPI.dll and sdkdriver.dll are always placed next to the executable:
- Go to:
Project Properties β Build Events β Post-Build Event β Command Line - Add the following command:
xcopy /Y "$(ProjectDir)lib\ApplicationAPI.dll" "$(OutDir)" xcopy /Y "$(ProjectDir)lib\sdkdriver.dll" "$(OutDir)"
- This copies
ApplicationAPI.dllandsdkdriver.dllto the output directory after building.
- This copies
- Build the project (
Ctrl + Shift + B). - Run the executable (
F5orCtrl + F5).
- Ensure
ApplicationAPI.dllexists in the/libfolder. - Run a clean build (
Rebuild Solution). - Manually copy
ApplicationAPI.dllto the output folder.
- Ensure
sdkdriver.dllexists in the/libfolder. - Run a clean build (
Rebuild Solution). - Manually copy
sdkdriver.dllto the output folder.
- Verify that
ApplicationAPI.libis added to Additional Dependencies. - Check that
ApplicationAPI.his included in the source file.