# Build fails with CXX=g++ : unrecognized command line options

**URL:** <https://discourse.julialang.org/t/build-fails-with-cxx-g-unrecognized-command-line-options/2360>\
**Category:** Internals & Design\
**Tags:** question\
**Created:** [February 28, 2017, 7:28am UTC](https://discourse.julialang.org/t/build-fails-with-cxx-g-unrecognized-command-line-options/2360 "2017-02-28T07:28:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![singam-sanjay](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/singam-sanjay/32/1721_2.png) [@singam-sanjay](https://discourse.julialang.org/u/singam-sanjay)\
**Post date:** [February 28, 2017, 7:28am UTC](https://discourse.julialang.org/t/build-fails-with-cxx-g-unrecognized-command-line-options/2360/1 "2017-02-28T07:28:26Z")

</div>

Hello,

I’m building the debug build of Julia with svn build of LLVM+Polly. The build stops when g++ receives the unrecognised options, but which are recognised by clang++.

```julia
    CC src/APInt-C.dbg.obj
g++: error: unrecognized command line option ‘-Wcovered-switch-default’
g++: error: unrecognized command line option ‘-Wstring-conversion’
g++: error: unrecognized command line option ‘-fcolor-diagnostics’
make[1]: *** [APInt-C.dbg.obj] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [julia-src-debug] Error 2

```

Is it advisable to switch over to a different compiler in the middle of a build when the build fails ?

Thank You,  
Sanjay

---

<div class="post-metadata">

**Author:** ![tkelman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkelman/32/692_2.png) [@tkelman](https://discourse.julialang.org/u/tkelman)\
**Post date:** [February 28, 2017, 11:06am UTC](https://discourse.julialang.org/t/build-fails-with-cxx-g-unrecognized-command-line-options/2360/2 "2017-02-28T11:06:44Z")

</div>

Use the same C++ compiler to build all dependencies and Julia itself. If your llvm build was compiled with clang, then you shouldn’t use g++ to build the rest of Julia and its dependencies, and vice-versa.

---

<div class="post-metadata">

**Author:** ![singam-sanjay](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/singam-sanjay/32/1721_2.png) [@singam-sanjay](https://discourse.julialang.org/u/singam-sanjay)\
**Post date:** [February 28, 2017, 11:55am UTC](https://discourse.julialang.org/t/build-fails-with-cxx-g-unrecognized-command-line-options/2360/3 "2017-02-28T11:55:44Z")

</div>

Hello @tkelman,

The LLVM build for Julia and Julia ( untill this error ) were built by g++. I shifted to clang only after that. I’ll refrain from changing the compilers henceforth.

Even if I had stuck to g++, how is it that g++ was given arguments that it doesn’t accept ? And how is the Julia build passing on Travis.cl ?

Thank You,  
Sanjay

---

<div class="post-metadata">

**Author:** ![tkelman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkelman/32/692_2.png) [@tkelman](https://discourse.julialang.org/u/tkelman)\
**Post date:** [February 28, 2017, 12:53pm UTC](https://discourse.julialang.org/t/build-fails-with-cxx-g-unrecognized-command-line-options/2360/4 "2017-02-28T12:53:59Z")

</div>

Those arguments would only come from llvm-config.
