简体   繁体   中英

Play MP3 file in NaCl

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

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 (eg -L$NACL_SDK_ROOT/lib/glibc_x86_32/Debug).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM