R
R
Respa2018-08-05 17:34:32
C++ / C#
Respa, 2018-08-05 17:34:32

Why does the compiler throw an error [Error] ld returned 1 exit status?

Hello!
I'm trying to populate a list with information from a file. The compiler outputs the following:
undefined reference to `OpenRusEng'
[Error] ld returned 1 exit status
Can't figure out why?
C language (not found in the list)

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<windows.h>

typedef struct { 
    char eng[100];
    char rus[100];
    struct dictionary *prev, *next;
    } dictionary;
    
dictionary *first=NULL, *tail_end=NULL;

void OpenEngRus() 
      { 
        FILE* fer;
        fer=fopen("en_rus.dat","rb"); 
        if(fer != NULL) 
          { 
            while(!feof(fer)) 
              { 
                dictionary* eng_rus = (dictionary *)malloc(sizeof(dictionary)); 
                fread(eng_rus,sizeof(dictionary),1,fer); 
                add_EngRus(eng_rus);
              } 
            fclose(fer); 
          } 
      }
void add_EngRus(dictionary* eng_rus) 
        { 
          if(first == NULL) 
            {
              first = eng_rus; 
              eng_rus -> prev = tail_end; 
              eng_rus->next = NULL; 
            }
          if(tail_end != NULL) 
            {
              tail_end->next =eng_rus; 
              tail_end=eng_rus; 
            }
        }

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
jcmvbkbc, 2018-08-05
@jcmvbkbc

undefined reference to `OpenRusEng'

ld is probably right: there really is no such function in the above code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question