使用M1 MacBook使用VsCode进行C的编写时候,其他的时候都可以编译通过,但是使用头文件的方式就会报错。
dream_ovo@deMacBook-Air Three_Chess % cd "/Users/dream_ovo/Documents/MyC/Three_Chess/" && gcc test.c -o test && "/Users/dream_ovo/Docu
ments/MyC/Three_Chess/"test
Undefined symbols for architecture arm64:
"_DisplayBoard", referenced from:
_game in test-829be1.o
"_InitBoard", referenced from:
_game in test-829be1.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
无
使用网上的autosave等均无效
编译通过
game.h的实现在game.c中,因此需要tast.c和game.c一起编译。
task.json中修改编译参数,添加game.c