M1 gcc compile error

Hi,

I am trying to use command line tools gcc on MacBook M1. It is throwing some strange errors, for example the printf function throws.

Thanks for any advice that you may be able to provide,

:)

Replies

You're unlikely to get useful errors without posting the code that you're trying to compile.

Thanks. I ended up just trying to compile anything. The file only contained an import of stdio and printf("test"), also declaring a basic char array seems to be impossible.

I'll stick with Linux

In that example, you have not declared main(). Every program must have a main(). So you get an error saying "undefined symbol main".

This is exactly the same error that you would get on Linux.

  • Hi,

    Thanks for your comment. You're right, how silly of me, too much Python methinks. Once I had a main method, it compiled just fine :)

Add a Comment