Problem compiling ofxMaps on OS X

Hi all,

I really hope someone can help me with this, I don’t really know neither Macs nor c++. I am having a problem compiling ofxMaps under Mac OSX, but the problem occurs for ofxHTTP files (like BaseRouteSettings.cpp or FileSystemRoute.cpp). The machine specs are currently OS X Yosemite:

 $ sw_vers 
 ProductName:    Mac OS X
 ProductVersion:    10.10.3
 BuildVersion:    14D131
 $ system_profiler SPSoftwareDataType
 Software:

     System Software Overview:

       System Version: OS X 10.10.3 (14D131)
       Kernel Version: Darwin 14.3.0
       Boot Volume: Macintosh HD
       Boot Mode: Normal
 $ uname -a
 Darwin XXXX 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64

On this machine, there is Xcode Version 6.3.2 (6D2105), which has OS X SDK 10.10 and 10.9 - and I also found an older Xcode dmg, from which I grabbed OS X SDK 10.8 and copied it for this Xcode.

After a ton of problems, I managed to have something of an xcode project file, that looks like it is compiling, except that it fails here. First I had to get of_v0.8.4_osx_release so I have a working projectGenerator_osx, which helped me generate the Xcode project, which I then had to edit manually (adding all ofxMaps dependencies as “Groups” under addons, so they compile; adding openFrameworksDebug.a that was missing from “Target / Build Phases” in Xcode). That didn’t want to compile, so I moved onto openFrameworks from git. Note that I already cloned the dependencies from https://github.com/bakercp (that is, ofxGeo, ofxSpatialHash, ofxIO, ofxTaskQueue, ofxHTTP, ofxSSLManager, ofxMediaType, ofxNetworkUtils, ofxMaps) into addons/ subdirectory for both cases.

Anyways, this example, including the .xcodeproj, is packed as a zip here:

ofxMaps_example.zip (79.6 KB)

… and I got it after running these commands in its directory:

xcodebuild clean
xcodebuild -configuration Debug clean 
make clean
make CleanDebug
# make -qp | awk -F':' '/^[a-zA-Z0-9][^$#\/\t=]*:([^=]|$)/ {split($1,A,/ /);for(i in A)print A[i]}' # to see make options

I am adding ofxMaps_example under examples/addons/ subdirectory.

The log after doing:

xcodebuild -configuration Debug 2>&1 | tee ../ofxm-xcode.log   # `build` is assumed

… can be found here: ofxm-xcode.log.h (194.3 KB, .h added just for the uploader)

After that I run the usual make:

make Debug 2>&1 | tee ../ofxm-make.log

… and the log for that can be found here: ofxm-make.log.h (233.6 KB, .h added just for the uploader)

In case of Xcode build, the error starts with:

...
CompileC build/ofxMaps_example.build/Debug/ofxMaps_example.build/Objects-normal/i386/FileSystemRoute.o 
...
In file included from /Users/USER/src/openFrameworks_git/addons/ofxHTTP/libs/ofxHTTP/src/FileSystemRoute.cpp:26:
In file included from ../../../addons/ofxHTTP/libs/ofxHTTP/include/ofx/HTTP/FileSystemRoute.h:29:
In file included from ../../../addons/ofxHTTP/libs/ofxHTTP/include/ofx/HTTP/BaseRoute.h:29:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:439:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:628:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:604:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator:332:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base:63:21: error: invalid operands to binary expression ('const Poco::Net::MediaType' and 'const Poco::Net::MediaType')
        {return __x < __y;}
                ~~~ ^ ~~~
...

… which I find rather weird, because:

FileSystemRoute.cpp:26: #include "ofx/HTTP/FileSystemRoute.h"
FileSystemRoute.h:29:   #include "ofx/HTTP/BaseRoute.h"
BaseRoute.h:29:         #include <string>

… and so the errors happen basically when <string> is #included - at which point there shouldn’t be any mixups with Poco::Net::MediaType??

The error during make is quite similar - except it happens during compiling a different file:

Compiling ../../../addons/ofxHTTP/libs/ofxHTTP/src/BaseRouteSettings.cpp
...
In file included from ../../../addons/ofxHTTP/libs/ofxHTTP/src/BaseRouteSettings.cpp:26:
In file included from /Users/USER/src/openFrameworks_git/addons/ofxHTTP/libs/ofxHTTP/include/ofx/HTTP/BaseRouteSettings.h:33:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/set:387:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree:15:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator:332:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base:63:21: error: invalid operands to binary expression ('const Poco::Net::MediaType' and 'const Poco::Net::MediaType')
        {return __x < __y;}
                ~~~ ^ ~~~
...

So, why does this error occur - and how can I get this example to compile on Mac OSX?

Thanks in advance for any answers,
Cheers!


EDIT: I also tried the following:

  • built openFrameworks_git/apps/projectGenerator/projectGeneratorSimple/bin/projectGeneratorSimpleDebug.app , which went fine
  • used projectGeneratorSimpleDebug.app to generate a new project skeleton for example_basic_client under openFrameworks_git/examples/addons/, with only ofxHTTP (and no others) as an addon
  • copied src/ and bin/data/ content from openFrameworks_git/addons/ofxHTTP/example_basic_client (the one gotten from git) into the project-generated example_basic_client
  • tried to build the project-generated example_basic_client

