{"action":"created","issue":{"url":"https://api.github.com/repos/thp/psmoveapi/issues/217","repository_url":"https://api.github.com/repos/thp/psmoveapi","labels_url":"https://api.github.com/repos/thp/psmoveapi/issues/217/labels{/name}","comments_url":"https://api.github.com/repos/thp/psmoveapi/issues/217/comments","events_url":"https://api.github.com/repos/thp/psmoveapi/issues/217/events","html_url":"https://github.com/thp/psmoveapi/pull/217","id":139721816,"number":217,"title":"OpenCV 3.1 + MingW build fix","user":{"login":"rovarma","id":8319699,"avatar_url":"https://avatars.githubusercontent.com/u/8319699?v=3","gravatar_id":"","url":"https://api.github.com/users/rovarma","html_url":"https://github.com/rovarma","followers_url":"https://api.github.com/users/rovarma/followers","following_url":"https://api.github.com/users/rovarma/following{/other_user}","gists_url":"https://api.github.com/users/rovarma/gists{/gist_id}","starred_url":"https://api.github.com/users/rovarma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rovarma/subscriptions","organizations_url":"https://api.github.com/users/rovarma/orgs","repos_url":"https://api.github.com/users/rovarma/repos","events_url":"https://api.github.com/users/rovarma/events{/privacy}","received_events_url":"https://api.github.com/users/rovarma/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-09T22:34:46Z","updated_at":"2016-03-11T10:05:20Z","closed_at":"2016-03-11T10:05:13Z","pull_request":{"url":"https://api.github.com/repos/thp/psmoveapi/pulls/217","html_url":"https://github.com/thp/psmoveapi/pull/217","diff_url":"https://github.com/thp/psmoveapi/pull/217.diff","patch_url":"https://github.com/thp/psmoveapi/pull/217.patch"},"body":"I've updated the Windows build to also use OpenCV 3.1 instead of the older 2.4.11 so that all platforms now use the same OpenCV version. I tried doing this a while ago as part of my VS2013 support work (https://github.com/thp/psmoveapi/pull/190), but back then I was seeing a crash when `cvGetSize` was called during `psmove_tracker_blinking_calibration`.\r\n\r\nThat crash is still there, but I've spent some time investigating the crash and it turns out it's caused by a bug in OpenCV that causes incorrect code to be generated when `cvGetSize` is called from a C source file under MSVC (it works fine when called from C++/other compilers).\r\n\r\nI've opened a bug on OpenCV's tracker (https://github.com/Itseez/opencv/issues/6221) detailing my findings, but in the meantime, since `psmove_tracker.c` is the only file that uses `cvGetSize`, I've added a workaround to the CMake scripts for MSVC to force that file to be compiled as C++; this fixes the crash. I had to make some minor modifications to get it to compile as both C and C++.\r\n\r\nFinally, I've also fixed a MingW build error introduced as part of https://github.com/thp/psmoveapi/pull/215; it should now build cleanly on all platforms again.\r\n"},"comment":{"url":"https://api.github.com/repos/thp/psmoveapi/issues/comments/195304694","html_url":"https://github.com/thp/psmoveapi/pull/217#issuecomment-195304694","issue_url":"https://api.github.com/repos/thp/psmoveapi/issues/217","id":195304694,"user":{"login":"thp","id":135241,"avatar_url":"https://avatars.githubusercontent.com/u/135241?v=3","gravatar_id":"","url":"https://api.github.com/users/thp","html_url":"https://github.com/thp","followers_url":"https://api.github.com/users/thp/followers","following_url":"https://api.github.com/users/thp/following{/other_user}","gists_url":"https://api.github.com/users/thp/gists{/gist_id}","starred_url":"https://api.github.com/users/thp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thp/subscriptions","organizations_url":"https://api.github.com/users/thp/orgs","repos_url":"https://api.github.com/users/thp/repos","events_url":"https://api.github.com/users/thp/events{/privacy}","received_events_url":"https://api.github.com/users/thp/received_events","type":"User","site_admin":false},"created_at":"2016-03-11T10:05:20Z","updated_at":"2016-03-11T10:05:20Z","body":"Cool, thanks - merged."}}