The beautiful detective story from C++ world.

Chapter I. There are two major C++ compiler GCC and Clang. The former is an old good warrior, the latter is a modern fancy boy. Clang can use GCC as a backend for some specific cases.
Chapter II. There is the One Definition Rule that demands the only one definition of a symbol in compilation context. Duplication is error, usually. The linker may detect it and fail linkage.
Chapter III. The linker may add debug information into a binary that contains the path to the source file with the line number for every symbol. It helps debugger to show sources.
Chapter IV. I have a project that I build with Clang + GCC-backend. And I get an error report from linker that the standard string is declared twice, ODR violation. And the linker points to the same file but slightly different line numbers...
Chapter V. It seems like GCC uses the first line of the symbol signature (excluding template<...>) and Clang uses the line with the opening `{`.
If the signature is multi-lined then GCC and Clang report symbol at a different location. And the linker is upset with it.
Final. Strip you symbols, be happy.
Epilogue. Clang produces different symbol tables if formatting style differs ;)

@newt As soon as there is an honorable successor!

@histeriaone we use a combination of rust and haskell instead of what used to be implemented in C++.

Sign in to participate in the conversation

Welcome to your niu world ! We are a cute and loving international community O(≧▽≦)O !