====================[ 构建 | 1_3_hello | Debug ]================================== "C:\Program Files\JetBrains\CLion 2021.1.3\bin\cmake\win\bin\cmake.exe" --build D:\vs\code\1\1.3-hello\cmake-build-debug --target 1_3_hello -- -j 12 [ 50%] Building CXX object CMakeFiles/1_3_hello.dir/main.cpp.obj D:\vs\code\1\1.3-hello\main.cpp: In function 'void list_head_insert(LNode*&)': D:\vs\code\1\1.3-hello\main.cpp:20:22: error: expected ';' before 'scanf' L->next = s;1 ^ ; scanf("%d", &number); ~~~~~ mingw32-make.exe[3]: *** [CMakeFiles\1_3_hello.dir\build.make:81: CMakeFiles/1_3_hello.dir/main.cpp.obj] Error 1 mingw32-make.exe[2]: *** [CMakeFiles\Makefile2:94: CMakeFiles/1_3_hello.dir/all] Error 2 mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:101: CMakeFiles/1_3_hello.dir/rule] Error 2 mingw32-make.exe: *** [Makefile:136: 1_3_hello] Error 2 这是出现了什么问题
时间: 2024-04-21 14:22:43 浏览: 18
根据你提供的信息,出现了一个编译错误。错误的位置在 `main.cpp` 文件的第 20 行,编译器期望在 `scanf` 语句之前有一个分号 `;`。你可以检查一下这一行的代码是否缺少了分号。正确的代码应该是这样的:
```cpp
L->next = s; // 注意这里没有分号
scanf("%d", &number);
```
如果问题仍然存在,请检查其他可能的语法错误或编译器选项。
相关问题
我遇到的错误如下||=== 构建: Debug 在 1-1 中 (编译器: GNU GCC Compiler) ===| C:\Users\16500\Desktop\myos\1-1\main.cpp|4|error: stray '\241' in program| C:\Users\16500\Desktop\myos\1-1\main.cpp|4|error: stray '\260' in program| C:\Users\16500\Desktop\myos\1-1\main.cpp|4|error: stray '\241' in program| C:\Users\16500\Desktop\myos\1-1\main.cpp|4|error: stray '\261' in program| C:\Users\16500\Desktop\myos\1-1\main.cpp|2|error: '::main' must return 'int'| C:\Users\16500\Desktop\myos\1-1\main.cpp||In function 'int main()':| C:\Users\16500\Desktop\myos\1-1\main.cpp|4|error: 'Hello' was not declared in this scope| C:\Users\16500\Desktop\myos\1-1\main.cpp|4|note: suggested alternative: 'ftello'| C:\Users\16500\Desktop\myos\1-1\main.cpp|4|error: 'Win32' was not declared in this scope| C:\Users\16500\Desktop\myos\1-1\main.cpp|4|note: suggested alternative: 'WIN32'| ||=== 构建 失败: 7 error(s), 0 warning(s) (0 分, 0 秒) ===|
这个错误信息显示了几个问题:
1. 在你的代码中,第4行存在一些奇怪的字符,这可能是由于复制粘贴时出现的问题。请检查代码并确保所有字符都是正确的。
2. 在第2行,你的main函数需要返回一个整数类型的值。在你的代码中,main函数没有返回值,所以编译器会报错。你需要将main函数的返回类型从void改为int,例如:
```
int main() {
// your code here
return 0;
}
```
3. 在第4行,函数尝试使用变量“Hello”和“Win32”,但编译器认为它们未被声明。你需要声明它们,或者确认你是否拼写错误。
请注意,这些错误可能与你的代码中的其他问题有关,因此您需要仔细检查代码并尝试解决它们。
10:53:28 **** Build of configuration Debug for project Hello_Brarebone **** make all Cannot run program "make" (in directory "D:\SVN\DVR\eclipse\soft\zw_barebone_sdk\workspace\wk02\Hello_Brarebone\Debug"): CreateProcess error=2, 系统找不到指定的文件。
这个错误提示是在进行项目构建时出现的,原因是系统找不到make命令。make是一个常用的构建工具,您需要先安装它,然后将其添加到系统环境变量中,以便您在任何位置都可以使用它。如果您使用的是Windows操作系统,可以通过安装Cygwin或MinGW来获取make命令。如果您使用的是Linux或macOS,可以通过包管理器安装make命令。安装完成后,您需要将make所在的目录添加到系统的PATH环境变量中,这样才能在任何位置运行make命令。