---
Product: Aspose.Cells
Platform: cpp
Page Type: docs
Canonical URL: https://docs.aspose.org/cells/cpp/getting-started/installation
---

# Installation

Install Aspose.Cells FOSS for C++ by cloning the repository and building the library with CMake. Covers prerequisites, build steps, and a Hello World verification using the Workbook and Worksheet classes.

## Overview

This guide shows how to set up Aspose.Cells FOSS for C++ on your development machine, build the library, and verify the setup with a minimal spreadsheet-creation program.

---

### Prerequisites

| Requirement | Detail |
|---|---|
| C++ Compiler | C++17-compatible compiler (GCC 9+, Clang 10+, or MSVC 2019+) |
| CMake | Version 3.15 or higher |
| Git | Any recent version |
| Operating System | Linux, macOS, or Windows |

---

### Step 1 — Clone the Repository

Clone the Aspose.Cells FOSS for C++ source repository:

```bash
git clone https://github.com/aspose-cells-foss/Aspose.Cells-FOSS-for-Cpp.git
cd Aspose.Cells-FOSS-for-Cpp
```

---

### Step 2 — Build the Samples

Use the bundled CMake configuration to build the samples project, which also compiles the library:

```bash
cd samples
mkdir build
cd build
cmake ..
cmake --build .
```

The build output places the compiled binaries in the `build/` directory.

---

### Step 3 — Include the Library in Your Project

Add the library headers and source tree to your own CMakeLists.txt via `FetchContent` or a local path include:

```cmake
cmake_minimum_required(VERSION 3.15)
project(MyProject CXX)

set(CMAKE_CXX_STANDARD 17)

# Option A: local path
add_subdirectory(path/to/Aspose.Cells-FOSS-for-Cpp)

add_executable(MyApp main.cpp)
target_link_libraries(MyApp PRIVATE Aspose.Cells.Foss.Cpp)
```

---

### Alternative: Install via NuGet

If your project already uses NuGet for C++ dependency management, you can install the published package instead of building from source:

```bash
dotnet add package Aspose.Cells.Cpp.FOSS
```

Then link against the package in your project as usual; skip Steps 1–3 above and proceed to Step 4 to verify the installation.

---

### Step 4 — Verify the Installation

Create a minimal `main.cpp` that creates and saves an XLSX file:

```cpp
#include "aspose/cells_foss/Workbook.h"
#include "aspose/cells_foss/WorksheetCollection.h"
#include "aspose/cells_foss/Worksheet.h"
#include "aspose/cells_foss/Cell.h"

using namespace Aspose::Cells_FOSS;

int main() {
    Workbook workbook;
    Worksheet& sheet = workbook.GetWorksheets()[0];
    sheet.SetName("Hello");
    sheet.GetCells()["A1"].PutValue("Hello, Aspose.Cells FOSS!");
    workbook.Save("hello.xlsx");
    return 0;
}
```

Build and run. If `hello.xlsx` is created in the working directory, the installation is successful.

---

### Tips and Best Practices

- Always use the `Aspose::Cells_FOSS` namespace to avoid symbol clashes with other libraries.
- The include entry point for most operations is `aspose/cells_foss/Workbook.h`; include additional headers such as `Worksheet.h` and `Cell.h` as needed.
- Use CMake 3.15 or later; older versions may not support the bundled target configuration.
- For production builds, pass `-DCMAKE_BUILD_TYPE=Release` to `cmake` to enable optimizations.
- Keep the clone directory as your library root; do not copy individual headers — relative include paths in the library headers depend on the original directory layout.

---

### Common Issues

| Issue | Cause | Fix |
|---|---|---|
| `fatal error: aspose/cells_foss/Workbook.h: No such file or directory` | Include path not configured | Ensure `target_include_directories` points to the library's `include/` folder |
| `undefined reference to Aspose::Cells_FOSS::Workbook::Workbook()` | Library not linked | Add `target_link_libraries(MyApp Aspose.Cells.Foss.Cpp)` in CMakeLists.txt |
| CMake version error | CMake < 3.15 | Upgrade CMake to 3.15+ or adjust the `cmake_minimum_required` version |
| Build fails on C++14 mode | Standard too old | Add `set(CMAKE_CXX_STANDARD 17)` before the `add_executable` call |

---

### Next Steps

- [License](../license/) — Review the MIT license terms for Aspose.Cells FOSS for C++.
- [Features](../../developer-guide/features/) — Browse all supported spreadsheet capabilities.
- [Working with Spreadsheet Management](../../developer-guide/working-with-spreadsheet-management/) — Learn workbook and worksheet operations.

## See Also

- [Aspose.Cells for C++ — Enterprise Documentation](https://docs.aspose.com/cells/cpp/)