#Issue in compiling Makefile with gcc

9 messages · Page 1 of 1 (latest)

spring nacelle
#

Hello there, I've been making a Text based rpg game in C and recently I started learning about Makefiles. When I tried making one for this project, I couldn't seem to get it to work. Any help would be appreciated.

Makefile-

bin/C-RPG.exe: bin/main.o
    gcc bin/main.o -o bin/C-RPG.exe

bin/main.o: src/main.c
    gcc src/main.c -o bin/main.o

You can take a look at the repo here if you need to know how i structured the files: https://github.com/Jiggly-Balls/C-RPG/tree/main

when i run make i run into this error: https://pastebin.com/tv2Bm2yx

GitHub

A text based RPG game made in C. Contribute to Jiggly-Balls/C-RPG development by creating an account on GitHub.

latent craneBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

spring nacelle
#

please ping me if you can help

#

I got it working

#

I was compiling my main.c file directly to an executable instead of an object file

#

had to pass in the -c flag to it

#

!solved

latent craneBOT
#

Thank you and let us know if you have any more questions!

This thread is now set to auto-hide after an hour of inactivity

warm parcel