I’m using the cpp plugin to download a shared library dependency and then link the new code to the shared library. Gradle passes the path to g++ directly so when I run ldd it lists the absolute path. Example:
ldd build/binaries/libMyProject.so
linux-vdso.so.1 => (0x00007ffff29ff000)
/home/user/.gradle/caches/artifacts-14/filestore/org.somegroup/somename/somename/so/ff2e9f870b96da33cc81554a801d3b2015bc3ac1/libsomename-so.so (0x00007f04f4d90000)
I think the plugin in should instead specify the directory for the dependency using -L and the file name using -l
I found this issue that looks like it describes the problem but it says it is fixed in gradle 1.0. [#GRADLE-2108] cpp executable that links against shared libraries does not work if the shared libraries are moved from their link-time location running gradle 1.2 on linux