Undefined symbols for architecture x86_64 ,While using c and c++ code in my Project

asked 2015-01-05 04:20:17 -0500

Gopi Krishnan gravatar image

updated 2015-01-05 04:24:09 -0500

I tried to implement the Face landmark detection code,I added the all dependency header files for my Project.When i build the project it shows the errors as:

Undefined symbols for architecture x86_64: "flandmark_free(model_struct)", referenced from: _main in lmd.o "flandmark_init(char const)", referenced from: _main in lmd.o "flandmark_detect(_IplImage, int, model_struct, double, int)", referenced from: detectFaceInImage(_IplImage, _IplImage, CvHaarClassifierCascade, model_struct, int, double) in lmd.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: [dist/Debug/GNU-MacOSX/landmarkdetection] Error 1 make[1]: [.build-conf] Error 2 make: ** [.build-impl] Error 2](http://)

Any one can give ideas to resolve the issue?

edit retag flag offensive close merge delete



please show your compile-cmdline. did you just forget to compile & link the flandmark files ?

berak gravatar imageberak ( 2015-01-05 04:26:41 -0500 )edit

CLEAN SUCCESSFUL (total time: 568ms) "/Applications/Xcode.app/Contents/Developer/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf "/Applications/Xcode.app/Contents/Developer/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-MacOSX/landmarkdetection mkdir -p build/Debug/GNU-MacOSX rm -f "build/Debug/GNU-MacOSX/lmd.o.d" g++ -c -g -I/usr/local/include -I/usr/local/include/opencv -I/usr/local/include/opencv2 -MMD -MP -MF "build/Debug/GNU-MacOSX/lmd.o.d" -o build/Debug/GNU-MacOSX/lmd.o lmd.cpp mkdir -p dist/Debug/GNU-MacOSX g++ -o dist/Debug/GNU-MacOSX/landmarkdetection build/Debug/GNU-MacOSX/lmd.o -L/usr/local/lib -lopencv_calib3d.2.4.9 -lopencv_calib3d.2.4 -lopencv_calib3d -lopencv_contrib.2.4.9 -lopencv_contrib.2.4 -lopencv_contrib -lopencv_core.

Gopi Krishnan gravatar imageGopi Krishnan ( 2015-01-05 05:58:33 -0500 )edit

add flandmark_detector.cpp and liblbp.cpp to your project.

berak gravatar imageberak ( 2015-01-05 06:41:10 -0500 )edit

I added that Libraries too beark.

Gopi Krishnan gravatar imageGopi Krishnan ( 2015-01-05 06:43:39 -0500 )edit

well, they weren't compiled, am i wrong ?

berak gravatar imageberak ( 2015-01-05 06:55:17 -0500 )edit

No, Berak ,In the source link also they mentioned to include the two .cpp files to the project.But some issues is happening

Gopi Krishnan gravatar imageGopi Krishnan ( 2015-01-05 09:05:07 -0500 )edit