Setting up a C/C++ development environment
This page walks you step by step, even if you are new to programming, through to building and running a C/C++ program (EXE) that uses the INFINICAM SDK.
Follow the steps from top to bottom, and at the end you will have a program that connects to the camera. If something doesn’t work along the way, see Troubleshooting.
| Step | What you do | Time |
|---|---|---|
| 1 | Install Visual Studio | 30–60 min (including download) |
| 2 | Run Hello World without the SDK | 10 min |
| 3 | Download and place the SDK | 5 min |
| 4 | Create a project that uses the SDK | 15 min |
| 5 | Check that it works without a camera | 5 min |
| 6 | Connect to the camera and run it | 10 min |
| 7 | Run your EXE on another PC | When needed |
0. What you need
Section titled “0. What you need”- A Windows 11 (64-bit) PC: the SDK is 64-bit only.
- Administrator rights: needed to install Visual Studio. If you don’t have them on a university PC, ask your administrator.
- At least 10 GB of free disk space: used by the Visual Studio installation.
- An internet connection
- The INFINICAM camera and its cable: used in step 6. You can do everything up to step 5 without a camera.
1. Installing Visual Studio
Section titled “1. Installing Visual Studio”To create C/C++ programs, you install Microsoft’s development tool, Visual Studio.
-
Download the installer
Open the official Visual Studio site and download the Visual Studio 2026 installer with the “Get free download” button (Community).

-
Choose the workload (features)
Run the downloaded
VisualStudioSetup.exe. A window for choosing the features to install appears.- Check “Desktop development with C++”.

-
Install
Click “Install” at the bottom right. Downloading and installing takes 30 minutes to an hour. Restarting the PC afterwards is a good idea.
2. Hello World (without the SDK)
Section titled “2. Hello World (without the SDK)”First, check that a program runs with Visual Studio alone, without the SDK.
-
Prepare a folder for your projects
In File Explorer, create a folder named
infinicam_projectsinC:\. All the projects you create on this site are saved here. -
Start Visual Studio
Start Visual Studio. The first time, a sign-in screen appears. Sign in with your university account or a personal Microsoft account, or choose “Skip this for now” to continue.
-
Create a new project
-
On the start window, click “Create a new project”.
-
From the template list, choose “Empty Project” (Language: C++ / Platform: Windows) and click “Next”.
Enter
Sample01as the project name andC:\infinicam_projectsas the location, check “Place solution and project in the same directory”, and click “Create”.
-
-
Add a C++ file (.cpp)
-
In “Solution Explorer” on the right side of the window, right-click “Source Files”.
-
Choose “Add” > “New Item”.

-
In the “Add new item” window, enter
main.cppas the file name and click “Add”.
Always end the file name with
.cpp.
-
-
Enter the code
Enter the following code in the
main.cppyou added.#include <stdio.h>int main(void) {printf("Hello, World!\n");return 0;} -
Run the program
Press
Ctrl+F5(Start Without Debugging) to run it.If
Hello, World!appears in the black window (console), it worked.
3. Downloading and placing the SDK
Section titled “3. Downloading and placing the SDK”Prepare the components (SDK) for controlling INFINICAM from a program. All explanations on this site assume the SDK is placed in C:\infinicam_sdk\. If you put it in the same place, you can follow the explanations as written.
-
Download the SDK
Download the latest SDK ZIP file (for example
PUCLIB_SDK_v1.7.0.0.zip) from the Resources & Downloads page. -
Extract the ZIP file
Right-click the downloaded ZIP file and choose “Extract All”.
-
Place it in
C:\infinicam_sdk\Open the extracted folder. It contains 4 folders,
dll,doc,include, andlib, andTHIRD_PARTY_NOTICES.txt.In File Explorer, create a folder named
infinicam_sdkinC:\, and copy all of these contents into it.If it looks like this, it is placed correctly.
Directoryinfinicam_sdk/ Folder created directly under
C:\Directoryinclude/ Header files (descriptions of the components your program loads)
- PUCCONST.h
- PUCLIB.h
- PUCUTIL.h
Directorylib/ Import libraries (used when building)
- PUCLIB.lib
- PUCUTIL.lib
Directorydll/ DLLs (used when running the program)
- ICYUSB.dll
- IGETHERB.dll
- PICCLIB.dll
- PUCLIB.dll
- PUCUTIL.dll
Directorydoc/ API reference (HTML)
- …
- THIRD_PARTY_NOTICES.txt License notices for external software used by the SDK
4. Creating a project that uses the SDK
Section titled “4. Creating a project that uses the SDK”To use the SDK, the project needs settings that tell it “where the SDK is”. Go through the following 7 steps one at a time.
-
Create a new project
-
In Visual Studio, choose “Create a new project”.
-
From the template list, choose “Console App” (C++ / Windows / Console) and click “Next”.

