Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should be updated for Apple Silicon #12

Open
jproy opened this issue Dec 6, 2022 · 1 comment
Open

Should be updated for Apple Silicon #12

jproy opened this issue Dec 6, 2022 · 1 comment

Comments

@jproy
Copy link

jproy commented Dec 6, 2022

~/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

@cursedastronaut
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants