gpt4 book ai didi

c++ - 未定义对示例无效函数的引用

转载 作者:行者123 更新时间:2023-11-28 02:10:48 24 4
gpt4 key购买 nike

<分区>

好吧,我想了解与 header 和其他 .cpp(例如函数)的链接,所以我的问题是为什么我得到“未定义的对'afis()的引用。有示例示例,我想澄清一下。也很抱歉我的英语不好 :D.

主要有:

#include <iostream>
#include "functions.h"

using namespace std;
int main()
{
afis();
return 0;
}

有一个名为function.cpp的函数:

#include <iostream>

using namespace std;

void afis(){
cout <<"yehe";
}

还有标题:

#ifndef FUNCTIONS_H_INCLUDED
#define FUNCTIONS_H_INCLUDED

void afis();

#endif // FUNCTIONS_H_INCLUDED

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com