Skip to content

compiling

How to Compile FFmpeg 2.3 with Android NDK r10: Step-by-Step Tutorial with Build Script Modifications

Introduction

FFmpeg is a powerful open-source multimedia framework renowned for its ability to decode, encode, transcode, and stream audio and video. For Android developers working on legacy projects, there may be a need to integrate older versions of FFmpeg (such as 2.3) with older NDK versions (like r10e) due to compatibility constraints with existing codebases or target devices.

Note: FFmpeg 2.3 (released 2014) and Android NDK r10e (released 2015) are legacy versions. The current FFmpeg release is 9.x and the current NDK is r28c. NDK r10e uses the GCC 4.8 toolchain, which has been deprecated in favor of Clang since approximately NDK r16. This guide is intended for developers who specifically need these older versions for compatibility reasons. For new projects, consider using a current NDK release and the latest FFmpeg version.

Compiling FFmpeg for Android is non-trivial, especially with older NDK versions, as toolchains, build systems, and supported APIs have evolved significantly. This tutorial provides a detailed, step-by-step guide to compiling FFmpeg 2.3 using Android NDK r10e, including critical modifications to the build script to ensure compatibility with NDK r10e’s legacy toolchain structure. By the end, you’ll have static FFmpeg libraries (e.g., libavcodec.a, libavformat.a) ready to link into your Android project.

How to Compile GLib with Non-Standard Libffi Paths: Fixing 'No package libffi found' Configure Error

Introduction

GLib is a fundamental library for developing applications in C, providing core utilities like data structures, type systems, and OS abstraction. It’s a dependency for countless projects, including GTK, GNOME, and many others. While most users rely on precompiled packages (e.g., via apt, yum, or brew), there are scenarios where compiling GLib from source is necessary—for example, to use a specific version, apply custom patches, or target a non-standard environment.

A common roadblock during GLib compilation is the error: No package 'libffi' found. This occurs when the build system (Meson, which GLib uses since version 2.58) cannot locate the libffi library via pkg-config, a critical dependency for GLib’s foreign function interface (FFI) support. The error is especially prevalent if libffi is installed in a non-standard directory (e.g., /opt/libffi, ~/local, or a custom prefix), as pkg-config may not search these paths by default.

This blog post will guide you through resolving this error step-by-step, from understanding why it occurs to configuring GLib to recognize libffi in non-standard locations.

How to Compile 32-bit Assembly on 64-bit Ubuntu: Resolving Undefined Reference Errors with NASM and ld

Introduction

If you’re diving into assembly programming, targeting 32-bit architectures on a 64-bit Ubuntu system can be a common scenario—whether for learning, legacy software maintenance, or testing cross-architecture compatibility. However, 64-bit systems default to 64-bit tools and libraries, which often leads to frustrating errors like "undefined reference to _start" or "cannot find -lc" when compiling 32-bit assembly.

This guide demystifies the process of compiling 32-bit assembly code on 64-bit Ubuntu using NASM (Netwide Assembler) and ld (GNU linker). We’ll break down why these errors occur, walk through step-by-step solutions, and provide actionable troubleshooting tips to ensure your 32-bit assembly programs compile and run smoothly.

How to Compile and Run C++ Code in Linux Terminal with One Command: A Quick Guide

Introduction

If you’re a C++ developer or learner working on Linux, you’ve likely compiled and run code using separate terminal commands: first compiling with g++, then executing the output file. While this two-step process works, it can feel tedious—especially when testing small programs or making frequent changes. What if you could streamline this into a single command?

In this guide, we’ll walk through how to compile and run C++ code in the Linux terminal using one simple command. We’ll start with the basics (prerequisites, two-step compilation), then dive into combining these steps, adding useful optimizations, and troubleshooting common issues. By the end, you’ll save time and effort with a workflow that’s both efficient and easy to remember.

How to Fix 'cannot find -lGLU and -lGL' Compiling Error in Kubuntu Linux

Introduction

If you've ever tried compiling a C/C++ program that uses OpenGL (Open Graphics Library) on Kubuntu Linux, you might have encountered the frustrating error: cannot find -lGLU or cannot find -lGL. This error occurs when the GNU Compiler Collection (GCC) cannot locate the OpenGL libraries (libGL.so for GL and libGLU.so for GLU) during the linking phase of compilation.

OpenGL is a critical graphics API for rendering 2D and 3D graphics, and GLU (OpenGL Utility Library) provides helper functions for tasks like matrix manipulation and curve rendering. Without these libraries, programs relying on OpenGL will fail to compile.

