rajeesh
(Rajeesh Rarankurissi)
March 30, 2016, 1:13pm
1
I am trying to do C++ example in gradle
I am getting error as below
BUILD FAILED
Total time: 2.896 secs
[thinkpalm@localhost gradle-cpp]$ gradle task
FAILURE: Build failed with an exception.
Could not find method libs() for arguments [build_5wi0mgh6d37hsdz5jn6d51naw$_run_closure1@71e26d] on root project ‘gradle-cpp’.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
What might be reason ?? Any Idea ?
Based on the line number, I’m guessing your script looks something like:
apply plugin: 'cpp'
model {
repositories {
libs {
...
If that is the case you need to add the type of repository you’re trying to create e.g. PrebuiltLibraries
as the first parameter:
apply plugin: 'cpp'
model {
repositories {
libs(PrebuiltLibraries) {
...
rajeesh
(Rajeesh Rarankurissi)
March 31, 2016, 11:56am
3
My build.gradle is as below
// build.gradle
apply plugin: ‘cpp’
libs {
hello {}
}
executables {
main {
binaries.all {
lib libraries.hello.shared
}
}
}
I tried your suggesion still have problem with
some functions as below
Could not find method executables()
Thanks in advance
Where is your model block?
rajeesh
(Rajeesh Rarankurissi)
April 4, 2016, 9:49am
5
rajeesh
(Rajeesh Rarankurissi)
April 4, 2016, 12:55pm
6
It worked for me … Issue was with my Gcc++
Thanks for your Support