fix: enforce global flags and clean build for ofxPiMapper to resolve undefined reference errors

This commit is contained in:
Timothy Hofland
2026-03-13 16:33:45 +01:00
parent 043e2123f4
commit 1c034f1e89

View File

@ -276,10 +276,15 @@ for f in $(find src -type f -name "*.cpp"); do
grep -q "<algorithm>" "$f" || sed -i '1i #include <algorithm>' "$f"
done
# Build Example (Force C++17 for better compatibility with this addon)
# Build Example
cd "$REAL_HOME/openFrameworks/addons/ofxPiMapper/example_basic"
echo "Starting compilation (Forcing C++17)..."
sudo -u "$REAL_USER" make -j1 USER_CFLAGS="-Wno-error -std=c++17" USER_CPPFLAGS="-std=c++17"
echo "Cleaning old objects to ensure consistent symbol generation..."
sudo -u "$REAL_USER" make clean
echo "Starting compilation (Global Flags)..."
# Using PLATFORM_CFLAGS ensures these flags propagate to the addon source as well
GLOBAL_FLAGS="-Wno-error -Wno-reorder -Wno-sign-compare -Wno-delete-non-virtual-dtor -std=c++17"
sudo -u "$REAL_USER" make -j1 PLATFORM_CFLAGS="$GLOBAL_FLAGS" USER_CFLAGS="$GLOBAL_FLAGS" USER_CPPFLAGS="-std=c++17"
cp bin/example_basic /usr/local/bin/ofxPiMapper
chmod +x /usr/local/bin/ofxPiMapper