mace icon indicating copy to clipboard operation
mace copied to clipboard

example/cli/example.cc build error "const string& {aka const std::__cxx11::basic_string<char>&}"

Open Deocacaff opened this issue 5 years ago • 1 comments

g++ -std=c++11 -g -Wall examples.cc ./mace_lib/lib/linux-x86-64/libmace.a ./mace_lib/mobilenet-v2-cpu/model/host/mobilenet-v2.a -o run -I. -fopenmp -lpthread -lgflags main.cc: In function ‘bool mace::examples::RunModel(const std::vector<std::__cxx11::basic_string >&, const std::vector<std::vector >&, const std::vector<std::__cxx11::basic_string >&, const std::vector<std::vector >&)’: main.cc:293:39: error: invalid initialization of reference of type ‘const string& {aka const std::__cxx11::basic_string&}’ from expression of type ‘const unsigned char*’ &engine); ^ In file included from examples.cc:32:0: mace_engine_factory.h:61:12: note: in passing argument 2 of ‘mace::MaceStatus mace::CreateMaceEngineFromCode(const string&, const string&, const std::vector<std::__cxx11::basic_string >&, const std::vector<std::__cxx11::basic_string >&, const mace::MaceEngineConfig&, std::shared_ptrmace::MaceEngine*)’ MaceStatus CreateMaceEngineFromCode( ^ makefile:10: recipe for target 'run' failed make: *** [run] Error 1

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 16.04
  • GCC version(if compiling for host, e.g., 5.4.0): gcc version is 5.4.0 20160609
  • MACE version (Use the command: git describe --long --tags): v0.10.0
  • Python version(2.7): python2.7
  • Bazel version (e.g., 0.13.0): build label: 0.16.0
  • **Model deploy file (*.yml) python tools/converter.py run --config=mace-models/mobilenet-v2/mobilenet-v2-host.yml
  • ** makefile: CC=g++ -std=c++11 INCLUDE_PATH = -I. CFLAGS= -g -Wall SRCS = example.cc PROG = run ARLIB = ./mace_lib/lib/linux-x86-64/libmace.a ./mace_lib/mobilenet-v2-cpu/model/host/mobilenet-v2.a LDFLAGS = -fopenmp -lpthread -lgflags $(PROG):$(SRCS) $(CC) $(CFLAGS) $(SRCS) $(ARLIB) -o $(PROG) $(INCLUDE_PATH) $(LDFLAGS) clean: rm $(PROG)

Deocacaff avatar Feb 28 '19 10:02 Deocacaff

Please format issue messages as Mace Issue Template

yejw5 avatar Mar 04 '19 01:03 yejw5