home › Forums › # Technical Support › Using fuzzylite library in iOS
Tagged: fuzzylite iOS
- This topic has 15 replies, 4 voices, and was last updated 7 years, 2 months ago by Unknown.
February 19, 2015 at 23:40 #1686
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.February 28, 2015 at 07:46 #1690
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.
Juan.March 2, 2015 at 22:15 #1694
thank very much for the instructions and don’t worry for the delay,
I’ll write here any news…hoping about success!!
Lucia.April 8, 2015 at 22:17 #1743
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.
Lucia.April 8, 2015 at 23:19 #1744
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_CPP11in your fuzzylite library project and in your project using fuzzylite, and check if it works.
Again, thanks for posting your information!April 8, 2015 at 23:31 #1745
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.April 9, 2015 at 00:17 #1746
I’ve just added the following compiler directive to the library project:
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!! 🙂
Lucia.April 9, 2015 at 00:30 #1747
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:
Thank you very much for your help :).
Juan.April 9, 2015 at 00:34 #1748
You will have to add that preprocessor definition
FL_CPP11to 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.September 10, 2015 at 21:42 #1933
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.
- You must be logged in to reply to this topic.