home Forums # Technical Support Using fuzzylite library in iOS

Tagged: 

Viewing 10 posts - 1 through 10 (of 16 total)
  • Author
    Posts
  • #1686
    Unknown
    Member

    Hi Juan,
    firstly congratulation for your fuzzylite library, because I saw it is very very well structured and complete.

    I tried to use fuzzylite 5.0 in my iOS applications, but I got some errors.
    I’ve added fuzzylite headers’ path to the Header Search Path, and the library’s path (the path of the file .dylib) to the Library Search Path, and finally I’ve also added -lfuzzylite to the linker options.
    In fact the compiler finds everything, but when he tries to execute the methods of the library I get this error : Undefined symbols for architecture armv7

    I run the project on an iPhone 4s, but it’s the same thing even if I try to run it on another device or on a simulator (obviously the name of the architecture is different).
    I also tried the previous version of fuzzylite, but nothing changed.

    I hope you could help me. Tell me if I don’t explain the problem correctly.

    Thank you in advance for your attention.

    #1690

    Hi Lucia,

    thank you very much for your email, and please excuse the delay in replying.

    To use fuzzylite in iOS, you need to build the libraries using the proper target architecture. Please, take a look at https://code.google.com/p/ios-cmake/ to build using CMake. You need to generate the proper library for iOS. I think an alternative would be to include the sources of fuzzylite in your project and build the project, but I am not sure about this. It would be great and very appreciated if you posted some instructions once you build fuzzylite for iOS.

    Cheers,

    Juan.

    #1694
    Unknown
    Member

    Hi Juan,

    thank very much for the instructions and don’t worry for the delay,
    I’ll write here any news…hoping about success!!

    Best wishes,

    Lucia.

    #1743
    Unknown
    Member

    Hi Juan…sorry for the delay, but in this month I’ve been engaged also in other things. First of all, let me say that I was able to run fuzzylite in iOS! 🙂
    The solution you proposed would be perfect if iOS-cmake worked for the newest versions of Xcode, but unluckily it works for Xcode 4.3 and below.
    For people who use newest versions of Xcode, the solution I adopted is so straightforward and simple that I couldn’t believe I haven’t thought of it earlier. I simply used your folders of headers (the one named “fl”) and source (the one named “src”) to build a static library in Xcode from the beginning, hence starting by File->New->Project->iOS->Framework & Library and so on.
    In order to build successfully the library I had only to replace the null pointer fl::null with the variable NULL, because Xcode can’t assign a “const long” to a class instance…but I don’t know if everyone will meet this issue.

    Best wishes,

    Lucia.

    #1744

    Hi Lucia,

    thank you very much for posting the information to build fuzzylite for iOS.

    Since you have created an empty project using Xcode, I guess that you did not declare the compiler directive FL_CPP11. I believe that, if you declare it, you will be able to build fuzzylite for iOS without changing the fl::null to NULL.

    Would you mind checking if I am right? That is, change back the fl::null to its original value and declare the compiler directive FL_CPP11 in your fuzzylite library project and in your project using fuzzylite, and check if it works.

    Again, thanks for posting your information!

    #1745
    Unknown
    Member

    Ok Juan,
    surely I will try, in fact I saw both your definitions of fl::null, but I didn’t know how to tell the compiler to use the right one!
    Thank you for the suggestion, I’ll check it and write the outcome!

    Lucia.

    #1746
    Unknown
    Member

    Yes Juan,
    I’ve just added the following compiler directive to the library project:

    #ifndef FL_CPP11
    #define FL_CPP11
    #endif

    and in this way there is no need to change the null pointer!
    Thank you very much for the suggestion, and now…let’s enjoy fuzzylite!! 🙂

    Best wishes,

    Lucia.

    #1747

    Hi Lucia,

    that is great!

    A tip, though, instead of what you did #ifdef ..., there is a better way to define preprocessor macros. Please, check the attached image:

    Preprocessor macros Xcode

    Thank you very much for your help :).

    Cheers,

    Juan.

    #1748

    You will have to add that preprocessor definition FL_CPP11 to both Debug and Release. The rest are automatically created by cmake. By the way, you can create the entire Xcode project of fuzzylite by doing:

    
    $ cd fuzzylite
    $ cmake . -G"Xcode"
    $ open fuzzylite.xcodeproj/
    

    Please, use these steps to create your fuzzylite project. There are several variables that are set in CMake, and I am afraid you will not have them unless you create the project as aforementioned. However, I am not sure how to turn this new project into an iOS library.

    #1933
    Unknown
    Member

    Hi Juan,

    I am also trying to implement fuzzylite in iOS, I have created a fuzzylite project using CMake (As mentioned in your last comment).But right now I am stuck here because i dont know what to do next.Can you say anything about using cpp examples with this project? Waiting for your reply.

    Thank you.

Viewing 10 posts - 1 through 10 (of 16 total)
  • You must be logged in to reply to this topic.