Google chrome 如何在Linux上构建PPAPI插件?

Google chrome 如何在Linux上构建PPAPI插件?,google-chrome,google-chrome-extension,Google Chrome,Google Chrome Extension,如何在Linux上为Chromium构建PPAPI插件 例如,我想构建项目提供的存根示例 到目前为止,我有以下Makefile libexample.so.1.0.1:example.o g++ -shared -Wl,-soname,libexample.so.1 -o libexample.so.1.0.1 example.o -lc -lppapi_cpp -lppapi_cpp_objects -L /home/carlos/Desktop/ppapi/example/ exa

如何在Linux上为Chromium构建PPAPI插件

例如,我想构建项目提供的存根示例

到目前为止,我有以下Makefile

libexample.so.1.0.1:example.o
    g++ -shared -Wl,-soname,libexample.so.1 -o libexample.so.1.0.1 example.o -lc -lppapi_cpp -lppapi_cpp_objects -L /home/carlos/Desktop/ppapi/example/

example.o:
    g++ -fPIC -Wall -g -c stub.cc -o example.o -I /home/carlos/Desktop/

clean:
    rm example.o libexample.so.1.0.1

run:
    google-chrome -d --register-pepper-plugins="/home/carlos/Desktop/ppapi/examples/stub/libexample.so.1.0.1;application/x-ppapi-example" 
但是,libexample.so.1.0.1缺少符号

nm libexample.so.1.0.1 --demangle -u | grep pp::
给我这个:

U pp::Module::Get()
U typeinfo for pp::Module
U typeinfo for pp::Instance
那些符号在哪里?我发现了

make-n

允许复制复杂的Makefile正在执行的操作。从那以后,这是一个反复试验的问题。下面是适合我的Makefile

libppapi_example.so:stub.o
    g++ -shared  -pthread -Wl,-z,noexecstack -Wl,-soname=libppapi_example.so -o libppapi_example.so -Wl,--start-group stub.o libppapi_cpp.a libppapi_cpp_objects.a -Wl,--end-group 

stub.o:
    g++  '-DNO_HEAPCHECKER' '-DCHROMIUM_BUILD' '-DENABLE_REMOTING=1' '-DENABLE_GPU=1' '-D__STDC_FORMAT_MACROS' '-DDYNAMIC_ANNOTATIONS_ENABLED=1' '-D_DEBUG' -I/home/carlos/Desktop/chromium/src/ -Werror -pthread -fno-exceptions -Wall -Wno-unused-parameter -Wno-missing-field-initializers -D_FILE_OFFSET_BITS=64 -fvisibility=hidden -pipe -fPIC -fno-strict-aliasing -fPIC -fvisibility=hidden -fvisibility=hidden -O0 -g -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -MMD -MF stub.o.d.raw -c -o stub.o stub.cc

clean:
    rm -f stub.o.d.raw stub.o libppapi_example.so

run:
    google-chrome -d --register-pepper-plugins="/home/carlos/Desktop/ppapi/examples/stub/libppapi_example.so;application/x-ppapi-example" 

我试图实现一个可信插件,并希望使用辣椒的C++ API(现在我坚持16版)。有人能告诉我在哪里可以找到“libppapi_cpp.a libppapi_cpp_objects.a”库吗?“libppap_cpp.a”包含在newlib和glibc的NACL-SDK交叉编译文件夹中。。。但据我所知,这些交叉编译环境只用于NaCl模块。有人能给我指出正确的方向吗?(当使用C-API时,你不必链接任何LIBS…所以我的插件确实与C-API……但是我想使用C++ API)。提前谢谢@Superfi听起来像是个新问题。也许你会更成功地得到这样的答案。谢谢你的回复。一开始我还想把它作为一个新的问题。。。但后来我想既然你的Makefile中有“-lppapi_cpp-lppapi_cpp_对象”,你也许可以帮我找到这两个对象的位置。@superisi,我一年前就做过这个。我不记得它是如何运作的,我相信它在几年后已经改变了。