# Gradle shouldn't require C++ compiler to build pure C programs

**URL:** <https://discuss.gradle.org/t/gradle-shouldnt-require-c-compiler-to-build-pure-c-programs/18763>\
**Category:** Bugs\
**Tags:** plugins\
**Created:** [August 1, 2016, 1:14pm UTC](https://discuss.gradle.org/t/gradle-shouldnt-require-c-compiler-to-build-pure-c-programs/18763 "2016-08-01T13:14:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jvff](https://avatars.discourse-cdn.com/v4/letter/j/8491ac/32.png) [@jvff](https://discuss.gradle.org/u/jvff)\
**Post date:** [August 1, 2016, 1:14pm UTC](https://discuss.gradle.org/t/gradle-shouldnt-require-c-compiler-to-build-pure-c-programs/18763/1 "2016-08-01T13:14:46Z")

</div>

On Linux with only gcc installed (without g++), Gradle fails to build any program because it attempts to call g++ to link the program.

The cause seems to be in:

subprojects/platform-native/src/main/java/org/gradle/nativeplatform/toolchain/internal/gcc, line 190 (checked out from master@aa7359f8525e560d4809887e8c0b227a0565319e).

The linker is hardcoded to “g++”. I think the solution would be to just change it to “gcc”, but I don’t know if “g++” does any different steps before calling the linker.

Gradle Version: 2.14.1  
Operating System: Ubuntu GNU/Linux 16.04
