Skip to content

Instantly share code, notes, and snippets.

@frsyuki
Created February 22, 2009 02:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frsyuki/68310 to your computer and use it in GitHub Desktop.
Save frsyuki/68310 to your computer and use it in GitHub Desktop.
gcc -fPIC -c clib.c -o clib.o
g++ -fPIC -c cxxlib.cc -o cxxlib.o
gcc -fPIC -shared clib.o cxxlib.o -o libtest.so
echo "g++ prog.cc -L. -ltest -o prog_cxx"
g++ prog.cc -L. -ltest -o prog_cxx
echo "gcc prog.c -L. -ltest -o prog_c"
gcc prog.c -L. -ltest -o prog_c
LD_LIBRARY_PATH=`pwd` ./prog_cxx
LD_LIBRARY_PATH=`pwd` ./prog_c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment