Cygwin gcc adds the bottom prefix "_" to my characters. Where can I find documentation on this behavior?

I am trying to compile a gcc project on cygwin for the first time. The line does not work, because the lower level of the prefix for all characters. This leads to a symbol mismatch with the GLIB library (installed through the CYGWIN package management system), which does not have a main substring. Is this trend the placement of the leading subscript in any place?

+3
source share
2 answers

Use -fleading-underscoreand / or -fno-leading-underscoreto get the desired behavior. This question contains a lot of information about what you are doing.

+4
source

The cygwin compiler does this because Visual C ++ does. They try to minimize the number of unnecessary differences between them to help link code built with one to code created with another. Often there are other things that prevent you from using Cygwin code with Visual C ++ and vice versa, but this is not one of them.

+2
source

Source: https://habr.com/ru/post/1729606/


All Articles