做读书笔记的网站,高校招生网站模板,前端开发岗位,pc网站转换成app问题描述
C语言在编译的时候#xff0c;提示链接的时候没有找到相应的方法
问题分析
代码文件结构#xff1a; test.c test/1.c test/1.h test.c代码#xff1a; #include “test/1.h” void main() { hello(); } test/1.c代码#xff1a; void hello() { printf(“hel…问题描述
C语言在编译的时候提示链接的时候没有找到相应的方法
问题分析
代码文件结构 test.c test/1.c test/1.h test.c代码 #include “test/1.h” void main() { hello(); } test/1.c代码 void hello() { printf(“hello”); } test/1.h代码 #include “stdio.h” void hello(); 问题解决
由于IDE使用的是vscode, 它使用json文件来管理编译需要修改json文件
task.json文件
{tasks: [{type: cppbuild,label: C/C: cl.exe build active file,command: cl.exe,args: [/Zi,/EHsc,test\\1.c,//修改这里/Fe${fileDirname}\\${fileBasenameNoExtension}.exe,${file}],options: {cwd: ${fileDirname}},problemMatcher: [$msCompile],group: {kind: build,isDefault: true},detail: Task generated by Debugger.}],version: 2.0.0
}