In this blog, we'll break down why this error happens, walk through step-by-step solutions to fix it, and troubleshoot common edge cases. By the end, you'll be able to compile your OpenGL projects smoothly on Kubuntu or any Debian-based distribution.

Note (2026): Starting with Ubuntu 24.04 LTS, the libgl1-mesa-dev package became a transitional dummy package. The recommended package for OpenGL development is now libgl-dev, provided by the libglvnd (GL Vendor-Neutral Dispatch) library. This guide covers both the legacy and current package names.

How to Compile an Objective-C Project on Ubuntu Linux: Step-by-Step Guide with Fraction Class Example

Introduction

Objective-C, historically tied to Apple’s macOS and iOS ecosystems, is a powerful object-oriented language built on C. While it’s most commonly used with Apple’s Xcode and Cocoa frameworks, you can also develop and compile Objective-C projects on Linux using open-source tools like GCC (GNU Compiler Collection) and GNUstep (an open-source implementation of Apple’s Cocoa/Foundation frameworks).

This guide will walk you through compiling an Objective-C project on Ubuntu Linux, using a practical example: a Fraction class that handles basic fraction arithmetic (addition, initialization, and string representation). By the end, you’ll understand how to set up dependencies, write Objective-C code, compile it, and troubleshoot common issues.

How to Fix 'GL/glew.h: No Such File or Directory' Error When Compiling OpenGL Programs on Linux Mint

Introduction

If you’ve ever tried compiling an OpenGL program on Linux Mint and encountered the error fatal error: GL/glew.h: No such file or directory, you’re not alone. This common issue arises when the compiler cannot locate the GLEW (OpenGL Extension Wrangler Library) header file, which is essential for managing OpenGL extensions.

GLEW simplifies the process of initializing and using OpenGL extensions by providing a uniform interface across different hardware and drivers. Without it, your code can’t access modern OpenGL features. In this blog, we’ll break down why this error occurs and walk through step-by-step solutions to fix it, ensuring your OpenGL projects compile smoothly.

Compiling PHP with cURL: Where is cURL Installed? Fixing 'easy.h Missing' Error

Introduction

Compiling PHP from source is a common practice for developers who need custom configurations, specific PHP versions, or optimizations tailored to their environment. One critical extension often required is cURL—a library for transferring data with URLs, essential for tasks like API calls, HTTP requests, and file downloads. However, a frequent roadblock during compilation is the dreaded 'easy.h' file not found error. This error occurs when PHP’s build system cannot locate cURL’s development files, particularly the easy.h header.

In this blog, we’ll demystify why this error happens, show you how to locate cURL on major operating systems (Linux, macOS, Windows), and provide a step-by-step guide to fix the easy.h missing error. By the end, you’ll be able to compile PHP with cURL support seamlessly.

Fixing arm-none-eabi-gcc Linking Error with libc.a: Resolving Standard C Functions (printf) in Cross-Compiling for FOX G20 V (AT91SAM9G20)

Introduction

Cross-compiling for embedded systems often involves navigating toolchain quirks, especially when working with standard C library (libc) functions like printf. If you’re targeting the FOX G20 V single-board computer (based on the AT91SAM9G20 ARM926EJ-S processor) and encountering linker errors like undefined reference to printf or missing symbols from libc.a, you’re not alone. These errors typically stem from missing system calls, misconfigured toolchains, or incorrect linker scripts—all critical for enabling libc functions on bare-metal or RTOS-based embedded systems.

This blog post demystifies the root causes of these linking errors and provides a step-by-step guide to resolve them. By the end, you’ll be able to compile and run code with printf and other standard C functions on the FOX G20 V.

How to Fix 'Enable Multithreading' Error When Compiling std::thread Code with g++ on Ubuntu

Introduction

If you’ve ever tried to compile a C++ program using std::thread with g++ on Ubuntu, you might have encountered a frustrating runtime error like this:

terminate called after throwing an instance of 'std::system_error'
  what():  Enable multithreading to use std::thread: Operation not permitted
Aborted (core dumped)

This error is surprisingly common, even for experienced developers. It occurs when your program tries to use multithreading via the C++ Standard Library’s std::thread but lacks the necessary system support to execute threads.

In this blog, we’ll demystify this error, explore its root causes, and provide step-by-step solutions to fix it. Whether you’re compiling directly with g++ or using build systems like CMake, we’ll cover everything you need to get your multithreaded code running smoothly on Ubuntu.