简体   繁体   English

在NaCl中播放MP3文件

[英]Play MP3 file in NaCl

Following the NACI guide to build the SDK examples worked perfectly. 遵循NACI指南构建SDK示例非常有效。 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. 我使用下面的命令毫无问题地将sevenball.cc编译为sevenball_x86_32.o。

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. 但是,当我想将sevenball_x86_32.o链接到sevenball_x86_32.so时,编译器会说找不到-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 /Users/Shih/nacl_sdk/pepper_29/toolchain/mac_x86_glibc/bin/../lib/gcc/x86_64-nacl/4.4.3/../../../../x86_64-nacl/bin/ld:找不到-lppapi_cpp

collect2: ld returned 1 exit status collect2:ld返回1退出状态

The ppapi_cpp library and other higher level libraries such as nacl_io live under $NACL_SDK_ROOT/lib. ppapi_cpp库和其他更高级别的库(例如nacl_io)位于$ 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). 您需要在链接命令中添加必需的库路径(例如-L $ NACL_SDK_ROOT / lib / glibc_x86_32 / Debug)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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