Visual C++ example projects

August 25, 2026 ยท View on GitHub

These projects are the shortest Windows route to a running SharkSSH example. They build the complete example set as 32-bit Debug console applications with Visual Studio 2022 and its v143 toolset. Install the Desktop development with C++ workload before opening them. The SoDisp projects use Barracuda App Server (BAS) and Barracuda Web Server (BWS).

Required source layout

The projects contain no machine-specific absolute paths. They expect the dependency directories beside the SharkSSH repository:

parent-directory/
|-- SharkSSH/
|   `-- examples/build/VC-Win/
|-- SharkSSL/    required by *-selib.vcxproj
`-- BAS/         required by *-sodisp.vcxproj

A selib project uses only SharkSSH and SharkSSL. A SoDisp project uses only SharkSSH and BAS; BAS/src/BWS.c already contains SharkSSL. Do not add standalone SharkSSL.c or selib.c to a SoDisp project. Keep all three trees when you want to build every row below.

The exact roots from a project file are:

SharkSSH  $(ProjectDir)..\..\..
SharkSSL  $(ProjectDir)..\..\..\..\SharkSSL
BAS       $(ProjectDir)..\..\..\..\BAS

Choose a project

ExampleStandalone SharkSSL/selibBAS/BWS SoDisp
01 minimal01-minimal-selib.vcxproj01-minimal-sodisp.vcxproj
02 shell02-shell-selib.vcxproj02-shell-sodisp.vcxproj
03 host SFTP03-sftp-selib.vcxproj03-sftp-sodisp.vcxproj
04 BAS SFTPNot applicable04-bas-sftp-sodisp.vcxproj

Example 04 has no selib project because BAS IoIntf selects the BAS/BWS SharkSSL and thread configuration. Every SoDisp project compiles exactly one amalgamation, BAS/src/BWS.c; it does not also compile standalone SharkSSL.

Build and run

  1. Open the selected .vcxproj directly in Visual Studio.
  2. Select Debug and Win32.
  3. Build and run the project.
  4. Connect from a second terminal with the example account.

The optional command-line argument is the SSH port. Omitting it selects port 22; use 2222 if port 22 is already occupied or Visual Studio is not running with permission to bind a privileged port. Configure an argument in Project Properties > Debugging > Command Arguments, or run the executable from a command prompt:

obj\Debug-Win32\03-sftp-selib.exe 2222

Output and independent intermediate directories are under obj/Debug-Win32 and are ignored by Git. The demonstration login is testuser with password test-password.

Examples 03 and 04 expose the process working directory as their demonstration filesystem root. Set Visual Studio's Debugging Working Directory to a dedicated test directory before running either project. Never run these development examples from a directory containing sensitive files.

Connect to a server on port 2222 with, for example:

ssh -p 2222 testuser@localhost
sftp -P 2222 testuser@localhost

When prompted, enter the example password test-password. For example 01, run ssh -p 2222 testuser@localhost status. The expected output is device is ready.

The compiled private host key and login are public test material. Replace both before using any example as the starting point for a product.

Use the Python host integration suite to rebuild and exercise every shell command and SFTP operation against examples 03 and 04 in isolated temporary directories.