[gccsdk] GCC 4.7.4 errors
leenoar at sky.com
Mon Nov 30 09:32:31 PST 2015
On 30/11/15 16:19, Gavin Wraith wrote:
> In message <565C58D2.4020703 at sky.com>
> Lee Noar <leenoar at sky.com> wrote:
>> The above symbols relate to C++ exceptions and are provided by
>> libstdc++. If you link with g++, then these should be resolved.
>> That's all C++ stuff, are you sure they haven't switched to C++?
>> Or is it still using g++ to compile lapi.c when it should be
>> using gcc? Did you figure that one out?
> I don't know why GCC thinks it is encountering C++. I wanted
> it to compile as C. I was surprised to see those output lines
> beginning with g++ and not gcc. As far as I can see the sources
> v5.3.1 (which compiled successfully as C) and v5.3.2 are
> just pure C. Because it keeps compiling with g++ and not
> gcc I wonder if there may be some system variable that
> sets the choice? I cannot see what in the sources should
> be responsible - there is nothing in the diff5.3.2-5.3.1
> file to suggest such a change.
> How does GCC decide which compiler to use?
It's more a case of how does make decide which compiler to use.
Normally, it's the source file suffix that determines it, so
file.c would cause make to invoke the rule for .c files which
would call the C compiler (gcc) and file.cpp would invoke the rule
for .cpp files which would call the C++ compiler (g++).
It sounds like the project _is_ pure C and should be compiled
as pure C, but for some reason the C++ compiler is incorrectly
being called for one or more files.
If you can zip up the project and email it to me, I'll have
a look and see if I can spot what's going wrong.
More information about the gcc