0

I am making a release mod makefile but there is a error(I am on macos big sur): ld: warning: option -s is obsolete and being ignored

g++ -c src/*.cpp -std=c++17 -m64 -O3 -Wall -I include && g++ *.o -o bin/debug/Debug -s && ./bin/debug/Debug
  • 2
    By removing the `-s` option as pointed out by the message? – MikeCAT Jun 03 '21 at 18:26
  • 2
    Also [Please do not post images of code and other texts because they are hard to use.](https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-errors-when-asking-a-question) Texts should be posted directly **as text** in your question. – MikeCAT Jun 03 '21 at 18:26
  • 1
    @MikeCAT, I would imagine OP would also like a way to still accomplish the equivalent as well. –  Jun 03 '21 at 18:27
  • what do you mean by that – Jaden Wong Jun 03 '21 at 18:27
  • 2
    Does this answer your question? [G++ compiler: option -s is obsolete and being ignored C++](https://stackoverflow.com/questions/7408692/g-compiler-option-s-is-obsolete-and-being-ignored-c) – mediocrevegetable1 Jun 03 '21 at 18:32

1 Answers1

2

As you are being told by the warning, the -s option that your makefile is passing to g++:

... && g++ *.o -o bin/debug/Debug -s && ...
                            here: ^^

doesn't do anything anymore. So you can just remove it from the script and the warning will go away. The warning comes from ld because g++ delegates part of the compilation process to it.

If you still want to strip the symbols table from the resulting binary, you need to do it as a post-build step with a separate tool, such as strip.