I am working on an assignment for my System Programming course which is a course using the linux terminal and C language. I own a mac and already require a windows VM for my other courses so I have no room for the linux machine and my professor said that my mac machine would work fine as it has the linux terminal.
We have to create a makefile file that will compile and link the c project together and create a .bin file, which is the basis of programming C in a linux environment, but I am getting errors with my makefile.
I believe it has to do with the difference between Linux and MacOS but I am not sure.
My makefile is as follows:
./bin/cryptoMagic: ./obj/main.o
cc ./obj/main.o -o ./bin/cryptoMagic
./obj/main.o: ./src/main.c ./inc/prototypes.h
cc ./src/main.c -c -o ./obj/main.o
When I run the make utility in the terminal I get this error message:
kyles-MacBook-Pro:~ KyleJensen$ cd Documents/School/First\ Year/Semester2/SystemProgramming/Assignments/Assign01/
kyles-MacBook-Pro:Assign01 KyleJensen$ make
cc ./obj/main.o -o ./bin/cryptoMagic
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [bin/cryptoMagic] Error 1
bin,obj,incandsrcsubdirectories? Does yourmain.ccontain amain(int argc,char*argv[])function? Can you add-I incto tell the compiler where your include files are?