Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

collect2: error: ld returned 1 exit status

I am now practicing new library for my app.
Here is what I have done so far with 3rd party lib.

root@cmd-center:/home/sarit/clandmark/build# make install
[ 44%] Built target clandmark
[ 88%] Built target flandmark
[ 94%] Built target static_input
[100%] Built target video_input
Install the project...
-- Install configuration: "RELEASE"
-- Installing: /usr/local/lib/cmake/clandmark/CLandmarkTargets.cmake
-- Installing: /usr/local/lib/cmake/clandmark/CLandmarkTargets-release.cmake
-- Installing: /usr/local/lib/cmake/clandmark/CLandmarkConfig.cmake
-- Installing: /usr/local/lib/cmake/clandmark/CLandmarkConfigVersion.cmake
-- Installing: /usr/local/include/rapidxml_print.hpp
-- Installing: /usr/local/include/rapidxml.hpp
-- Installing: /usr/local/include/rapidxml_utils.hpp
-- Installing: /usr/local/include/rapidxml_iterators.hpp
-- Installing: /usr/local/share/doc/clandmark/manual.html
-- Installing: /usr/local/share/doc/clandmark/license.txt
-- Installing: /usr/local/include/CImg.h
-- Installing: /usr/local/share/doc/clandmark/README.txt
-- Installing: /usr/local/share/doc/clandmark/Licence_CeCILL_V2-en.txt
-- Installing: /usr/local/share/doc/clandmark/Licence_CeCILL-C_V1-en.txt
-- Installing: /usr/local/lib/libclandmark.so.1.5
-- Installing: /usr/local/lib/libclandmark.so.1
-- Installing: /usr/local/lib/libclandmark.so
-- Installing: /usr/local/lib/libflandmark.so.1.5
-- Installing: /usr/local/lib/libflandmark.so.1
-- Installing: /usr/local/lib/libflandmark.so
-- Removed runtime path from "/usr/local/lib/libflandmark.so.1.5"
-- Installing: /usr/local/include/msvc-compat.h
-- Installing: /usr/local/include/base64.h
-- Installing: /usr/local/include/CLandmark.h
-- Installing: /usr/local/include/CFeaturePool.h
-- Installing: /usr/local/include/CFeatures.h
-- Installing: /usr/local/include/CAppearanceModel.h
-- Installing: /usr/local/include/CDeformationCost.h
-- Installing: /usr/local/include/CLoss.h
-- Installing: /usr/local/include/CMaxSumSolver.h
-- Installing: /usr/local/include/CXMLInOut.h
-- Installing: /usr/local/include/CTimer.h
-- Installing: /usr/local/include/CTypes.h
-- Installing: /usr/local/include/CLandmarkConfig.h
-- Installing: /usr/local/include/Flandmark.h
-- Installing: /usr/local/include/CSparseLBPFeatures.h
-- Installing: /usr/local/include/CSparseLBPAppearanceModel.h
-- Installing: /usr/local/include/CDisplacementDeformationCost.h
-- Installing: /usr/local/include/CNormalizedEuclideanLoss.h
-- Installing: /usr/local/include/CTableLoss.h
-- Installing: /usr/local/include/CZeroLoss.h
-- Installing: /usr/local/include/CTreeMaxSumSolver.h
-- Installing: /usr/local/share/clandmark/models/flandmark_model.xml
-- Installing: /usr/local/share/clandmark/models/haarcascade_frontalface_alt.xml
-- Installing: /usr/local/share/clandmark/examples/static_input
-- Removed runtime path from "/usr/local/share/clandmark/examples/static_input"
-- Installing: /usr/local/share/clandmark/examples/video_input
-- Removed runtime path from "/usr/local/share/clandmark/examples/video_input"

Here is the libclandmark location.

