0

Following the NACI guide to build the SDK examples worked perfectly. Now I'm going to build my own shared library to practice.

I used the following command to compile eightball.cc into eightball_x86_32.o with no problem.

i686-nacl-g++ -o eightball_x86_32.o -c eightball.cc -m32 -g -O0 -pthread -std=gnu++98 -Wno-long-long -Wall -fPIC

But when I want to link eightball_x86_32.o into eightball_x86_32.so, the compiler says cannot find -lppapi_cpp.

i686-nacl-g++ -o libeightball.so eightball_x86_32.o -m32 -g -ldl -lppapi_cpp -lppapi -shared

/Users/Shih/nacl_sdk/pepper_29/toolchain/mac_x86_glibc/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/bin/ld: cannot find -lppapi_cpp

collect2: ld returned 1 exit status

NaClPM
  • 131
  • 1
  • 4

1 Answers1

1

The ppapi_cpp library and other higher level libraries such as nacl_io live under $NACL_SDK_ROOT/lib. You need to add the requisite library path to your link command (e.g. -L$NACL_SDK_ROOT/lib/glibc_x86_32/Debug).

NaClPM
  • 131
  • 1
  • 4