首页 > 解决方案 > 我在 Visual Studio Code 中不断收到“解析错误”和“找不到”错误

问题描述

我正在尝试从教程中学习一点 C 来为 Game Boy 编写游戏,但我不断收到两个错误:“解析错误”和“找不到”错误。谁能告诉发生了什么以及如何解决它?

我只尝试过运行我所拥有的,因为我对 C 语言非常陌生,并且了解不多。

我的主文件:

#include <gb\gb.h>
#include <stdio.h>

void main(){
    printf("HELLO WORLD");
}

我试图用这个 .bat 文件将其转换为 .gb:

c:\gbdk\bin\lcc -Wa-l -Wl-m -Wl-j -DUSE_SFR_FOR_REG -c -o main.o main.c
c:\gbdk\bin\lcc -Wa-l -Wl-m -Wl-j -DUSE_SFR_FOR_REG -o main.gb main.o

这是上面代码的结果:

PS C:\Users\cdbil\Documents\gameboycode\helloworld> .\make.bat

C:\Users\cdbil\Documents\gameboycode\helloworld>c:\gbdk\bin\lcc -Wa-l -Wl-m -Wl-j -DUSE_SFR_FOR_REG -c -o main.o main.c

main.c(1) parse error: token -> '' ; column 0

C:\Users\cdbil\Documents\gameboycode\helloworld>c:\gbdk\bin\lcc -Wa-l -Wl-m -Wl-j -DUSE_SFR_FOR_REG -o main.gb main.o
c:\gbdk\bin\lcc: can't find `main.o'
PS C:\Users\cdbil\Documents\gameboycode\helloworld>

标签: cgameboy

解决方案


推荐阅读