… and also this one fails with /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__functional_base:63:21: Invalid operands to binary expression ('const Poco::Net::MediaType' and 'const Poco::Net::MediaType')

So I guess if example_basic_client of ofxHTTP gets fixed, also my original query will get fixed… Let’s hope someone has a pointer or two about this…

Hi @sdaau – what version of openFrameworks are you using?

Currently everything should be working with the master branch of openFrameworks (or 0.9.0 RC1) and the develop branches of all of those addons. I haven’t been using 0.8.4 for a long time, so the master branches of ofxHTTP, ofxMaps, etc may all be out of date. Just make sure all of the addons (ofxHTTP, etc) are using the develop branch.

1 Like

Hi @bakercp,

Many thanks for the response!

It’s the git version, here are the specs:

$ cd /.../openFrameworks_git/
$ git status -uno
On branch master
Your branch is up-to-date with 'origin/master'.
$ git log -1
commit 621876270b585498e4557eacddf8afc60ffdb8b5
Merge: 870705a b4dbf66
Author: arturo <arturo@openframeworks.cc>
Date:   Sun Sep 13 20:10:41 2015 +0200

… and for ofxHTTP:

$ cd addons/ofxHTTP/ 
$ git status -uno
On branch master
Your branch is up-to-date with 'origin/master'.
$ git log -1
commit d9b78ac9b040b1f2a0e5e24897fa45adfb590083
Merge: b0ca84a 002da5d
Author: Christopher Baker <me@christopherbaker.net>
Date:   Tue Apr 21 23:02:40 2015 -0500

I think I have the right one (but do let me know if I’m mistaken)

… ahhh, I’m on master branch of ofxHTTP, so I just did this:

$ cd /.../openFrameworks_git/addons/ofxHTTP/
$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/develop
  remotes/origin/master
$ git checkout develop
Branch develop set up to track remote branch develop from origin.
Switched to a new branch 'develop'
$ git branch -a
* develop
  master
  remotes/origin/HEAD -> origin/master
  remotes/origin/develop
  remotes/origin/master
$ git log -1
commit 2fb2e76402ef3c1f500aebe646d5affb12b3a9fc
Author: Christopher Baker <me@christopherbaker.net>
Date:   Fri Aug 7 16:31:12 2015 -0500

    Spacing issues.

Then I tried adding a bunch of paths in “Header Search Paths” and removing files from the xcode project that were no longer present - until I got bored, and reconstructed the project via projectGeneratorSimpleDebug.app again - except this time with ofxHTTP, ofxMediaType, ofxSSLManager and ofxTaskQueue as addons; then I just needed to add a few paths under “Header Search Paths” (for ofxIO and ofxNetworkUtils); and in addition, I had to checkout the develop branch of ofxNetworkUtils because otherwise the file IPAddressRange.h didn’t exist; and finally, it built!! :slight_smile:

So here is this xcode project (only the .xcodeproj as a zip): example_basic_client_xcode.zip (40.3 KB)

Except, when the bin/example_basic_clientDebug.app runs, I get simply a gray window; is this what it is supposed to be doing? (I haven’t had much time yet to look at the code, and see what is it supposed to be doing).

Anyways - thanks so much for the pointer; I’ll be checking out the develop branches of all the addons, and try to re-build ofxMaps from that; now I’m pretty sure it will work.

Cheers!

Yeah, it is probably just a gray box. I think all of the HTML text comes out in the console. Keep me posted. Sounds like you are on the right track. As soon as 0.9.0 is officially released, then I’ll move all of the develop branch code over to the master branch.

1 Like

Hi @bakercp ,

Thanks again for the response!

Well, it turns out that I compiled example_basic_client directly as it was from the projectGenerator - meaning that main.cpp, ofApp.cpp, ofApp.h in the src/ folder were the “blank” ones from the project generator; after copying the files over from the src/ subfolder of the example_basic_client from git, finally I get something like this:

Just a note for Mac noobs: if you use:

$ open bin/example_basic_clientDebug.app

… then it is the equivalent of double-clicking the output, and no messages will be dumped to stdout in terminal; while if you call the executable directly:

$ ./bin/example_basic_clientDebug.app/Contents/MacOS/example_basic_clientDebug 
[ error ] ofApp::setup: Got Exception SSL Exception: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed 0

… then messages will be visible in stdout…

Yes, everything went fine - and I finally got ofxMaps example to compile; having checked out the develop branch from ofxHTTP, ofxIO, ofxMaps, ofxNetworkUtils, and ofxTaskQueue. I could finally see what the ofxMaps example is about - it quickly switches between tiles from different map providers (basically, almost like blinking or strobe effect), pressing 0 fixes one provider, pressing 1 fixes another, and thereafter one can use WASD to navigate and +/- (I think) to zoom. Even if I built the example on Linux already, I could really see what is going on - and that is because I have OpenGL 1.4 graphics card, and I “fake” openGL 2.1 in which case software rendering is enabled (see also Problem with compilation of project generator and examples on Ubuntu 14? - linux - openFrameworks) - and in that case, I would have only seen a tile from one provider, which would have disappeared very quickly, and then only a background was shown, and I really didn’t get what was going on with that alone.

Thanks for mentioning this - I wasn’t aware that is how the development cycle was intended to work.

Anyways, many thanks again - now it seems, everything related to ofxMaps and examples works fine…

Cheers!

1 Like