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