Tencent / ncnn

ncnn is a high-performance neural network inference framework optimized for the mobile platform
Other
20.58k stars 4.18k forks source link

after build ncnn get libncnn.a, i compile my own code use gcc failed #1710

Open inthewaytolearn opened 4 years ago

inthewaytolearn commented 4 years ago

gcc det.cpp -lncnn -o det -I /usr/local/include/opencv4 -I /home/lcy/ncnn_test/build/install/include/ncnn -L /home/lcy/ncnn_test/build/install/lib -L /usr/local/lib

i use this command to compile my own c++ code, but comiplie failed.

image

it throws out that this error. undefined reference to some operator

chuxinbsn commented 4 years ago

是不是gcc换成g++,再增加-std=c++11

zchrissirhcz commented 4 years ago

@lengchenyu Even if you just write a "hello world" code in hello.cpp file, and compile it with gcc: gcc hello.cpp, it will also give error. You have to use g++ or clang++ instead of gcc to compile a .cpp file.