C++ on macOS: how to compile native code and which language to choosePhoto by Daniil Komov on Pexels
Technology
Технологии

C++ on macOS: how to compile native code and which language to choose

Notícias Portugal5 September 2026 at 12:22

Programming in C++ on macOS is an accessible and surprisingly positive experience, especially for developers coming from Linux. The system uses the Apple Clang compiler and the libc++ standard library, with Command Line Tools providing all the necessary tools to start coding directly in Terminal. The platform is particularly efficient on Macs with Apple Silicon ARM64 architecture.

The integration of Clang and LLVM as part of Apple's official development environment allows compiling executables natively for ARM64. Command Line Tools can be installed without needing the full Xcode, simply by running the xcode-select --install command in Terminal. The main differences compared to Linux lie in macOS-exclusive tools, such as proprietary SDKs, binaries in Mach-O format, and utilities like xcrun, otool, and LLDB for debugging.

The transition can present challenges, such as the incompatibility of specific GNU libraries, like bits/stdc++.h, which do not belong to the C++ standard. To avoid conflicts, using portable alternatives that include only the necessary headers is recommended. Although Swift is the preferred language for new applications on Apple platforms, C++ maintains a vital role in high-performance contexts, such as engines and cross-platform software libraries.

The interoperability between Swift and C++ allows combining both worlds, enabling high-performance components to be maintained in C++ while part of the software is written in Swift. With the right tools and mastering the environment differences, developers can have a productive experience programming in C++ on macOS.

Related articles

É provavelmente a camisa mais feia do mundo… mas pode torná-lo “invisível” aos olhos da IA
Technology

It's probably the ugliest shirt in the world... but it can make you "invisible" to AI's eyes

Researchers have developed a shirt printed with specific patterns that, although considered visually unpleasant, manages to "fool" visual recognition artificial intelligence systems, making the person theoretically "invisible" to AI-equipped cameras. The trick doesn't involve magic or real invisibility, but rather the exploitation of vulnerabilities in computer vision algorithms, exploring how these neural networks process and interpret visual patterns in ways that differ from human perception.

SAPO Notícias05/09/26, 13:00
Technology

Half of young people have already faced hate messages online. What is at stake?

A report from EU Kids Online 2025 reveals that half of young people have already been exposed to hate messages online, with Susana Batista, one of the study's coordinators, highlighting the risks that children and adolescents face when accessing social media. The research alerts to the need for greater protection of young people in the digital environment.

CNN Portugal05/09/26, 12:39
Technology

Manufacturers warn: do not put hot food in the refrigerator and these are the reasons

Appliance manufacturers such as Bosch and LG warn that placing very hot food in the refrigerator can compromise the appliance's efficiency and food safety. When hot food is introduced, the interior temperature rises quickly, forcing the compressor to work longer to recover the cold, which increases energy consumption. Additionally, the steam and moisture released can cause condensation and ice formation. The recommendation is to let food cool briefly, divide it into small, shallow containers, and refrigerate it within a maximum of two hours to prevent the proliferation of microorganisms in the temperature danger zone.

Postal do Algarve05/09/26, 12:00
Technology

Douro Museum Awarded Gold Usability and Accessibility Seal

The Douro Museum's mobile application was distinguished with the Usability and Accessibility Seal – Gold Degree, a certification that recognizes full compliance with digital accessibility criteria. Launched on September 1st, with support from the Recovery and Resilience Plan, the pioneering application provides content in various formats, including Portuguese Sign Language, audio description, and audio versions in multiple languages, having been tested with real users, including people with disabilities. This distinction positions the museum as a national reference in digital inclusion.

Canal N – Notícias – Trás-os-Montes e Alto Douro05/09/26, 11:55