Vika
Vika

Reputation: 153

g++ error unrecognized command line option

I'm trying make Makefile.

I get error:

g++: error: unrecognized command line option ‘-Wl’
g++: error: unrecognized command line option ‘--out-implib’

Can someone please explain what's the problem and how can I fix it?

Thanks.

Upvotes: 1

Views: 19871

Answers (1)

Michael Trausch
Michael Trausch

Reputation: 3165

Please show the entire command line, or nobody is going to be able to help you.

The GCC compiler driver can be called as either "gcc" or "g++" (and on many systems "cc" or "c++"). The -Wl command-line option tells the compiler driver to pass the following comma-separated options to the linker.

You'll want to verify that g++ is in fact the GNU compiler on your system, and not something that pretends to be the GNU compiler.

Note that --out-implib as a linker flag is only applicable on systems that use the PE binary format (that is, Microsoft Windows, ReactOS, older versions of BeOS, and a largely-forgotten operating system called SkyOS). If you're building software for any other platform, the linker will reject that option.

Anyway, need to see the whole command-line. If you're using "make" to build the software in question, paste the command line immediately proceededing the error message. If you're using a "-j" option to make, remove it so as to ensure that you're finding the correct failing invocation.

Upvotes: 3

Related Questions