一个或多个多重定义符号的原因发现错误? [英] reason for one or more multiply defined symbols found error?

查看:32
本文介绍了一个或多个多重定义符号的原因发现错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码:为什么会出现错误找到一个或多个多重定义的符号?"

here is my code: why does the error "one or more multiply defined symbols found?"

#include <stdio.h>
#include "person.h"

void main() {
   FILE* census;
   int status;
   int data_read;
   person student[10];

   census = fopen("mycensus.dat","r");

   if (census == NULL) { 
        printf("File not opened!");
   }
   else{
        data_read = fread(student, sizeof(person), 10, census);
        if (data_read != 10) {
            printf("Not all data was read from file!");
        }
   }
}

推荐答案

很可能,这与 person.h 中包含的内容有关.

Most likely, this has something to do with what's being included in person.h.

这篇关于一个或多个多重定义符号的原因发现错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