简体   繁体   中英

C++ implementing CNN Error adding symbols: DSO missing from command line

I'm testing a CNN implementation provided here . I run the command:

make cifar10 && ./cifar10

But I got the following messages:

g++ -o cifar10 BatchProducer.o ConvolutionalLayer.o ConvolutionalTriangularLayer.o IndexLearnerLayer.o MaxPoolingLayer.o MaxPoolingTriangularLayer.o NetworkArchitectures.o NetworkInNetworkLayer.o Picture.o Regions.o Rng.o SigmoidLayer.o SoftmaxClassifier.o SparseConvNet.o SparseConvNetCUDA.o SpatiallySparseBatch.o SpatiallySparseBatchInterface.o SpatiallySparseDataset.o SpatiallySparseLayer.o TerminalPoolingLayer.o cudaUtilities.o readImageToMat.o types.o utilities.o vectorCUDA.o vectorHash.o OpenCVPicture.o SpatiallySparseDatasetCIFAR10.o cifar10.o -lopencv_core -lopencv_highgui -lopencv_imgproc -lrt -larmadillo -lopenblas -lz --std=c++11 -O3
/usr/bin/ld: BatchProducer.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [cifar10] Error 1

What's wrong with this? I installed all the dependencies listed in the webpage. I did not install CUDA because I tested the CPU version here . Therefore I don't think the error is due to missing CUDA. I'm using Ubuntu 14.04 and gcc 5.3.0. Thank you all for helping me!!!

Solution: add '-lz' to your makefile / GCC flags. In other words, your simply missing a library in your make steps, and check if you installled all dependencies

sudo apt-get install libarmadillo-dev libopencv-core-dev libopencv-highgui-dev sparsehash

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM