trying to work with EDSDK from Canon using Xcode - xcode

just tried to install the EDSDK framework into the Xcode project framework folder. However I cannot run anything, as I am getting a lot of error messages. for example at this position in the EDSDK.h file:
EdsUInt32 EDSAPI EdsRetain( EdsBaseRef inRef );
I get the error message:
A parameter list without types is only allowed in a function definition
I get these all over the place. I really would like to make an MacOS app that takes an image and saves an image with a certain name.

The EDSDK should include two sample XCode projects written in Objective-C, namely:
CameraControl -- controlling the camera
RawDevelop -- processing (raw) images downloaded from the camera
If you'd like to skip the Objective-C part, you could bridge this into Swift yourself. Alternatively, have a look at the most recent PowerShot G7X SDK where Swift is used to make a similar example project.

Related

Xcode create shared framework across lots of targets

I'm making stuff for IOS, Mac, and WatchOS - I have certain common functionality that is more about me and the way I program than about whatever it is I'm programming - helper methods etc
What I'd like is to have a "Common" framework or library in my app which is included into every other library. I understand I need a separate target for each of ios, macos, watchos, but I can't figure out how to set it up.
I can create a framework - and it comes with a target - I can duplicate that target and change stuff, but I don't seem to be able to change it from IOS to macos for instance. I can create a separate macos target, but then I can't seem to be able to change where it gets the code from.
Essentially in my source tree I want a single directory:
Common
and then have target frameworks CommonIOS, CommonMacOs, CommonWatchOS - that all just compile "Common". How do I achieve that?
You're misusing the word "framework". All you want is to keep some source code as a library that all your projects and targets, no matter what system they'll be compiled for, can use. You are describing a Swift package.

Xcode beta generates App cannot be opened because of a problem

Check with the developer to make sure MyApp works with this version of macOS.
After trying to use ASWebAuthenticationSession, when the App receives the callback, it shows the error:
The same error is showed after an attempt to generate the app and open it.
The error you are seeing is because your code is referring to either a non existing library or is pointing to the wrong directory where your code should look for such library. Please check the rpath you are using. Usually, you should place any dylibs inside a Frameworks folder inside your bundle and thus your rpath should start like this: ../Frameworks/InternalAPI.framework (...)

audio unit fails to run in Logic; .exp _Entry undefined in linker

Background
I am trying to get Apple's example TremoloUnit to run in Logic 9. From various forums and this SO answer, the problem with Apple's examples seems to be that Logic 9 (and many other AU hosts) use old Carbon resources. According to this technical note, adding an appropriate .r file should provide the needed backwards compatability, so I added a .r that matches the sample .plist.
The Problem
If I include the line _TremoloUnitEntry in my .exp, the linker throws this error:
Undefined symbols for architecture i386:
"_TremoloUnitEntry", referenced from:
-exported_symbol[s_list] command line option
However, if I leave that line out (so that the entire .exp consists of _TremoloUnitFactory), Xcode compiles successfully. The resulting component:
passes auval -32 -v aufx TREM DEMO
runs in AU Lab
is detected by Logic's Audio Units Manager and passes its run of auval, but throws this error:
validation result: successfully validated
updating properties of AU Tremolo (Effect AU) by Apple Sample Code... Failed!
The Question
How can I get the demo AU to run in Logic? Endless Googling and Apple's outdated docs have failed me. (It would really be great if the example projects weren't still broken out of the box...)
System Details
Logic Express 9.1.8 (32 bit)
Xcode 6.2
Mac OS 10.9.5
AU Lab 2.2.2
Update
I wrote a simple gain demo from scratch, and... it works! Kind of. It runs in AU Lab and Logic but doesn't get detected by auval -a. Is there an Xcode project setting that would cause this? I'm new to Xcode and am failing to find a reason why the Apple demo is broken in one way and mine broken in another.
Make sure the only entry in your .exp file is _TremoloUnitFactory. You said you already removed _TremoloUnitEntry, so you should be good.
Next, in the Project Navigator, highlight "Info.plist". Select "View=>Utilities=>Show File Inspector" from the menu. In the File Inspector, under "Target Membership", uncheck "TremoloUnitEntry".
Recompile. That should do it.

