Score:0

Make command not working - relocations in generic ELF

in flag
Orf

I am new to ubuntu, I am trying to use make to compile code for an assignment, however the make command is not working, and deletes some of the files that are needed for my assignment. The Makefile was provided by my professor, so I am not sure what the issue could be.

This is the message that I get when I run make:

gcc -c  -Wall -I. -fpic -g -fbounds-check   student.c -o student.o 
gcc   -o tester tester.o student.o ref.o
/usr/bin/ld: tester.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: tester.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: tester.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: tester.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: tester.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: tester.o: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
make: *** [Makefile:10: tester] Error 1

Here is the Makefile in case this is the issue, but my professor told us that we are not supposed to make any changes to this file:

CC=gcc
CFLAGS=-c  -Wall -I. -fpic -g -fbounds-check  

OBJS=tester.o  student.o ref.o

%.o:    %.c %.h
    $(CC) $(CFLAGS) $< -o $@ 

tester: $(OBJS)
    $(CC) $(LDFLAGS)  -o $@ $^

clean:
    rm -f student.o tester.o tester
David avatar
cn flag
Are you sure it works on the unstated version of Ubuntu you are running?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.