CATCH2 on MacOS

460 views
Skip to first unread message

Andrew Sangster

unread,
Dec 13, 2017, 11:10:28 AM12/13/17
to CATCH
Hey,

I'm trying to compile/run CATCH 2.0.1 on our Mac dev machine and I'm getting numerous semantic and parse issues. I am new to Apple development so its completely possible that the issue is me.

What I've done to build the project was :
1. Download complete CATCH 2.0.1 GitHub repo.
2. Open the XCode/OCTest/OCTest.xcodeproj file in Xcode 9.1
3. Hit run

This there any additional steps needed to make the project comply/run?

BuildTime error output :
OCTest project Group
Validate Project Settings Group
/Users/andrewsangster/Desktop/Catch2-master/projects/XCode/OCTest/OCTest.xcodeproj Update to recommended settings
OCTest Group
Semantic Issue Group
/Users/andrewsangster/Desktop/Catch2-master/include/internal/catch_assertionhandler.cpp:21:10: No previous prototype for function 'operator<<'
/Users/andrewsangster/Desktop/Catch2-master/projects/XCode/OCTest/catch_objc_impl.mm:5:10: In file included from /Users/andrewsangster/Desktop/Catch2-master/projects/XCode/OCTest/catch_objc_impl.mm:5:
/Users/andrewsangster/Desktop/Catch2-master/include/internal/catch_string_manip.cpp:32:10: No previous prototype for function 'toLowerCh'
/Users/andrewsangster/Desktop/Catch2-master/projects/XCode/OCTest/catch_objc_impl.mm:42:10: In file included from /Users/andrewsangster/Desktop/Catch2-master/projects/XCode/OCTest/catch_objc_impl.mm:42:
/Users/andrewsangster/Desktop/Catch2-master/include/internal/catch_test_case_info.cpp:22:37: No previous prototype for function 'parseSpecialTag'
/Users/andrewsangster/Desktop/Catch2-master/projects/XCode/OCTest/catch_objc_impl.mm:47:10: In file included from /Users/andrewsangster/Desktop/Catch2-master/projects/XCode/OCTest/catch_objc_impl.mm:47:
/Users/andrewsangster/Desktop/Catch2-master/include/internal/catch_test_case_info.cpp:39:10: No previous prototype for function 'isReservedTag'
/Users/andrewsangster/Desktop/Catch2-master/projects/XCode/OCTest/catch_objc_impl.mm:47:10: In file included from /Users/andrewsangster/Desktop/Catch2-master/projects/XCode/OCTest/catch_objc_impl.mm:47:
/Users/andrewsangster/Desktop/Catch2-master/include/internal/catch_test_case_info.cpp:42:10: No previous prototype for function 'enforceNotReservedTag'
/Users/andrewsangster/Desktop/Catch2-master/projects/XCode/OCTest/catch_objc_impl.mm:47:10: In file included from /Users/andrewsangster/Desktop/Catch2-master/projects/XCode/OCTest/catch_objc_impl.mm:47:
/Users/andrewsangster/Desktop/Catch2-master/include/internal/catch_timer.cpp:19:10: No previous prototype for function 'estimateClockResolution'
/Users/andrewsangster/Desktop/Catch2-master/projects/XCode/OCTest/catch_objc_impl.mm:53:10: In file included from /Users/andrewsangster/Desktop/Catch2-master/projects/XCode/OCTest/catch_objc_impl.mm:53:
/Users/andrewsangster/Desktop/Catch2-master/include/internal/catch_tostring.cpp:228:31: Definition or redeclaration of 'atto' cannot name the global scope
/Users/andrewsangster/Desktop/Catch2-master/projects/XCode/OCTest/catch_objc_impl.mm:54:10: In file included from /Users/andrewsangster/Desktop/Catch2-master/projects/XCode/OCTest/catch_objc_impl.mm:54:
/Users/andrewsangster/Desktop/Catch2-master/include/internal/catch_tostring.cpp:228:31: No member named 'atto' in the global namespace
/Users/andrewsangster/Desktop/Catch2-master/projects/XCode/OCTest/catch_objc_impl.mm:54:10: In file included from /Users/andrewsangster/Desktop/Catch2-master/projects/XCode/OCTest/catch_objc_impl.mm:54:
Parse Issue Group
/Users/andrewsangster/Desktop/Catch2-master/include/internal/catch_tostring.cpp:228:35: Expected ';' after top level declarator
/Users/andrewsangster/Desktop/Catch2-master/projects/XCode/OCTest/catch_objc_impl.mm:54:10: In file included from /Users/andrewsangster/Desktop/Catch2-master/projects/XCode/OCTest/catch_objc_impl.mm:54:
/Users/andrewsangster/Desktop/Catch2-master/include/internal/catch_tostring.cpp:228:29: Expected '>'
/Users/andrewsangster/Desktop/Catch2-master/projects/XCode/OCTest/catch_objc_impl.mm:54:10: In file included from /Users/andrewsangster/Desktop/Catch2-master/projects/XCode/OCTest/catch_objc_impl.mm:54:
/Users/andrewsangster/Desktop/Catch2-master/include/internal/catch_tostring.cpp:228:25: Protocol has no object type specified; defaults to qualified 'id'
/Users/andrewsangster/Desktop/Catch2-master/projects/XCode/OCTest/catch_objc_impl.mm:54:10: In file included from /Users/andrewsangster/Desktop/Catch2-master/projects/XCode/OCTest/catch_objc_impl.mm:54:

