Setting up a Mac for Programming Classes

Hey, I'm João, I'm freshman in computer engineering. I'm not sure if this is the right place for it, but I'm having some trouble setting up my Mac for my programming classes, and since I'm the only one that uses a Mac in my class, nobody including my teacher have managed to help me.

Unfortunately, my teacher uses quite an old IDE to teach us, it's called Code::Blocks, I've had some trouble finding one version that works with macOS Monterey, but thankfully I did.

I've tried using Xcode and VSCode as my IDE's but I have the same problem as Code::Blocks, that my teacher uses a custom library for C (a .h file) and I don't know where to put this .h file so that I can include it using the #include<>.

The second thing, is that I haven't been able to make Code::Blocks compile projects, it compiles C files normally, but when it comes to projects, it either crashes or display the attached message in the terminal.

Thanks in advance! 😁

Answered by Hoffman in 706043022

This was recently asked elsewhere, and that IDE doesn't work very well if at all on any recent macOS, and macOS support appears to have been withdrawn.

Among other discussions: https://discussions.apple.com/thread/253619481

Your choices here are to use Xcode and not the Code::Blocks as your IDE (which'll mean less or no support from the instructor), or boot and use Windows or another supported platform directly or as a guest and use Code::Blocks, or re-port and support Code::Blocks to macOS—that you found something that ~works may or may not be helpful, if there are issues found later.

As for the H file with Xcode, add it to the project. Create a new file, of type C header file, and populate the header file accordingly. File > New > select macOS > C Header File. To reference a project local header file in C or C++, use double quotes around the filename, and not angle brackets.

Here's a screenshot of the Xcode IDE just having added a bogus header file to another C++ example I've posted elsewhere, with the include visible in the project to the left column and with the #include highlighted in the displayed C++ source. (There's nothing in BogoHeader.h here, but it compiles.)

There are various other Code::Blocks discussions around, but it's probably best to ask those questions over in the Code::Blocks forum.

Accepted Answer

This was recently asked elsewhere, and that IDE doesn't work very well if at all on any recent macOS, and macOS support appears to have been withdrawn.

Among other discussions: https://discussions.apple.com/thread/253619481

Your choices here are to use Xcode and not the Code::Blocks as your IDE (which'll mean less or no support from the instructor), or boot and use Windows or another supported platform directly or as a guest and use Code::Blocks, or re-port and support Code::Blocks to macOS—that you found something that ~works may or may not be helpful, if there are issues found later.

As for the H file with Xcode, add it to the project. Create a new file, of type C header file, and populate the header file accordingly. File > New > select macOS > C Header File. To reference a project local header file in C or C++, use double quotes around the filename, and not angle brackets.

Here's a screenshot of the Xcode IDE just having added a bogus header file to another C++ example I've posted elsewhere, with the include visible in the project to the left column and with the #include highlighted in the displayed C++ source. (There's nothing in BogoHeader.h here, but it compiles.)

There are various other Code::Blocks discussions around, but it's probably best to ask those questions over in the Code::Blocks forum.

Thank you so much for the answer Hoffman, helped a lot!

Setting up a Mac for Programming Classes
 
 
Q