zakk4223 / CocoaSplit

Stream/record your desktop/webcam to twitch/owned etc.
351 stars 34 forks source link

Trying to build command line tool using Xcode 6.2 : compile errors. #76

Closed AdamVStephen closed 9 years ago

AdamVStephen commented 9 years ago

I've cloned the latest git sources and am trying to compile the command line version of the tool using Xcode 6.2 on OSX 10.9.5.

The build gives the error "Instance method 'window' not found ; did you mean windows ?".

I see that in CocoaSplit/AppDelegate.h a window attribute is declared

@property (unsafe_unretained) IBOutlet NSWindow *window;

There is no such attribute in CmdLineDelegate.h but naively adding one doesn't help.

I am new to Objective C/Xcode, but an experienced C developer. Apologies if this is a dumb question. I have Googled trying to find a solution before posting this question. Many thanks to anyone who can point me in the right direction.

AdamVStephen commented 9 years ago

Now using version 4.4 of Xcode in the hope that this is more compatible with the build tools generally in use on the project, as the first version released for Mountain Lion.

Different build errors - some removed by excluding i386 platform (differences in how objective-C treats synthesise) now down to issues with undefined symbols from libavformat (AVIO_FLAG_WRITE).

define LIBAVFORMAT_VERSION_MAJOR 52

define LIBAVFORMAT_VERSION_MINOR 111

define LIBAVFORMAT_VERSION_MICRO 0

Any pointers to required compatible tools and dependencies gratefully received.

AdamVStephen commented 9 years ago

OK - macports version of ffmpeg updated to 2.6.2 eliminates the symbols issues. A couple of residual compile errors eliminated by // commenting out references to 10.9 constructs. Now compiles all of the binaries as far as I can see, but get lots of linking errors with symbols in the /opt/local/lib/libavformat.a library.

Any comments on recommended source for the ffmpeg dependencies would help at this point, and how to sort out the Xcode linker settings to work with /opt.

One tip for anyone also new to Mac is that /opt is not shown by default in the finder, until you sudo SetFile -a v /opt

zakk4223 commented 9 years ago

Are you using the master branch or the CoreImage branch?

AdamVStephen commented 9 years ago

Master branch.

river:CocoaSplit adam$ git status On branch master Your branch is up-to-date with 'origin/master'.

river:CocoaSplit adam$ git remote show origin

AdamVStephen commented 9 years ago

OK - I've now resolved all the symbols in the link phase. The solution was simply to replace the direct static linkage against /opt/local/lib/libavformat.a (and related libraries) by -lavformat linker instructions so that these libraries are compiled against the shared versions and hence additional symbols are resolved.

I now have a CocoaSplitCmd binary, and my only remaining issue is how to set my environment so that the dependency on Syphon be resolved.

river:Debug adam$ pwd /Users/adam/Library/Developer/Xcode/DerivedData/CocoaSplit-ftwhtyuqgdaxsbfuvgfrnbtwicup/Build/Products/Debug river:Debug adam$ ./CocoaSplitCmd dyld: Library not loaded: @loader_path/../Frameworks/Syphon.framework/Versions/A/Syphon Referenced from: /Users/adam/Library/Developer/Xcode/DerivedData/CocoaSplit-ftwhtyuqgdaxsbfuvgfrnbtwicup/Build/Products/Debug/./CocoaSplitCmd Reason: image not found Trace/BPT trap: 5

zakk4223 commented 9 years ago

It's been a while since I've touched the master branch (I've been head down on the CoreImage branch for a long time now) but I'm pretty sure the CmdLine version was intended to be built alongside the normal GUI version, and thus live in the .app bundle.

What's probably going on here is that it expects to have the Syphon.framework in the CocoaSplit.app bundle so it can link it at runtime. You can:

1)build the full Cocoa version so the app bundle is created, and then just run the Command line version from there. I did dev of that version mostly under 10.9.x, so I think it should still compile ok. I haven't tried it with Xcode 6, tho. Note this means the CocoaSplitCmd binary can't be copied between machines alone, the whole CocoaSplit.app bundle is required.

2) Install the syphon framework into the system framework paths and let it just link against that. You might have to go into the build phases and delete+readd it. And remove the 'copy files' phase that copies the framework into the app bundle.

3) If you don't care about Syphon just remove all references to it.

AdamVStephen commented 9 years ago

Thanks very much - I have now managed to build and can run the command line version.