Enter
InfinicamTestas the project name andC:\infinicam_projectsas the location, check “Place solution and project in the same directory”, and click “Create” (for notes on where to save, see step 2-1).
When the project is created,
InfinicamTest.cppopens with Hello World code that starts with#include <iostream>.
-
-
Set the platform to x64
Check that the platform box in the toolbar at the top of the window shows
x64. It is usuallyx64from the start, but if it showsx86, change it tox64.
-
Open the properties window
-
Open the “Project” menu at the top of the window and choose “InfinicamTest Properties” at the bottom (your own project name appears in place of “InfinicamTest”).

-
At the top of the window, set “Configuration” to “All Configurations” and “Platform” to “x64”. If Platform shows “Active(x64)”, you can leave it as it is.

-
-
Set the header file location (C/C++ > General)
In the tree on the left, choose “Configuration Properties” > “C/C++” > “General” and enter the following path in “Additional Include Directories”.
C:\infinicam_sdk\include
-
Read source files as UTF-8 (C/C++ > Command Line)
In the tree on the left, choose “C/C++” > “Command Line” and enter the following in “Additional Options”.
/utf-8
This makes the compiler read source files as UTF-8. It is needed when your source code contains non-ASCII text, such as the Japanese comments and messages in the sample code bundle.
-
Set the library location and name (Linker)
-
In the tree on the left, choose “Linker” > “General” and enter the following path in “Additional Library Directories”.
C:\infinicam_sdk\lib
-
In the tree on the left, choose “Linker” > “Input” and add the following to the start of “Additional Dependencies”. Don’t forget the
;at the end.PUCLIB.lib;
Don’t delete the
$(CoreLibraryDependencies);%(AdditionalDependencies)that is already there; addPUCLIB.lib;in front of it.
-
-
Copy the DLLs automatically (Build Events)
To run the program, the SDK DLLs must be in the same folder as the EXE. Set them to be copied automatically on every build.
In the tree on the left, choose “Build Events” > “Post-Build Event” and enter the following in “Command Line”.
xcopy /Y /D "C:\infinicam_sdk\dll\*.dll" "$(OutDir)"
Finally, click “Apply” > “OK” to close the properties window.
5. Checking that it works (without a camera)
Section titled “5. Checking that it works (without a camera)”Check that the settings are correct without connecting a camera.
-
Enter the code
Open the
.cppfile with the same name as the project (for exampleInfinicamTest.cpp), delete everything in it, and paste the following code.#include <stdio.h>#include <stdlib.h>#include <PUCLIB.h> // INFINICAM SDK headerint main(){printf("Checking that the INFINICAM SDK initializes...\n");PUCRESULT ret = PUC_Initialize();if (ret != PUC_SUCCEEDED) {printf("Error: failed to initialize the SDK. ErrorCode: %d\n", ret);return EXIT_FAILURE;}printf("OK: the SDK was loaded. Your development environment is ready.\n");return EXIT_SUCCESS;} -
Build and run
Press
Ctrl+F5. The build starts, and when it finishes, the program runs automatically.If you see the following, your development environment is ready.
Checking that the INFINICAM SDK initializes...OK: the SDK was loaded. Your development environment is ready.
The lines below it, such as “… exited with code 0 (0x0)” and “Press any key to close this window . . .”, are messages from Visual Studio. Press any key to close the window.
If the “Output” window at the bottom of the screen shows
5 File(s) copiedandBuild: 1 succeeded, the build and the automatic DLL copy are also working correctly.
6. Connecting to the camera (Hello World)
Section titled “6. Connecting to the camera (Hello World)”This program detects and connects to the camera and shows its serial number. You keep using the project you created in step 4.
-
Allow traffic from the camera through the firewall (GbE-2 only, first time only)
Windows Firewall blocks newly built EXEs from communicating with the camera. As is, the camera can be found, but you get “Error: could not open the camera. ErrorCode: 9”.
So you create one rule that allows traffic coming from the camera (
192.168.0.10). Once created, it works for the EXE of any project, in both Debug and Release.-
Type “PowerShell” in the Start menu, right-click PowerShell in the results, and choose “Run as administrator”.
-
Copy and paste the following line and press
Enter.Terminal window New-NetFirewallRule -DisplayName "INFINICAM GbE-2" -Direction Inbound -Protocol UDP -RemoteAddress 192.168.0.10 -Action Allow -Profile Any -
When you see
DisplayName : INFINICAM GbE-2andEnabled : True, as below, you are done.
-
-
Enter the code
Replace the contents of the
.cppfile with the following code.#include <stdio.h>#include <stdlib.h>#include <PUCLIB.h> // INFINICAM SDK headerint main(){printf("Initializing INFINICAM...\n");// 1. Initialize the SDKPUCRESULT ret = PUC_Initialize();if (ret != PUC_SUCCEEDED) {printf("Error: failed to initialize the SDK. ErrorCode: %d\n", ret);return EXIT_FAILURE;}// 2. Search for connected camerasPUC_DETECT_FILTER filter = { 0 };filter.nDeviceTypeFlags = PUC_DETECT_TARGET_ALL; // Search for both UC-1.1 and GbE-2PUC_DETECT_INFO detectInfo = { 0 };ret = PUC_DetectDevice2(&filter, &detectInfo);if (ret != PUC_SUCCEEDED || detectInfo.nDeviceCount == 0) {printf("Error: no camera was found. ErrorCode: %d\n", ret);printf("Check the cable connection and the network settings.\n");return EXIT_FAILURE;}printf("Camera detected. (count: %u)\n", detectInfo.nDeviceCount);// 3. Open the first camera foundPUC_HANDLE hDevice = NULL;ret = PUC_OpenDevice2(0, &hDevice);if (ret != PUC_SUCCEEDED) {printf("Error: could not open the camera. ErrorCode: %d\n", ret);return EXIT_FAILURE;}printf("SUCCESS: connected to the camera!\n");// 4. Show camera informationUINT64 serialNo = 0;if (PUC_GetSerialNo(hDevice, &serialNo) == PUC_SUCCEEDED) {printf("Serial number: %llu\n", serialNo);}// 5. Close the cameraPUC_CloseDevice(hDevice);return EXIT_SUCCESS;} -
Connect the camera and run it
Connect the camera to the PC and press
Ctrl+F5. If you see the following, it worked.Initializing INFINICAM...Camera detected. (count: 1)SUCCESS: connected to the camera!Serial number: (your camera's serial number)
7. Running your EXE on another PC
Section titled “7. Running your EXE on another PC”Your program can run on a PC without Visual Studio.
-
Build in Release
Change the configuration in the toolbar from
DebugtoRelease, and build with “Build” > “Build Solution” (Ctrl+Shift+B) from the menu. -
Gather the files you need
The EXE and DLLs are in
x64\Release\inside the project folder (for exampleC:\infinicam_projects\InfinicamTest\x64\Release\). Copy the following 6 files to the other PC, keeping them together in one folder.InfinicamTest.exe(your program)PUCLIB.dll,PUCUTIL.dll,PICCLIB.dll,ICYUSB.dll,IGETHERB.dll
-
Prepare the other PC
-
The other PC also needs the Visual C++ Redistributable (x64). Download
vc_redist.x64.exefrom the following link and run it to install.https://aka.ms/vc14/vc_redist.x64.exe (a permanent link to Microsoft’s latest version)
-
To use the GbE-2, the other PC also needs the network settings and the firewall rule from step 6-1.
-
8. Troubleshooting
Section titled “8. Troubleshooting”| Symptom / error | Likely cause | What to do |
|---|---|---|
| You can’t find “Solution Explorer” on the right side of the window | It was closed, or is hidden behind another tab (such as “Git Changes”) | Show it with “View” > “Solution Explorer” (Ctrl + Alt + L) from the menu |
| The windows are scattered, or you can’t find a window you need | Windows were closed or dragged around | Restore the original layout with “Window” > “Reset Window Layout” from the menu |
C1083: Cannot open include file: 'PUCLIB.h' |
The header file location is set incorrectly | Check the path in step 4-4, and that C:\infinicam_sdk\include\PUCLIB.h exists |
LNK1104: cannot open file 'PUCLIB.lib' |
The library location is set incorrectly | Check the path in step 4-6, and that C:\infinicam_sdk\lib\PUCLIB.lib exists |
LNK2019: unresolved external symbol PUC_... |
PUCLIB.lib was not added, or you are building for x86 |
Check “Additional Dependencies” in step 4-6 and x64 in step 4-2 |
“The code execution cannot proceed because MSVCP140.dll (or VCRUNTIME140.dll) was not found” |
The Visual C++ Redistributable is not installed on a PC without Visual Studio | Install vc_redist.x64.exe (step 7-3) |
“The code execution cannot proceed because PUCLIB.dll was not found” |
The DLLs are not in the same folder as the EXE | Check the setting in step 4-7. Check that x64\Debug\ contains the 5 DLLs |
The build fails with MSB3073 The command "xcopy ..." in the Error List, and “Invalid number of parameters”, “0 File(s) copied”, or “… exited with code 4” in the Output window |
The post-build event command is wrong (/Y /D typed as \Y \D, the SDK path is wrong, and so on) |
Copy and paste the command from step 4-7 again. Check that C:\infinicam_sdk\dll exists |
| “The application was unable to start correctly (0xc000007b)” | 32-bit and 64-bit are mixed | Check that the configuration is x64 and that the copied DLLs come from the SDK’s dll folder |
| Non-ASCII text such as Japanese comments causes errors or garbled output | The source file encoding setting is missing | Check /utf-8 in step 4-5 |
| “Error: no camera was found” | Cable, IP address, or firewall settings | Check PC requirements and network settings |
| Builds sometimes fail, or “Access is denied” appears | The project is saved in a folder synced by OneDrive or similar | Recreate the project in C:\infinicam_projects (see step 2-1) |
| “File not found” errors, or garbled paths in error messages | The project path contains non-ASCII characters or spaces | Same as above |
| “Error: could not open the camera. ErrorCode: 9” | The camera was found but can’t be communicated with. It is blocked by Windows Firewall, or another application is using the camera | Create the firewall rule in step 6-1. Close other applications such as viewers |
Summary of build settings
Section titled “Summary of build settings”These are the settings from step 4. Use this list when you create your second and later projects.
| Where | Item | Value |
|---|---|---|
| Toolbar | Platform | x64 |
| C/C++ > General | Additional Include Directories | C:\infinicam_sdk\include |
| C/C++ > Command Line | Additional Options | /utf-8 |
| Linker > General | Additional Library Directories | C:\infinicam_sdk\lib |
| Linker > Input | Additional Dependencies | PUCLIB.lib; |
| Build Events > Post-Build Event | Command Line | xcopy /Y /D "C:\infinicam_sdk\dll\*.dll" "$(OutDir)" |
