Code Monkey home page Code Monkey logo

Comments (7)

Pratyeka avatar Pratyeka commented on May 11, 2024

Compile source code has succeed;
but Compile example failed.
g++: error: openmp: 没有那个文件或目录
g++: error: thread: 没有那个文件或目录
g++: error: test.cpp: 没有那个文件或目录
Please help me!!! thank u

from ncnn.

BiranLi avatar BiranLi commented on May 11, 2024

@Pratyeka Have you installed openmp? For thread, maybe use -lpthread instead. And test.cpp is the source code file.

from ncnn.

walegahaha avatar walegahaha commented on May 11, 2024

Compile source code has succeed but compile example failed(we can't find test.cpp).
so what's your test.cpp?
How can I convert the caffe-cnn to ncnn-cnn and apply them in the phone?
Thanks!

from ncnn.

Vandermode avatar Vandermode commented on May 11, 2024

@BiranLi Hi, After I compile the ncnn source file, I write a makefile as follows:

NCNN = /home/vac/Desktop/ncnn

OPENCV = /home/vac/opencv/opencv-3.2.0

INCPATH = 		-I${NCNN}/build/install/include \
				-I${OPENCV}/modules/objdetect/include \
                -I${OPENCV}/modules/highgui/include \
                -I${OPENCV}/modules/imgproc/include \
                -I${OPENCV}/modules/core/include \
                -I${OPENCV}/modules/imgcodecs/include \
                -I${OPENCV}/modules/videoio/include

LIBS = -lopencv_core -lopencv_highgui -lopencv_imgproc  \
		-fopenmp -pthread

LIBPATH = -L${OPENCV}/build/lib

%:%.cpp
	$(CXX) $(INCPATH) $(LIBPATH) $^ ${NCNN}/build/install/lib/libncnn.a $(LIBS) -o $@

Then I type `make squeezenet```,
however, I got a error:

g++ -I/home/vac/Desktop/ncnn/build/install/include -I/home/vac/opencv/opencv-3.2.0/modules/objdetect/include -I/home/vac/opencv/opencv-3.2.0/modules/highgui/include -I/home/vac/opencv/opencv-3.2.0/modules/imgproc/include -I/home/vac/opencv/opencv-3.2.0/modules/core/include -I/home/vac/opencv/opencv-3.2.0/modules/imgcodecs/include -I/home/vac/opencv/opencv-3.2.0/modules/videoio/include -L/home/vac/opencv/opencv-3.2.0/build/lib squeezenet.cpp /home/vac/Desktop/ncnn/build/install/lib/libncnn.a -lopencv_core -lopencv_highgui -lopencv_imgproc -fopenmp -pthread -o squeezenet
/tmp/ccIJ8RWP.o: In function `main':
squeezenet.cpp:(.text+0x507): undefined reference to `cv::imread(cv::String const&, int)'
collect2: error: ld returned 1 exit status
makefile:19: recipe for target 'squeezenet' failed
make: *** [squeezenet] Error 1

It seems a ld problem, but I can pretty sure nothing wrong with my opencv address.
Any suggestion? Thank u very much.

from ncnn.

wangzhe258369 avatar wangzhe258369 commented on May 11, 2024

依赖的protobuf:
sudo apt-get install protobuf-compiler
sudo apt-get install libprotobuf-dev

from ncnn.

BiranLi avatar BiranLi commented on May 11, 2024

@Vandermode Try to modify your opencv to version 2 . My working opencv's version is 2.4.13.

from ncnn.

ruyiwei-cas avatar ruyiwei-cas commented on May 11, 2024

@Vandermode this is probably because imread was moved to opencv_imgcodecs. Try to add -lopencv_imgcodecs to linker flags

from ncnn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.