midi-parser
midi-parser copied to clipboard
Should be updated for Apple Silicon
~/Desktop/midi-parser-master/src$ gcc midi-parser.c -o midi-parser Undefined symbols for architecture arm64: "_main", referenced from: implicit entry/start for main executable ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
// same with make
You're trying to compile it, not as an object file, but as an executable. It is meant to be compiled with your own program that will make use of it, hence why it has no main function. It is not caused by the arm64 architecture.
To compile with your program, you can either do this:
gcc yourprogram.c midi-parser.c -o midi-parser
Where yourprogram.c
will actually contain a main()
function, and everything making use of midi-parser
.
Or, you can compile it to object first using -c
, then compile the other objects,
and finally, combine them together in an executable:
gcc -c midi-parser.c -o midi-parser.o #object file
gcc -c yourprogram.c -o yourprogram.o #object file, containing main, example
gcc yourprogram.o midi-parser.o -o final-executable #Executable file