Original Post
So, I'm working on a simple program in C and I figured I may as well go ahead and use this to learn how to use makefiles. Now, I can get single file programs to work just fine, but now I'm trying to make a program that draws from two files. As you have probably already assumed, Project.c includes BinaryTree.h with includes BinaryTree.c and the makefile I'm trying to use (I took out all of the bash stuff, but it's still the same thing): When I run make, I get all sorts of "Multiple Definition of _something" errors. I'm guessing this means I'm linking them incorrectly because I know I never created any _somethings.
the directory structure looks like this:
Project
--Includes
-BinaryTree.h
--SRC
-BinaryTree.c
-Project.c
-Makefile
all: Project.o BinaryTree.o
ld Project.o BinaryTree.o
Project.o: BinaryTree.o
gcc -g SRC/Project.c
BinaryTree.o:
gcc -g SRC/BinaryTree.c