Menu

USER_ERRORmissing_dlib_all_source_cpp_fileOR__inconsistent_use_of_DEBUG_or_ENABLE_ASSERTS_preprocessor_directives" on OSX

Help
shlomo
2015-03-02
2015-03-03
  • shlomo

    shlomo - 2015-03-02

    Dear all,
    When I compile this program:
    include <dlib image_processing="" frontal_face_detector.h="">
    include <dlib gui_widgets.h="">
    include <dlib image_io.h="">

    On OSX 10.10 (i386 or x64 tried every possible combination), i get:

    Undefined symbols for architecture i386:
    "_USER_ERRORmissing_dlib_all_source_cpp_fileOR__inconsistent_use_of_DEBUG_or_ENABLE_ASSERTS_preprocessor_directives", referenced from:
    _dlib_check_consistent_assert_usage in main.o
    ld: symbol(s) not found for architecture i386
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    I spend hours trying to figure out what is going on.

    Can you help?

    If I use a very old version (Version: 17.46) there are no issues however i dont have frontal_face_detector.h in the old version!

     
  • shlomo

    shlomo - 2015-03-03

    Hi,
    Are you able to compile frontal_face_detector.h using Xcode with the latest dlib version?

    Thanks,

     
    • Davis

      Davis - 2015-03-03

      I don't have an OS X machine around to test on. So someone else will have to answer this :)

       
  • shlomo

    shlomo - 2015-03-03

    Thanks, I understand :)

    I tested on two OSX machine and both have exactly the same issue.

     
  • shlomo

    shlomo - 2015-03-03

    These are my xcode settings, linking still fails with the attached error. I am sure everything was compiled using x86_64

     
  • shlomo

    shlomo - 2015-03-03

    The error

     
  • Davis

    Davis - 2015-03-03

    Did you compile it with cmake?

     
  • shlomo

    shlomo - 2015-03-03

    what does _dlib_check_consistent_assert_usage linking error in main.o means?

     
    • Davis

      Davis - 2015-03-03

      It means you might have compiled different .cpp files with different settings (which is illegal in C++) and dlib tells you about it.

       
  • shlomo

    shlomo - 2015-03-03

    The examples with Cmake, the small program with Xcode

     
    • Davis

      Davis - 2015-03-03

      So did building it with cmake work?

       
  • shlomo

    shlomo - 2015-03-03

    Yes, it did, I wrote that it did so on the other thread.
    Linking does not work, so I can not run anything.

     
    • Davis

      Davis - 2015-03-03

      So you run cmake. Compile it, and you get a linker error? What error? The
      USER_ERRORmissing_dlib_all_source_cpp_fileOR__inconsistent_use_of_DEBUG_or_
      ENABLE_ASSERTS_preprocessor_directives error?

       
  • shlomo

    shlomo - 2015-03-03

    just to make sure:
    Compiling dlib examples with cmake works

    Linking using Xcode fails.
    This is the program:

    include <iostream>

    include <dlib image_processing="" frontal_face_detector.h="">

    include <dlib gui_widgets.h="">

    include <dlib image_io.h="">

    int main(int argc, const char * argv[]) {
    // insert code here...
    std::cout << "Hello, World!\n";
    return 0;
    }

     
  • shlomo

    shlomo - 2015-03-03

    1- I use Cmake, compile all the examples.
    2- Then I use xcode->create a new CPP project
    3- Then I include frontal_face_detector.h and get the error.

     
  • Davis

    Davis - 2015-03-03

    So you aren't using cmake at all in xcode? Did you add dlib/all/source.cpp into your project?

     
  • shlomo

    shlomo - 2015-03-03

    No, I am using Xcode tools.
    What did you mean by "Did you add dlib/all/source.cpp into your project?" in the header search path???

     
    • Davis

      Davis - 2015-03-03

      C++ projects are a bunch of .cpp files that are compiled together. I mean
      you need to include dlib/all/source.cpp in the list of .cpp files that are
      part of your project.

       
  • shlomo

    shlomo - 2015-03-03

    Numerous compilation errors.
    The odd thing is that https://github.com/genekogan/ofxLearn which uses dlib 17.49 fully works on OSX and Xcode.

    But that old version does not include new features that I want to test.

     
    • Davis

      Davis - 2015-03-03

      What error?

       
  • shlomo

    shlomo - 2015-03-03

    X11 errors.
    But wait,
    The examples successfully compiled and LINKED when using Cmake.
    I was also able to run bayes_net_gui_ex
    and I tested it to see that it is actually x86_64 as follows and it is indeed:

    build freebsd$ file bayes_net_gui_ex
    bayes_net_gui_ex: Mach-O 64-bit executable x86_64

    So,
    what ever is happening, it is related to Xcode. I have no option but to use Xcode.
    See the screenshot.

    Can you please indicate all the CMAKE options and CPP/C/CXX flags you are using?

    And of course,
    thank you very much for all your help

     
    • Davis

      Davis - 2015-03-03

      You can tell cmake to make an xcode project. You do it like this:

      cd examples
      mkdir build2
      cd build2
      cmake -G Xcode ..

       
  • shlomo

    shlomo - 2015-03-03

    Finally!!!

    Thanks!
    i was just about to move to another lib after two days of failed attempts.

    once again,
    thanks,
    highly appreciated.

     
    • Davis

      Davis - 2015-03-03

      No problem. Thanks for the bug report :)

       

Log in to post a comment.