a g++ problem about the order of object files needed to link
Jonathan Wakely
jwakely.gcc@gmail.com
Tue Jun 12 16:22:00 GMT 2018
On 12 June 2018 at 06:49, 刘超杰 wrote:
> Hi:
> When I was using g++, I found a problem, maybe which is a bug or not.
This is the wrong mailing list for your question. Please use the
gcc-help@gcc.gnu.org list for help and questions about GCC.
> It is about the order of object files needed to link, if you change the order of files, the result is different. I can duplicate the problem, and I have write an example, whose git address is: https://github.com/Erician/problems/tree/master/cpp/obj_order. If you know why, please tell me. Thanks.
This is an unfortunate property of how C++ works, see
https://isocpp.org/wiki/faq/ctors#static-init-order
More information about the Gcc
mailing list