# Specifying file dependencies for cpp project

**URL:** <https://discuss.gradle.org/t/specifying-file-dependencies-for-cpp-project/4480>\
**Category:** Old Forum Archive\
**Created:** [June 14, 2012, 12:01am UTC](https://discuss.gradle.org/t/specifying-file-dependencies-for-cpp-project/4480 "2012-06-14T00:01:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan\_Imperial](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@Jonathan\_Imperial](https://discuss.gradle.org/u/Jonathan_Imperial)\
**Post date:** [June 14, 2012, 12:01am UTC](https://discuss.gradle.org/t/specifying-file-dependencies-for-cpp-project/4480/1 "2012-06-14T00:01:00Z")

</div>

How do you specify a file dependency for a cpp-lib project? Currently the user guide specifies how to declare an external dependency from a repository and from another project, but not from a lib file (.so or .dll)?

---

<div class="post-metadata">

**Author:** ![daz](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/daz/32/2475_2.png) [@daz](https://discuss.gradle.org/u/daz)\
**Post date:** [June 14, 2012, 4:29am UTC](https://discuss.gradle.org/t/specifying-file-dependencies-for-cpp-project/4480/2 "2012-06-14T04:29:00Z")

</div>

You might want to check out the ‘cpp/dependencies’ sample in the Gradle distribution.

---

<div class="post-metadata">

**Author:** ![Jonathan\_Imperial](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@Jonathan\_Imperial](https://discuss.gradle.org/u/Jonathan_Imperial)\
**Post date:** [June 25, 2012, 9:24pm UTC](https://discuss.gradle.org/t/specifying-file-dependencies-for-cpp-project/4480/3 "2012-06-25T21:24:00Z")

</div>

The samples showed how to specify a dependency on a library that was produced by the cpp project, however, the project consists of building a library with a dependency on another existing library. I managed to workaround using the closure:

```gradle
libraries {
     main {
          spec {
               args '-DLINUX',"-L${projectDir}/lib/linux","-lintexcmo","-lstdc++"
          }
     }
}

```

These were the arguments we specified in the ant-contrib build.xml for the linux build, and cross compiled with other scripts, which we are leaving alone for the moment.
