Files
strangecpp/cpplinker/07_linker_errors/undefined_ref/build.sh
2026-02-24 10:21:15 +01:00

9 lines
275 B
Bash

#!/bin/bash
echo "=== This build SHOULD fail with 'undefined reference' ==="
echo ""
g++ -std=c++17 main.cpp -o app 2>&1 || true
echo ""
echo "The linker cannot find a definition for add(int, int)."
echo "Fix: provide the .cpp that defines it, or link the correct library."