Namespaces and includes generate link error

后端 未结 3 1838
忘了有多久
忘了有多久 2021-01-24 04:47

I was playing around with namespaces when I encountered a lnk2005 error. I can\'t figure out how to get around the error. Here\'s the error:

1>Source.obj :          


        
3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-24 05:49

    Everywhere you're including Chart.h, you're effectively dropping variables t, l, and d into those objects. Declare them as extern, then define them in Chart.cpp

提交回复
热议问题