dlib_for_arm icon indicating copy to clipboard operation
dlib_for_arm copied to clipboard

error: use of undeclared identifier 'LOGD'

Open sergchil opened this issue 7 years ago • 11 comments

object_detector.h line 445

sergchil avatar Mar 16 '17 11:03 sergchil

@truedat101 I was hitting this error, too. It appears it's because this was originally develop on Android. I was able to successfully compile by commenting any instances of LOGD.

mflor35 avatar Apr 21 '17 23:04 mflor35

@mflor35 I'll post something later which lets us redefine LOGD and LOGE if not defined ANDROID . Essentially you just want to do either a noop or define it as a logging to stdout or stderr respectively.

truedat101 avatar Apr 24 '17 23:04 truedat101

Folks, In my 3rd time to compile this version of dlib, (i was having LOGD problems in 2 times before) i got the error below. There's something about LOGD or someone got the same error?

#EDIT I run the code like:

cd dlib/python_examples/build/
cmake --mfpu=neon ../../tools/python
cmake --build . --config Release

#/EDIT

[ 98%] Building CXX object CMakeFiles/dlib_.dir/src/gui.cpp.o
[100%] Linking CXX shared library dlib.so
CMakeFiles/dlib_.dir/src/sequence_segmenter.cpp.o: In function `dlib::currentTimeInMilliseconds()':
sequence_segmenter.cpp:(.text+0x8e8): multiple definition of `dlib::currentTimeInMilliseconds()'
CMakeFiles/dlib_.dir/src/svm_c_trainer.cpp.o:svm_c_trainer.cpp:(.text+0x454): first defined here
CMakeFiles/dlib_.dir/src/object_detection.cpp.o: In function `dlib::currentTimeInMilliseconds()':
object_detection.cpp:(.text+0xba8): multiple definition of `dlib::currentTimeInMilliseconds()'
CMakeFiles/dlib_.dir/src/svm_c_trainer.cpp.o:svm_c_trainer.cpp:(.text+0x454): first defined here
CMakeFiles/dlib_.dir/src/shape_predictor.cpp.o: In function `dlib::currentTimeInMilliseconds()':
shape_predictor.cpp:(.text+0x6f4): multiple definition of `dlib::currentTimeInMilliseconds()'
CMakeFiles/dlib_.dir/src/svm_c_trainer.cpp.o:svm_c_trainer.cpp:(.text+0x454): first defined here
CMakeFiles/dlib_.dir/src/shape_predictor.cpp.o:(.bss+0x10): multiple definition of `dlib::impl::total_fe_time'
CMakeFiles/dlib_.dir/src/object_detection.cpp.o:(.bss+0x10): first defined here
CMakeFiles/dlib_.dir/src/shape_predictor.cpp.o:(.bss+0x18): multiple definition of `dlib::impl::total_pyr_time'
CMakeFiles/dlib_.dir/src/object_detection.cpp.o:(.bss+0x18): first defined here
CMakeFiles/dlib_.dir/src/correlation_tracker.cpp.o: In function `dlib::currentTimeInMilliseconds()':
correlation_tracker.cpp:(.text+0x764): multiple definition of `dlib::currentTimeInMilliseconds()'
CMakeFiles/dlib_.dir/src/svm_c_trainer.cpp.o:svm_c_trainer.cpp:(.text+0x454): first defined here
CMakeFiles/dlib_.dir/src/correlation_tracker.cpp.o:(.bss+0x10): multiple definition of `dlib::impl::total_fe_time'
CMakeFiles/dlib_.dir/src/object_detection.cpp.o:(.bss+0x10): first defined here
CMakeFiles/dlib_.dir/src/correlation_tracker.cpp.o:(.bss+0x18): multiple definition of `dlib::impl::total_pyr_time'
CMakeFiles/dlib_.dir/src/object_detection.cpp.o:(.bss+0x18): first defined here
CMakeFiles/dlib_.dir/src/gui.cpp.o: In function `dlib::currentTimeInMilliseconds()':
gui.cpp:(.text+0xc0): multiple definition of `dlib::currentTimeInMilliseconds()'
CMakeFiles/dlib_.dir/src/svm_c_trainer.cpp.o:svm_c_trainer.cpp:(.text+0x454): first defined here
CMakeFiles/dlib_.dir/src/gui.cpp.o:(.bss+0x10): multiple definition of `dlib::impl::total_fe_time'
CMakeFiles/dlib_.dir/src/object_detection.cpp.o:(.bss+0x10): first defined here
CMakeFiles/dlib_.dir/src/gui.cpp.o:(.bss+0x18): multiple definition of `dlib::impl::total_pyr_time'
CMakeFiles/dlib_.dir/src/object_detection.cpp.o:(.bss+0x18): first defined here
collect2: error: ld returned 1 exit status
CMakeFiles/dlib_.dir/build.make:521: recipe for target 'dlib.so' failed
make[2]: *** [dlib.so] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/dlib_.dir/all' failed
make[1]: *** [CMakeFiles/dlib_.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

EsterfanoLopes avatar May 03 '17 19:05 EsterfanoLopes

hi, @mflor35 @truedat101 you guys check the performance? Is it better?

gicheonkang avatar May 05 '17 10:05 gicheonkang

@BarbaL simply commetn all the lines where LOGD used and build

sergchil avatar May 05 '17 15:05 sergchil

@sergeychilingaryan I did it. I'll double check anyway.

EsterfanoLopes avatar May 05 '17 16:05 EsterfanoLopes

@gicheonkang for our specific application it did improve performance by 1 - 2 FPS. The most noticeable difference was multithreading when detecting the face.

@BarbaL I attempted to build the C++ Samples with this version but I also ran into similar issues. I ended up giving up and simply compile the library without any of them.

mflor35 avatar May 05 '17 19:05 mflor35

Folks, my take is that this project should be done in such a way that all it (1) Forks directly from the original source on github (2) doesn't include android specific APIs like LOGD/LOGE that break on non-android platforms (3) makes good use of preprocessor directives to ensure optimizations for ARM or even Android are done only for those platforms and the code remains as a whole portable. The fact that @mflor35 got some better results on ARM is encouraging (we've tested this now on 2 different platforms on arm/linux) and we should think about pushing these changes back upstream. I'm considering setting up a fork of the original upstream source which takes in the tuning from this repository, and then send a pull request back to the authors of dlib (proper credit given to fastfastball for efforts on the original work).

