# Native binary build failure: Could not find method libs()

**URL:** <https://discuss.gradle.org/t/native-binary-build-failure-could-not-find-method-libs/13175>\
**Category:** Help/Discuss\
**Created:** [December 9, 2015, 11:46pm UTC](https://discuss.gradle.org/t/native-binary-build-failure-could-not-find-method-libs/13175 "2015-12-09T23:46:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chefhoobajoob](https://avatars.discourse-cdn.com/v4/letter/c/c68b51/32.png) [@chefhoobajoob](https://discuss.gradle.org/u/chefhoobajoob)\
**Post date:** [December 9, 2015, 11:46pm UTC](https://discuss.gradle.org/t/native-binary-build-failure-could-not-find-method-libs/13175/1 "2015-12-09T23:46:52Z")

</div>

I’m just getting my feet wet with the native build support, and have this simple build script:

```gradle
apply plugin: 'cpp'

model {

    platforms {
        x86 { architecture 'x86' }
        x64 { architecture 'x86_64' }
    }
    
    buildTypes {
        debug
        release
    }
    
    binaries {
        all {
            if ( toolChain in VisualCpp ) {
                cppCompiler.args "/EHsc"
                if ( buildType == buildTypes.debug ) {
                    cppCompiler.define "DEBUG" 
                }
            }
        }
    }

    repositories {
        libs(PrebuiltLibraries) {
            hello {
                headers.srcDir = project.projectDir + "../hello/Include"
            }
        }
    }

    components {
        goodbye(NativeLibrarySpec) {
            sources {
                cpp.lib library: 'hello', linkage: 'api'
            }
        }
    }
}

```

It’s a simple library with one source file that has a dependency on another library. My understanding of the technique to use for expressing this dependency is to use the `repositories` closure containing an entry for `libs(PrebuiltLibraries)`.

Gradle is not happy with this, though, issuing this error:

```gradle
FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\hoobajoob\Documents\Eclipse\workspace-sts-luna\cdt.gradle.goodbye\build.gradle' line: 27

* What went wrong:
Exception thrown while executing model rule: model.repositories @ build.gradle line 26, column 5
> Could not find method libs() for arguments [interface org.gradle.nativeplatform.PrebuiltLibraries, build_7bgjdveru7rs4jelxyvxt3289$_run_closure1$_closure8$_closure13@22c75458] on root project 'cdt.gradle.goodbye'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

```

What have I missed?

---

<div class="post-metadata">

**Author:** ![chefhoobajoob](https://avatars.discourse-cdn.com/v4/letter/c/c68b51/32.png) [@chefhoobajoob](https://discuss.gradle.org/u/chefhoobajoob)\
**Post date:** [December 9, 2015, 11:59pm UTC](https://discuss.gradle.org/t/native-binary-build-failure-could-not-find-method-libs/13175/2 "2015-12-09T23:59:31Z")

</div>

Ha! Nothing like posting a question to illuminate the answer.

Problem was in a poorly formed configuration for `headers.srcDir`. Fix was to change the `repositories` closure like so:

```gradle
    repositories {
        libs(PrebuiltLibraries) {
            hello {
                headers.srcDir '../hello/Include'
            }
        }
    }

```

All is well now!