sarit@cmd-center:~/clandmark/libclandmark$ pwd
/home/sarit/clandmark/libclandmark
sarit@cmd-center:~/clandmark/libclandmark$ ls
base64.h              CDeformationCost.h                CFeatures.h               CLoss.h                       CSparseLBPAppearanceModel.cpp  CTimer.h               CZeroLoss.cpp             msvc-compat.h
CAppearanceModel.cpp  CDisplacementDeformationCost.cpp  clandmarkConfig.cmake.in  CMakeLists.txt                CSparseLBPAppearanceModel.h    CTreeMaxSumSolver.cpp  CZeroLoss.h
CAppearanceModel.h    CDisplacementDeformationCost.h    CLandmarkConfig.h.in      CMaxSumSolver.cpp             CSparseLBPFeatures.cpp         CTreeMaxSumSolver.h    flandmarkConfig.cmake.in
CDAGMaxSumSolver.cpp  CFeaturePool.cpp                  CLandmark.cpp             CMaxSumSolver.h               CSparseLBPFeatures.h           CTypes.h               Flandmark.cpp
CDAGMaxSumSolver.h    CFeaturePool.h                    CLandmark.h               CNormalizedEuclideanLoss.cpp  CTableLoss.cpp                 CXMLInOut.cpp          Flandmark.h
CDeformationCost.cpp  CFeatures.cpp                     CLoss.cpp                 CNormalizedEuclideanLoss.h    CTableLoss.h                   CXMLInOut.h            helpers.h

Compile :

$ g++ `pkg-config --cflags opencv` static_input.cpp -o static_input.out `pkg-config --libs opencv` -l /home/sarit/clandmark/libclandmark/
/usr/bin/ld: cannot find -l/home/sarit/clandmark/libclandmark/

OS : GNU/Linux Debian Linux cmd-center 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u3 (2015-08-04) x86_64 GNU/Linux
OpenCV : 2.4.9 (Debian package installed)

Github :
https://github.com/uricamic/clandmark
Question :
How to compile the example in clandmark?

collect2: error: ld returned 1 exit status

I am now practicing new library for my app.
Here is what I have done so far with 3rd party lib.

root@cmd-center:/home/sarit/clandmark/build# make install
[ 44%] Built target clandmark
[ 88%] Built target flandmark
[ 94%] Built target static_input
[100%] Built target video_input
Install the project...
-- Install configuration: "RELEASE"
-- Installing: /usr/local/lib/cmake/clandmark/CLandmarkTargets.cmake
-- Installing: /usr/local/lib/cmake/clandmark/CLandmarkTargets-release.cmake
-- Installing: /usr/local/lib/cmake/clandmark/CLandmarkConfig.cmake
-- Installing: /usr/local/lib/cmake/clandmark/CLandmarkConfigVersion.cmake
-- Installing: /usr/local/include/rapidxml_print.hpp
-- Installing: /usr/local/include/rapidxml.hpp
-- Installing: /usr/local/include/rapidxml_utils.hpp
-- Installing: /usr/local/include/rapidxml_iterators.hpp
-- Installing: /usr/local/share/doc/clandmark/manual.html
-- Installing: /usr/local/share/doc/clandmark/license.txt
-- Installing: /usr/local/include/CImg.h
-- Installing: /usr/local/share/doc/clandmark/README.txt
-- Installing: /usr/local/share/doc/clandmark/Licence_CeCILL_V2-en.txt
-- Installing: /usr/local/share/doc/clandmark/Licence_CeCILL-C_V1-en.txt
-- Installing: /usr/local/lib/libclandmark.so.1.5
-- Installing: /usr/local/lib/libclandmark.so.1
-- Installing: /usr/local/lib/libclandmark.so
-- Installing: /usr/local/lib/libflandmark.so.1.5
-- Installing: /usr/local/lib/libflandmark.so.1
-- Installing: /usr/local/lib/libflandmark.so
-- Removed runtime path from "/usr/local/lib/libflandmark.so.1.5"
-- Installing: /usr/local/include/msvc-compat.h
-- Installing: /usr/local/include/base64.h
-- Installing: /usr/local/include/CLandmark.h
-- Installing: /usr/local/include/CFeaturePool.h
-- Installing: /usr/local/include/CFeatures.h
-- Installing: /usr/local/include/CAppearanceModel.h
-- Installing: /usr/local/include/CDeformationCost.h
-- Installing: /usr/local/include/CLoss.h
-- Installing: /usr/local/include/CMaxSumSolver.h
-- Installing: /usr/local/include/CXMLInOut.h
-- Installing: /usr/local/include/CTimer.h
-- Installing: /usr/local/include/CTypes.h
-- Installing: /usr/local/include/CLandmarkConfig.h
-- Installing: /usr/local/include/Flandmark.h
-- Installing: /usr/local/include/CSparseLBPFeatures.h
-- Installing: /usr/local/include/CSparseLBPAppearanceModel.h
-- Installing: /usr/local/include/CDisplacementDeformationCost.h
-- Installing: /usr/local/include/CNormalizedEuclideanLoss.h
-- Installing: /usr/local/include/CTableLoss.h
-- Installing: /usr/local/include/CZeroLoss.h
-- Installing: /usr/local/include/CTreeMaxSumSolver.h
-- Installing: /usr/local/share/clandmark/models/flandmark_model.xml
-- Installing: /usr/local/share/clandmark/models/haarcascade_frontalface_alt.xml
-- Installing: /usr/local/share/clandmark/examples/static_input
-- Removed runtime path from "/usr/local/share/clandmark/examples/static_input"
-- Installing: /usr/local/share/clandmark/examples/video_input
-- Removed runtime path from "/usr/local/share/clandmark/examples/video_input"

