Jump to content

Compile error help

- - - - -

  • Please log in to reply
1 reply to this topic

#1
breimer273

breimer273

    Newbie

  • Members
  • PipPip
  • 16 posts
Hey all, I need some help with yet another compile error. First here is the error:

gcc Assignment3.o main.o list_node.o -o Assignment3

gcc main_css_html.o HTMLMaker.o CSSMaker.o -o CreateHTML

HTMLMaker.o: file not recognized: File format not recognized

collect2: ld returned 1 exit status


From the research that I did I gathered that the file not recognized thing usually happens when there is no file extension specified. Clearly in this case I have specified the file extension. Also, since I am not very good with Makefiles and I know that the problem very well could be in the makefile I will include that:

CC = gcc

INC = -I.

FLAGS = -W -Wall 


all: Assignment3 Tester CreateHTML HTMLTester


Assignment3: Assignment3.o main.o list_node.o

	$(CC) $^ -o $@

	

CreateHTML: main_css_html.o HTMLMaker.o CSSMaker.o

	$(CC) $^ -o $@

	

Tester: test.o list_node.o Assignment3.o

	$(CC) $^ -o $@

	

HTMLTester: HTMLMaker.o CSSMaker.o main_test.o TestHTMLMaker.o TestCSSMaker.o

	$(CC) $^ -o $@


Assignment3.o: Assignment3.c Assignment3.h

	$(CC) -c $(FLAGS) $(INC) $< -o $@

	

main.o: main.c

	$(CC) -c $(FLAGS) $(INC) $< -o $@

	

test.o: test.c

	$(CC) -c $(FLAGS) $(INC) $< -o $@

	

list_node.o: list_node.c list_node.h

	$(CC) -c $(FLAGS) $(INC) $< -o $@


main_tester.o: main_test.c

	$(CC) -c $(FLAGS) $(INC) $< -o $@

	

TestHTMLMaker.o: TestHTMLMaker.c TestHTMLMaker.h

	$(CC) -c $(FLAGS) $(INC) $< -o $@

	

TestCSSMaker.o: TestCSSMaker.c TestCSSMaker.h

	$(CC) -c $(FLAGS) $(INC) $< -o $@

	

HTMLMaker.o: HTMLMaker.h HTMLMaker.c

	$(CC) -c $(FLAGS) $(INC) $< -o $@

	

CSSMaker.o: CSSMaker.c CSSMaker.h

	$(CC) -c $(FLAGS) $(INC) $< -o $@

	

main_css_html.o: main_css_html.c

	$(CC) -c $(FLAGS) $(INC) $< -o $@


.PHONY : clean

clean:

	-rm -f *.o Assignment3 Tester CreateHTML


Thanks for the help and if you need any more information please let me know.

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
I believe you can type make --debug=v to have the make file print out all its actions as verbose, and you can spot where exactly at which step the make file fails at. You can then try manual compilation yourself at those steps.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users