yyzybb537 / libgo

Go-style concurrency in C++11
MIT License
3.18k stars 754 forks source link

hello world,error C2061: syntax error: identifier 'RefObject' #288

Closed yangyongzhen closed 1 year ago

yangyongzhen commented 1 year ago

hello,i just wrote a simple hello world test, using vcpkg.exe install ligbo, on windows 10 x64 system, when durring install, no error occured,very smooth。

i just wrote a simple hello world test like this:

`#include

include <libgo/coroutine.h>

void foo() { printf("function pointer\n"); }

int main() { std::cout << "Hello, World!" << std::endl; go foo; go []{ printf("============3\n"); co_yield; printf("============4\n"); }; return 0; }`

i got this buliding error. why ? can you help? image

yangyongzhen commented 1 year ago

编码导致的问题!哎,又是关于utf-8 BOM的问题导致的。VC为嘛非要带BOM warning: C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失 error: C2001: 常量中有换行符 经过检查,发现所有文件编码都没有任何问题,都是utf-8编码。

yangyongzhen commented 1 year ago

解决办法在这里:https://blog.csdn.net/yyz_1987/article/details/128682076