ofxDlib with OF0.11.2 compile error

I am trying to move a project from OF 0.11.0 to OF0.11.2 that uses ofxDlib but I get the following compile error, even with use the tracking_shapes example.

I am on Xcode 12.4 and macOS 10.15.7

It’s something about
/Applications/of_v0.11.2_osx_release/addons/ofxDlib/libs/ofxDlib/src/Utils.cpp:695:27: No member named 'gaussRand' in namespace 'glm'

Which is strange because glm::gaussRand(...) is a function documented here:

Thank you for any advice.

I think because it is an extension.
If you add #include <glm/gtc/random.hpp> after all the includes in the .cpp file that’s uses glm::gaussRand it should work.

Edit: gtc not gtx :slight_smile:

@Theo thanks for the quick reply.

In order to find which .cpp file uses glm::gaussRand I search the whole ofxDlib folder and only Utils.h was listed.

So I placed it after all the other includes and get now all these error:

Placing it in to Utils.cpp produced the same error as before.

in case it’s helpful those linking errors (and the ignoring warning above) make me think libdlib.a is built only for Intel. In that case, you may want to disable arm compilation – I found I was able to do this in the past the following way – adding arm to excluded architectures

then you should only see “rosetta” as a build option

the other option would be to recompile dlib to support both arm and intel, etc…

also the project this screenshot is from is using ofxFaceTracker2, it’s not ofxDlib, but I definitely ran into the same issues since ofxFaceTracker2 contains dlib only built for intel. I haven’t had bandwidth yet to look into cross compiling dlib but it would be great to look into it…

@stephanschulz I am able to compile with OF’s master and https://github.com/bakercp/ofxDlib/
xcode 11.2.1 and osx 10.14.6
Which ofxDlib version/branch are you using?

Adding the arm64 to the Exclude Architectures selection solves it for me.
FYI, I am on Intel UHD Graphics 630 1536 MB not the M1 arm.
Thanks @zach

I was on the dev branch since it seemed newer.

Also thank you for pointing out that this helped you with ofxFaceTracker2. This actually makes things even more simple.