truedat101 avatar May 05 '17 20:05 truedat101

I am also seeing the same error message with @BarbaL when compiling on RPi 3. I commented some LOGD calls already.

@fastfastball any update?

Where can I find currentTimeInMilliseconds() and total_fe_time and total_pyr_time?

openedhardware avatar Jun 22 '17 21:06 openedhardware

Folks, In my 3rd time to compile this version of dlib, (i was having LOGD problems in 2 times before) i got the error below. There's something about LOGD or someone got the same error?

#EDIT I run the code like:

cd dlib/python_examples/build/
cmake --mfpu=neon ../../tools/python
cmake --build . --config Release

#/EDIT

[ 98%] Building CXX object CMakeFiles/dlib_.dir/src/gui.cpp.o
[100%] Linking CXX shared library dlib.so
CMakeFiles/dlib_.dir/src/sequence_segmenter.cpp.o: In function `dlib::currentTimeInMilliseconds()':
sequence_segmenter.cpp:(.text+0x8e8): multiple definition of `dlib::currentTimeInMilliseconds()'
CMakeFiles/dlib_.dir/src/svm_c_trainer.cpp.o:svm_c_trainer.cpp:(.text+0x454): first defined here
CMakeFiles/dlib_.dir/src/object_detection.cpp.o: In function `dlib::currentTimeInMilliseconds()':
object_detection.cpp:(.text+0xba8): multiple definition of `dlib::currentTimeInMilliseconds()'
CMakeFiles/dlib_.dir/src/svm_c_trainer.cpp.o:svm_c_trainer.cpp:(.text+0x454): first defined here
CMakeFiles/dlib_.dir/src/shape_predictor.cpp.o: In function `dlib::currentTimeInMilliseconds()':
shape_predictor.cpp:(.text+0x6f4): multiple definition of `dlib::currentTimeInMilliseconds()'
CMakeFiles/dlib_.dir/src/svm_c_trainer.cpp.o:svm_c_trainer.cpp:(.text+0x454): first defined here
CMakeFiles/dlib_.dir/src/shape_predictor.cpp.o:(.bss+0x10): multiple definition of `dlib::impl::total_fe_time'
CMakeFiles/dlib_.dir/src/object_detection.cpp.o:(.bss+0x10): first defined here
CMakeFiles/dlib_.dir/src/shape_predictor.cpp.o:(.bss+0x18): multiple definition of `dlib::impl::total_pyr_time'
CMakeFiles/dlib_.dir/src/object_detection.cpp.o:(.bss+0x18): first defined here
CMakeFiles/dlib_.dir/src/correlation_tracker.cpp.o: In function `dlib::currentTimeInMilliseconds()':
correlation_tracker.cpp:(.text+0x764): multiple definition of `dlib::currentTimeInMilliseconds()'
CMakeFiles/dlib_.dir/src/svm_c_trainer.cpp.o:svm_c_trainer.cpp:(.text+0x454): first defined here
CMakeFiles/dlib_.dir/src/correlation_tracker.cpp.o:(.bss+0x10): multiple definition of `dlib::impl::total_fe_time'
CMakeFiles/dlib_.dir/src/object_detection.cpp.o:(.bss+0x10): first defined here
CMakeFiles/dlib_.dir/src/correlation_tracker.cpp.o:(.bss+0x18): multiple definition of `dlib::impl::total_pyr_time'
CMakeFiles/dlib_.dir/src/object_detection.cpp.o:(.bss+0x18): first defined here
CMakeFiles/dlib_.dir/src/gui.cpp.o: In function `dlib::currentTimeInMilliseconds()':
gui.cpp:(.text+0xc0): multiple definition of `dlib::currentTimeInMilliseconds()'
CMakeFiles/dlib_.dir/src/svm_c_trainer.cpp.o:svm_c_trainer.cpp:(.text+0x454): first defined here
CMakeFiles/dlib_.dir/src/gui.cpp.o:(.bss+0x10): multiple definition of `dlib::impl::total_fe_time'
CMakeFiles/dlib_.dir/src/object_detection.cpp.o:(.bss+0x10): first defined here
CMakeFiles/dlib_.dir/src/gui.cpp.o:(.bss+0x18): multiple definition of `dlib::impl::total_pyr_time'
CMakeFiles/dlib_.dir/src/object_detection.cpp.o:(.bss+0x18): first defined here
collect2: error: ld returned 1 exit status
CMakeFiles/dlib_.dir/build.make:521: recipe for target 'dlib.so' failed
make[2]: *** [dlib.so] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/dlib_.dir/all' failed
make[1]: *** [CMakeFiles/dlib_.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

@EsterfanoLopes hi~ I got same error,how to deal it?

Hjy20255 avatar Jul 24 '20 09:07 Hjy20255

Folks, In my 3rd time to compile this version of dlib, (i was having LOGD problems in 2 times before) i got the error below. There's something about LOGD or someone got the same error? #EDIT I run the code like:

cd dlib/python_examples/build/
cmake --mfpu=neon ../../tools/python
cmake --build . --config Release

#/EDIT

[ 98%] Building CXX object CMakeFiles/dlib_.dir/src/gui.cpp.o
[100%] Linking CXX shared library dlib.so
CMakeFiles/dlib_.dir/src/sequence_segmenter.cpp.o: In function `dlib::currentTimeInMilliseconds()':
sequence_segmenter.cpp:(.text+0x8e8): multiple definition of `dlib::currentTimeInMilliseconds()'
CMakeFiles/dlib_.dir/src/svm_c_trainer.cpp.o:svm_c_trainer.cpp:(.text+0x454): first defined here
CMakeFiles/dlib_.dir/src/object_detection.cpp.o: In function `dlib::currentTimeInMilliseconds()':
object_detection.cpp:(.text+0xba8): multiple definition of `dlib::currentTimeInMilliseconds()'
CMakeFiles/dlib_.dir/src/svm_c_trainer.cpp.o:svm_c_trainer.cpp:(.text+0x454): first defined here
CMakeFiles/dlib_.dir/src/shape_predictor.cpp.o: In function `dlib::currentTimeInMilliseconds()':
shape_predictor.cpp:(.text+0x6f4): multiple definition of `dlib::currentTimeInMilliseconds()'
CMakeFiles/dlib_.dir/src/svm_c_trainer.cpp.o:svm_c_trainer.cpp:(.text+0x454): first defined here
CMakeFiles/dlib_.dir/src/shape_predictor.cpp.o:(.bss+0x10): multiple definition of `dlib::impl::total_fe_time'
CMakeFiles/dlib_.dir/src/object_detection.cpp.o:(.bss+0x10): first defined here
CMakeFiles/dlib_.dir/src/shape_predictor.cpp.o:(.bss+0x18): multiple definition of `dlib::impl::total_pyr_time'
CMakeFiles/dlib_.dir/src/object_detection.cpp.o:(.bss+0x18): first defined here
CMakeFiles/dlib_.dir/src/correlation_tracker.cpp.o: In function `dlib::currentTimeInMilliseconds()':
correlation_tracker.cpp:(.text+0x764): multiple definition of `dlib::currentTimeInMilliseconds()'
CMakeFiles/dlib_.dir/src/svm_c_trainer.cpp.o:svm_c_trainer.cpp:(.text+0x454): first defined here
CMakeFiles/dlib_.dir/src/correlation_tracker.cpp.o:(.bss+0x10): multiple definition of `dlib::impl::total_fe_time'
CMakeFiles/dlib_.dir/src/object_detection.cpp.o:(.bss+0x10): first defined here
CMakeFiles/dlib_.dir/src/correlation_tracker.cpp.o:(.bss+0x18): multiple definition of `dlib::impl::total_pyr_time'
CMakeFiles/dlib_.dir/src/object_detection.cpp.o:(.bss+0x18): first defined here
CMakeFiles/dlib_.dir/src/gui.cpp.o: In function `dlib::currentTimeInMilliseconds()':
gui.cpp:(.text+0xc0): multiple definition of `dlib::currentTimeInMilliseconds()'
CMakeFiles/dlib_.dir/src/svm_c_trainer.cpp.o:svm_c_trainer.cpp:(.text+0x454): first defined here
CMakeFiles/dlib_.dir/src/gui.cpp.o:(.bss+0x10): multiple definition of `dlib::impl::total_fe_time'
CMakeFiles/dlib_.dir/src/object_detection.cpp.o:(.bss+0x10): first defined here
CMakeFiles/dlib_.dir/src/gui.cpp.o:(.bss+0x18): multiple definition of `dlib::impl::total_pyr_time'
CMakeFiles/dlib_.dir/src/object_detection.cpp.o:(.bss+0x18): first defined here
collect2: error: ld returned 1 exit status
CMakeFiles/dlib_.dir/build.make:521: recipe for target 'dlib.so' failed
make[2]: *** [dlib.so] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/dlib_.dir/all' failed
make[1]: *** [CMakeFiles/dlib_.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

@EsterfanoLopes hi~ I got same error,how to deal it?

It was a long time ago, i can't remember. I'm sorry.

EsterfanoLopes avatar Jul 29 '20 15:07 EsterfanoLopes