views:

164

answers:

2

Hi -

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 tendancy to place a leading underbar documented in some place?

Thanks,

SetJmp

+5  A: 

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.

Carl Norum
+1  A: 

Cygwin's compiler does this because Visual C++ does. They're trying to minimize the number of needless differences between the two, to aid linking code built with one to code built with the other. There are often other things that prevent you from using Cygwin code with Visual C++ and vice versa, but this isn't one of them.

Warren Young