首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >vscode关于c语言调用外部函数的bug?

vscode关于c语言调用外部函数的bug?

提问于 2023-06-03 21:23:05
回答 0关注 0查看 75

大佬看一下我这个test1.c调用test2-4.h为什么报错?

报的这个错误

C:\Users\liyua\AppData\Local\Temp\ccEB9Qjv.o:test1.c:(.text+0xe): undefined reference to `test'

collect2.exe: error: ld returned 1 exit status

下面是代码

test1.c

#include<stdio.h>

#include "test2-4.h"

void main(){

//printf("hello world\n");

test();

}

test2-4.c

#include <stdio.h>

#include "test2-4.h"

static void test_print(){

printf("testprintf\n");

}

void test(){

test_print();

}

test2-4.h

#ifndef _TEST_H_

#define _TEST_H_

void test(void);

#endif

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档