0

Dear I am new in C++ and Linux as well I am getting the folliwng error while compiling a programm

/usr/bin/ld: unrecognized option '-plugin'

/usr/bin/ld: use the --help option for usage information

collect2: error: ld returned 1 exit status

The installed gcc compiler is gcc version 4.4.5 (Debian 4.4.5-8)
any help would be appreciated.

Regards

user3865190
  • 49
  • 1
  • 3

1 Answers1

3

Your Makefile must be passing the -plugin option to the linker - it's your make configuration that you have to fix. There are three locations to check off the top of my head:

  • Look for a -plugin option being inserted into the LDFLAGS variable. The contents of that variable are passed straight to the linker as arguments.

  • Look for a -Wl,-plugin option being inserted into the CFLAGS variable. That variable is passed as an argument list to the compiler, and gcc uses the -Wl,... option to pass arguments to the linker.

  • Look for either option being used in a direct call to ld or gcc (or cc, or c++ or...).

Bottom line: grep your make configuration files and any scripts used in your build system for -plugin and make sure that option only goes where it should.

thkala
  • 84,049
  • 23
  • 157
  • 201
  • 2
    option four: Your version of the linker is too old for the version of gcc that you are using. The linker is provided by the `binutils` package. Install a newer version (e.g. binutils/7.30) and you will find that this error message goes away. – Keith Hanlan Aug 23 '19 at 19:49