c++ - No type named 'VarDictionary' in namespace 'pp' using PNaCl -
can explain me why getting compile error
error: no type named 'vardictionary' in namespace 'pp' pp::vardictionary dictionary; ~~~~^
i'm tying set dictionary in function
virtual void handlemessage(const pp::var& message) { }
i copied example bottom of google page https://developer.chrome.com/native-client/devguide/coding/message-system
and tried simple this
virtual void handlemessage(const pp::var& message) { pp::vardictionary dictionary; pp::vararray an_array; an_array.set(0, pp::var("string0")); an_array.set(1, pp::var("string1")); dictionary.set(pp::var("param_array"), an_array); postmessage(dictionary); }
but when compile code error message pp::vardictionary dictionary;
no problem pp::vararray an_array;
i'm using makefile google
# copyright (c) 2013 native client authors. rights reserved. # use of source code governed bsd-style license can # found in license file. # # gnu make based build file. for details on gnu make see: # http://www.gnu.org/software/make/manual/make.html # # # pepper directory toolchain , includes. # # if nacl_sdk_root not set, assume can found 3 directories up. # this_makefile := $(abspath $(lastword $(makefile_list))) nacl_sdk_root ?= $(abspath $(dir $(this_makefile))../..) # project build flags warnings := -wno-long-long -wall -wswitch-enum -pedantic -werror cxxflags := -pthread -std=gnu++98 $(warnings) # # compute tool paths # getos := python $(nacl_sdk_root)/tools/getos.py oshelpers = python $(nacl_sdk_root)/tools/oshelpers.py osname := $(shell $(getos)) rm := $(oshelpers) rm pnacl_tc_path := $(abspath $(nacl_sdk_root)/toolchain/$(osname)_pnacl) pnacl_cxx := $(pnacl_tc_path)/bin/pnacl-clang++ pnacl_finalize := $(pnacl_tc_path)/bin/pnacl-finalize cxxflags := -i$(nacl_sdk_root)/include ldflags := -l$(nacl_sdk_root)/lib/pnacl/release -lppapi_cpp -lppapi -ljsoncpp # # disable dos path warning when using cygwin based tools windows # cygwin ?= nodosfilewarning export cygwin # declare target first, make 'all' target default build all: job1.pexe clean: $(rm) job1.pexe job1.bc job1.bc: job1.cc $(pnacl_cxx) -o $@ $< -o2 $(cxxflags) $(ldflags) job1.pexe: job1.bc $(pnacl_finalize) -o $@ $< # # makefile target run sdk's simple http server , serve example. # httpd_py := python $(nacl_sdk_root)/tools/httpd.py .phony: serve serve: $(httpd_py) -c $(curdir)
you need add header file var_dictionary.h class trying access declared.
source code header available here
Comments
Post a Comment