Initial commit
This commit is contained in:
12
namecollision/build.sh
Normal file
12
namecollision/build.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
OPT="${1:--O0}"
|
||||
|
||||
# Compile hello.cpp as a shared library
|
||||
g++ -std=c++17 "$OPT" -shared -fPIC -o libhello.so hello.cpp
|
||||
|
||||
# Compile and link main.cpp with the shared library
|
||||
g++ -std=c++17 "$OPT" -o main main.cpp -L. -lhello -Wl,-rpath,'$ORIGIN'
|
||||
|
||||
echo "Build successful"
|
||||
Reference in New Issue
Block a user