Template operator linker error

前端 未结 3 786
我寻月下人不归
我寻月下人不归 2020-12-19 20:28

I have a linker error I\'ve reduced to a simple example. The build output is:

debug/main.o: In function main\':
C:\\Users\\Dani\\Documents

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-19 20:45

    When you create a template, you should either put definition in the header or use export keyword in cpp. Unfortunately, many(almost all) compilers just ignore export in such context, so the only option you have is to put definition into your header file.

提交回复
热议问题