Search code examples
gcccygwinsymbolsprefix

Cygwin gcc is adding an underbar "_" prefix to my symbols. Where can I find documentation on this behavior?


I am trying to compile a gcc project on cygwin for the first time. The build is failing, because an underbar is being prefixed to all symbols. This is causing a symbol mismatch to the GLIB library (installed via CYGWIN package management system) which does not have the leading underbar. Is this tendency to place a leading underbar documented in some place?


Solution

  • Use -fleading-underscore and/or -fno-leading-underscore to get the behaviour you want. This question has a lot of information related to what you're doing.