How to compile swift library project into .so file?

I'm new to XCode and Objective C / Swift. I'm trying to make a Swift library project that doesn't depend on cocoa or anything. So it's just Swift files. What type of project should I be creating (I'm assuming there are multiple ways of doing this? How do I need to configure the project so that it builds to a .so file? And finally, how do I build it to a .so file?
I'm using Xcode6-beta.
You can create a Swift library for iOS by creating a new Xcode Project and selecting iOS/OS X -> Framework & Library -> Cocoa Touch Framework and then setting the language to Swift on the next screen.
Once this project has been created you are not required to link against the Cocoa frameworks, and can remove any references to them if needed.
Upon compiling this project Xcode will create a .framework folder in your build directory which contains a dynamic library which you should then be able to link against. Note however that I haven't had any success myself yet at linking directly against this file, even though it appears to be a standard dynamic library.
In terms of using this shared object file on Android I believe you will be out of luck, as the Swift language (much like Objective-C) requires a runtime library which is simply not available on other platforms at this time.
... I think you are limiting your train of thought a bit or expecting leaps and bounds to quickly swift is ready to work with objective c and cocoa so you aren't going to be able completely avoid cocoa however you wont have to write any of it the compiler will do that for you. but you will still have to use cocoa frameworks or modules like foundation( contains many specialized objects for program development), UIKit, CoreData however these don't require you to write the cocoa. and if Im not mistaken the .so file is made on compile so you never actually touch that file but rather is supporting files .swift
to do it
if your looking to do everything programmatically or if you want to xib or storyboards just make a new project I prefer an empty project.(set programming language to swift and decide if you want core data or not finish the project wizard thing and bam you have a YourAppDelegate.swift you can make another .swift file or a storyboard and hopefully you know what to do from there. Swift book is available on ibooks for free its nicely written
although it will be quite a while before cocoa and swift are completely separate... if ever

SDL-2: Trouble running native cocoa application in OS X

I'm curious if anybody could help with a problem I'm having. I just downloaded and installed the SDL 2 framework, along with the example programs that come with it, from Mercurial (http://www.libsdl.org/hg.php) onto OSX Mavericks (10.9).
I am attempting to run the example native cocoa code in Xcode 5.1.1, which includes the files testnative.h, testnative.c, and testnativecocoa.m that come from the tests folder in the Mercurial download.
I am successfully able to build the program, but as soon as it hits the function SDL_CreateWindowFrom(native_window), the program crashes and highlights the following line of a file called SDL_cocoakeyboard.m:
nswindow = ((SDL_WindowData*)window->driverdata)->nswindow; Thread 1:EXC_BAD_ACCESS (code=1, address=0x8)
The only thing I did with the original files was change the include headers from SDL.h and SDL_syswm.h to SDL2/SDL.h and SDL2/SDL_syswm.h in testnative.h. I've included both the cocoa and SDL2 frameworks in the program, and I turned off automatic reference counting, which was necessary to get the example code running.
I have no idea where else I could be going wrong, since the code before the aforementioned line looks and runs fine (it's able to create the cocoa window before it crashes).
Any insight on this issue would be great. Thanks in advance!
I was wrong in the comment, driverdata is null (never initialized), some code like SDL_cocoawindow.m:SetupWindowData would be required, but SetupWindowData is static (not global) and adding a minimal initialization would require SDL_cocoawindow.h(but isn't public).
So, my guess (maybe I'm wrong) this testnative isn't working, at least not with current SDL2 (the wrong #include should have been a sign) but a fast look into SDL2 shown there's enough cocoa code to hope there are other ways to get a native window working.
A good start How to set up a SDL 2 project for OS X in Xcode 4

Resources