Here is the libclandmark location.

sarit@cmd-center:~/clandmark/libclandmark$ pwd
/home/sarit/clandmark/libclandmark
sarit@cmd-center:~/clandmark/libclandmark$ ls
base64.h              CDeformationCost.h                CFeatures.h               CLoss.h                       CSparseLBPAppearanceModel.cpp  CTimer.h               CZeroLoss.cpp             msvc-compat.h
CAppearanceModel.cpp  CDisplacementDeformationCost.cpp  clandmarkConfig.cmake.in  CMakeLists.txt                CSparseLBPAppearanceModel.h    CTreeMaxSumSolver.cpp  CZeroLoss.h
CAppearanceModel.h    CDisplacementDeformationCost.h    CLandmarkConfig.h.in      CMaxSumSolver.cpp             CSparseLBPFeatures.cpp         CTreeMaxSumSolver.h    flandmarkConfig.cmake.in
CDAGMaxSumSolver.cpp  CFeaturePool.cpp                  CLandmark.cpp             CMaxSumSolver.h               CSparseLBPFeatures.h           CTypes.h               Flandmark.cpp
CDAGMaxSumSolver.h    CFeaturePool.h                    CLandmark.h               CNormalizedEuclideanLoss.cpp  CTableLoss.cpp                 CXMLInOut.cpp          Flandmark.h
CDeformationCost.cpp  CFeatures.cpp                     CLoss.cpp                 CNormalizedEuclideanLoss.h    CTableLoss.h                   CXMLInOut.h            helpers.h

Compile :

$ g++ `pkg-config --cflags opencv` static_input.cpp -o static_input.out `pkg-config --libs opencv` -l /home/sarit/clandmark/libclandmark/
/usr/bin/ld: cannot find -l/home/sarit/clandmark/libclandmark/

OS : GNU/Linux Debian Linux cmd-center 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u3 (2015-08-04) x86_64 GNU/Linux
OpenCV : 2.4.9 (Debian package installed)

Update : 19Nov2015 23:20 GMT+07

It is strange. Since Make is successfully installed 2 examples to my computer. However, when I try them they show me the error.

sarit@cmd-center:/usr/local/share/clandmark/examples$ ls
static_input  video_input
sarit@cmd-center:/usr/local/share/clandmark/examples$ ./static_input 
./static_input: error while loading shared libraries: libflandmark.so.1: cannot open shared object file: No such file or directory
sarit@cmd-center:/usr/local/share/clandmark/examples$ ./video_input 
./video_input: error while loading shared libraries: libflandmark.so.1: cannot open shared object file: No such file or directory
sarit@cmd-center:/usr/local/share/clandmark/examples$ 

Here is my directory after Make installed in my system.
sarit@cmd-center:/usr/local/include$ ls
base64.h                        CSparseLBPFeatures.h
CAppearanceModel.h              CTableLoss.h
CDeformationCost.h              CTimer.h
CDisplacementDeformationCost.h  CTreeMaxSumSolver.h
CFeaturePool.h                  CTypes.h
CFeatures.h                     CXMLInOut.h
CImg.h                          CZeroLoss.h
CLandmarkConfig.h               Flandmark.h
CLandmark.h                     msvc-compat.h
CLoss.h                         rapidxml.hpp
CMaxSumSolver.h                 rapidxml_iterators.hpp
CNormalizedEuclideanLoss.h      rapidxml_print.hpp
CSparseLBPAppearanceModel.h     rapidxml_utils.hpp

sarit@cmd-center:/usr/local/lib$ ls
cmake              libclandmark.so.1.5  libflandmark.so.1.5  python3.4
libclandmark.so    libflandmark.so      node_modules
libclandmark.so.1  libflandmark.so.1    python2.7

Github :
https://github.com/uricamic/clandmark
Question :
How to compile the example in clandmark?