linking files in c( multiple definition of…)
问题 Im trying to link a few files in c and im getting this erorr: "multiple definition of createStudentList" my main.c: #include "students.h" int main(void) { return 0; } students.h: #ifndef _students_h_ #define _students_h_ #include "students.c" bool createStudentList(); #endif students.c: #include <stdbool.h> typedef struct Students { int id; double average; } Student; bool createStudentList() { return true; } 回答1: Due to the includes, you have the function createStudentList() defined in both