>> #ifndef UTIL_H >> #define UTIL_H >> >> #ifdef __cplusplus >> extern "C" { >> #endif >> >> >> void some_function_with_c_linkage(); >> >> #ifdef __cplusplus >> } >> #endif >> >> #endif /* UTIL_H */ >> > > Could you explain why this is necessary, and what it does? What is > necessary to use this?
"C compilers do not name mangle symbols in the way that C++ compilers do." http://en.wikipedia.org/wiki/Compatibility_of_C_and_C%2B%2B#Linking_C_and_C.2B.2B_code Basically, C++ supports function overloading (two functions with the same name that differ only in argument lists). The actual name of the function that is used by the linker has an encoded version of both the function name and its argument types in it. However, C does not need the same kind of name changing behavior because it doesn't support function overloading. --Peter _______________________________________________ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/