When using fstream in a library I get linker errors in the executable

前端 未结 2 1049
轮回少年
轮回少年 2021-01-25 09:24

When I add

#include 

and try to use

std::ifstream (i.e. std::ifstream ifile(pDest))

in my lib

2条回答
  •  孤独总比滥情好
    2021-01-25 09:40

    for anyone like me that this answer did not ring helpful, a second option is to go to: Project Properties->Configuration Properties->General->Project Defaults->.NET Target Framework Version and set it to v4.0

    https://connect.microsoft.com/VisualStudio/feedbackdetail/view/806238/unwarranted-linker-errors-using-stl-filestream-class-in-managed-classes-in-c-11-cli has an obscure answer from Microsoft team that fixed my issue.

    I also added this answer to another version of the same problem.

提交回复
热议问题