0

I installed gcc/g++ following this tutorial a while ago (version 6.2). Now that I updated to Sierra, it's not compiling anymore.

When checking the version, it respond properly:

g++ --version

g++ (GCC) 6.2.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

But when I try to compile a code that has no compilation error (tried to use online compilers like cpp.sh and it compiled successfully) it outputs this weird message (as an image, for readability):

enter image description here

Any suggestions?

0

The issue comes from the fact that you're combining the GNU C++ compiler with the Clang assembler.

The Clang assembler expects you to use the new section names, and will warn you that you're using deprecated names.

However, please note that these are only warnings. You're free to ignore them and your program will work as before.

Your options are basically:

  1. Ignore the warnings

  2. Patch g++ with the patch found in this bugreport

  3. Use a different assembler

Or you could just use the system supplied c++ compiler instead of compiling your own.

  • Thanks for the explanation, I finally understood what those warnings meant. As you say, I can ignore the file, I even found a way of compiling it omitting the warnings in another answer (which I don't remember the link, unfortunately) using this command: g++ program_to_compile.cpp 2>&1 >/dev/null | grep -v -e '^/var/folders/*' -e '^[[:space:]]*\.section' -e '^[[:space:]]*\^[[:space:]]*~*' But I would like to also patch g++. I checked the link you provided, but don't know how to do it. Can you give me some direction on how to do it? – Miguel Péres Dec 11 '16 at 18:42
  • 1
    The command you have there just filters away the warnings from what is output on screen. The warnings are still there, just not displayed to you. Regarding the patch - please open terminal and run "man patch" to display the manual page for patch. It should explain you what you need to know. If it doesn't, I would strongly recommend that you do not try to patch your own compiler. Please mark the answer as accepted if it it explained the warnings for you and gave you a solution. – jksoegaard Dec 11 '16 at 18:47
  • Yes, I'm aware that this is just a filter. I will take a look at the manual, thanks! – Miguel Péres Dec 12 '16 at 1:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .