Help for this page

Select Code to Download


  1. or download this
       extern "C" {
          void say_hi();
       }
    
  2. or download this
       #include <cstdio>
       #include "say_hi.h"
       void say_hi(){
       printf("hello workd!\n");
       }
    
  3. or download this
    g++ -I. -fPIC -c *.cpp
    g++ -shared *.o -I. -olibsay_hi.so
    
  4. or download this
    >perl -e 'use Inline CPP=>q{  \
     #include "say_hi.h" \
     void test(){return say_hi(); } \
     }, INC=>"-I.",LIBS=>"-lsay_hi"; test()'
    
  5. or download this
    perl: symbol lookup error: /home/xxx/test_so/_Inline/lib/auto/e_8555/e_8555.so: undefined symbol: say_hi
  6. or download this
    #include "say_hi.h"
    main() {
      say_hi();
    }
    
  7. or download this
    g++ -L. -lsay_hi test.cpp -o test
  8. or download this
    >test
    hello workd!