# OpenCL. clBuildProgram with relative path for headers

**URL:** <https://forums.developer.nvidia.com/t/opencl-clbuildprogram-with-relative-path-for-headers/64117>\
**Category:** GPU-Accelerated Libraries\
**Created:** [August 14, 2018, 8:43am UTC](https://forums.developer.nvidia.com/t/opencl-clbuildprogram-with-relative-path-for-headers/64117 "2018-08-14T08:43:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ExorcistNv](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@ExorcistNv](https://forums.developer.nvidia.com/u/ExorcistNv)\
**Post date:** [August 14, 2018, 8:43am UTC](https://forums.developer.nvidia.com/t/opencl-clbuildprogram-with-relative-path-for-headers/64117/1 "2018-08-14T08:43:02Z")

</div>

Hi!

Could someone help me. I am using CUDA SDK and have a problem with headers including in cl-files.

Let full path to project be C:\FULL\PATH\TO\PROJECT, and its content is something like:

cl   
\_\_\_\_\_\_\_\_|- include   
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_|- cl\_header1.h  
\_\_\_\_\_\_\_\_|- cl\_code1.cl  
\_\_\_\_\_\_\_\_|- cl\_code2.cl  
some\_code.h  
some\_code.cpp

In cl\_header1.h:

```auto
#include <cl_header1.h>
...
__kernel void cl_kernel(...)
{...}

```

In some\_code.cpp:

```auto
...
err = clBuildProgram(program, 1, &device_id, include_path.c_str(), NULL, NULL);
...

```

If include\_path is full:

```auto
string include_path = "-I C:\\FULL\\PATH\\TO\\PROJECT\\cl\\include";

```

program runs, but if I set it as relative

```auto
string include_path = "-I \\cl\\include";

```

clBuildProgram fails.

What I am doing wrong?
