Saturday, January 22, 2011

g++: unrecognized option -R

I was stuck with the unrecognized option -R error in makefile of COOL language. I myself have never used it though.

I found the solution on a maililng list

http://gcc.gnu.org/ml/gcc-help/2001-05/msg00086.html





The author suggests using -Wl or -rpath instead of -R . Refer to the above mailing list for more info.

"
This option is not portable.  It's actually a linker option, that GCC
accepts on a few targets for compatibility with the native compilers
of those platforms.  In general, you should use -Wl,-R to pass the
flag directly to the linker, if the linker supports it.  Sometimes
you'll find the spelling of the flag.  The GNU linker accepts both
-rpath and -R.

Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me
"

1 comment: