C/C++ External dynamic library linkage -- example project?

  1. ‹ Older
  2. 2 years ago

    Norman P

    4 Nov 2017 Xojo Inc, Pre-Release Testers, Xojo Pro Seeking work. npalardy@great-w...

    @StephenGreenfield There MUST be an absolute sure-fire route to do so, Right?

    I expect there is for the very reasons you said but

    @Norman P I am not 100% sure

    :P

  3. Stephen G

    7 Nov 2017 Pre-Release Testers, Xojo Pro Ellensburg, Washington

    @Norman P -- Xojo support god Jason is presently researching the answer on C/C++ library (dylib, framework, et al) inclusion as part of an IOS app submitted to the Apple App Store. But seeing as this very basic question has taken two days (so far) to research, I'm getting a bit nervous...

  4. Norman P

    7 Nov 2017 Xojo Inc, Pre-Release Testers, Xojo Pro Seeking work. npalardy@great-w...

    The App submission guidelines are usually very thorough about what is / isn't permitted
    They don't explicitly say this is or is not allowed
    I havent spoken to Jason so it could be he's put the question to our Apple Support Rep and that can take time to get an answer

    I'm reasonably sure this is OK (google "ios using a dylib in your app" and you get a pile of hits)
    Plus
    - Apple gives you "how to's" on doing this with a "framework" which is a header + dylibs (and maybe other resources like images)(https://developer.apple.com/library/content/technotes/tn2435/_index.html )
    At the very least I suspect you could make this a framework and then its certainly OK and the declares are not much different just the location
    - there are several discussions on StackOverFlow about this https://stackoverflow.com/questions/4733847/can-you-build-dynamic-libraries-for-ios-and-load-them-at-runtime , https://stackoverflow.com/questions/37257763/can-i-compile-c-library-into-dylib-and-use-them-in-ios-9-project (and several others)

    Now Apple _may_ have changed the rules and require an app extension (that I'm not sure of)
    But I sure cannot find anything from them that says a dylib loaded this way is NOT ok

  5. Christian S

    7 Nov 2017 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    App submission with library is not a problem.

    I did submit a FileMaker based iOS app with my plugins.
    If you follow all the rules, they allow that.

  6. Stephen G

    8 Nov 2017 Pre-Release Testers, Xojo Pro Ellensburg, Washington

    @ChristianSchmitz -- Thanks -- I didn't see this before I emailed you earlier.

    I wonder if the rules for what is permitted is different for FILEMAKER (because Apple owns FIleMaker, Inc) than for Xojo? Do your own MBS IOS plug-ins make calls into a custom IOS Framework during IOS runtime?

    As I am beginning to understand the picture, a Xojo use must:

    1) generate a Framework -- not a bare dylib -- which gets included in the Xojo app "package". Of course, it must be properly signed.

    2) To make calls into that Framework, Xojo IOS uses MUST use soft declare and NOT External Method definitions, correct?

    3) Callbacks into the main Xojo code from the Framework are permitted by Apple?

  7. Christian S

    8 Nov 2017 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    Xojo has no plugin SDK for iOS, but FileMaker has one.
    The plugin is just another framework the app loads.

  8. Stephen G

    8 Nov 2017 Pre-Release Testers, Xojo Pro Ellensburg, Washington

    @ChristianSchmitz --

    So your MBS functions for IOS are via your own IOS Framework? And those are called via soft declares?

  9. Christian S

    8 Nov 2017 Pre-Release Testers, Xojo Pro, XDC Speakers, Third Party Store Germany

    my iOS stuff for Xojo is only Xojo source code without a library/framework.

  10. Stephen G

    8 Nov 2017 Pre-Release Testers, Xojo Pro Ellensburg, Washington

    Thanks, Christian -- then I guess I need to find someone else that has actually made calls into their own IOS Framework!

  11. Norman P

    8 Nov 2017 Xojo Inc, Pre-Release Testers, Xojo Pro Seeking work. npalardy@great-w...

    I thin Jean Paul Devulder did some stuff for iOS that uses his own dylib
    BUT I could be wrong
    You could PM him
    He's on here reasonably frequently

  12. Stephen G

    9 Nov 2017 Pre-Release Testers, Xojo Pro Ellensburg, Washington

    @Norman P -- yes, Paul Devulder has created his own Framework that integrates into an IOS project. He has shared that with me, and I think I see the process involved.

    However, he hasn't tried submitting a Xojo-generated IOS app containing his Framework to the IOS App Store. I'm not certain if anyone has.

    However, as @ChristianSchmitz states above, he has submitted an app to the IOS App store that contains his own Framework(s). So it seems doable.

  13. Stephen G

    12 Nov 2017 Pre-Release Testers, Xojo Pro Ellensburg, Washington

    @Garth H -- You mentioned earlier:

    I use a "callback" - I send the AddressOf of a Xojo function to the DLL, and call that.

    Do you have a simple example of this process? When calling from a Windows DLL vs a macOS dylib, is there a different calling convention to pass parameters back from the C-API code to the Xojo callback function?

  14. Eli O

    is not verified 12 Nov 2017 Europe (Berlin, Germany)

    #Pragma Directives Keyword
    Scroll to X86CallingConvention.

  15. Stephen G

    12 Nov 2017 Pre-Release Testers, Xojo Pro Ellensburg, Washington

    Cool! So stdCall on Windows -- but for macOS? CCDecl?

or Sign Up to reply!