Thanks in advance for any help you can offer,

Andrew Sangster

Phil Nash

unread,
Dec 13, 2017, 4:26:44 PM12/13/17
to catch...@googlegroups.com
Will you be using Catch with an Objective-C project?
OCTest is a sample project for the Objective-C usage. It's not automatically tested on our CI (since we don't have a Mac based CI yet) so it gets broken from time to time - I'll take a look.

However to use Catch, even with Objective-C, you only need to #include the single header (single_include/catch.hpp)

Andrew Sangster

unread,
Dec 14, 2017, 8:44:12 AM12/14/17
to CATCH
Its a cross platform app being deployed to both Windows and iOS. Mainly C++ with Obj-C for specific iOS implementations.
Message has been deleted

Andrew Sangster

unread,
Dec 14, 2017, 12:21:36 PM12/14/17
to CATCH
Thanks for the great response. Have you ever experienced not being able to find the iosfwd library on macOS?

Phil Nash

unread,
Dec 14, 2017, 12:29:31 PM12/14/17
to CATCH
Which response? I was halfway through writing one (but got side tracked trying to get the OCTest project to work!)

Also it looks like your previous message got deleted - not sure if that was me accidentally pressing something or if you did it?

<iosfwd> should work just fine - it's the header that contains forward declarations for the IOStreams library - and has been a part of C++ since the first standard.

As for the issues in OCTest I'm not sure what I'm looking at yet (as the specific errors seem to go away when I boil it down to a minimal repro - so there's some weird interaction I'm missing. I haven't tried just using the single include in an OC context yet, but it's likely that does have the issue after all.

Andrew Sangster

unread,
Dec 14, 2017, 12:36:30 PM12/14/17
to CATCH
Your first one. I deleted the post after proving myself wrong :P

I must have something configured wrong since I can't find <iosfwd>.

Jens Alfke

unread,
Dec 14, 2017, 12:59:05 PM12/14/17
to Andrew Sangster, CATCH


On Dec 14, 2017, at 9:36 AM, Andrew Sangster <andrew.thom...@gmail.com> wrote:

I must have something configured wrong since I can't find <iosfwd>

What version of Xcode? Mine can find that header with no problems; the file is located at

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd

Have you made any changes to your target’s header search paths?

—Jens

Andrew Sangster

unread,
Dec 14, 2017, 1:09:53 PM12/14/17
to CATCH
Xcode 9.1 (9B55)
No changes to target's header search path. Would that change based upon project type? I'm doing a command line app for this test but that shouldn't disable any sort IO Stream libraries. 

Andrew Sangster

unread,
Dec 15, 2017, 11:33:42 AM12/15/17
to CATCH
Hey Phil,

I'm sure your super busy but has there been any progress on this?

I've tried a new approach trying to test the obj-c test cases through a simple QT project (the primary framework being used in the project).
I've gotten further to a point where I can't find x86_64 symbols for Catch::StringMaker<bool>::convert(bool)
I'm currently manually pulling in the Foundation Framework by hand, is there another framework or library your code would depend upon?

Thanks again

Phil Nash

unread,
Jan 25, 2018, 3:08:57 AM1/25/18
to CATCH
Sorry Andrew,

I took some family time off over the Christmas period and this got lost somewhere. I'll try and get back onto it shortly.

Are you still watching this (or did you get anywhere yourself?)

Andrew Sangster

unread,
Jan 25, 2018, 9:21:36 AM1/25/18
to CATCH
Hey Phil,

Yeah I got it sorted out and have the example running on our mac machine. I wish I could tell you what the issue was but it was a few weeks ago and I've been transferred to a different project so I have completely forgotten.
Anyways thanks to you and the rest of the community for the assistance and I hope you had a great holidays.

I'll mark the issue complete.

Thanks again,

Andrew

Phil Nash

unread,
Jan 25, 2018, 9:26:45 AM1/25/18
to CATCH
Thanks for letting me know. Glad you got it working.
I'll have to look again my end.
Reply all
Reply to author
Forward
0 new messages