FMDatabase.h not found when using route-me library - ios

So im trying to use the route-me widget in my app, but xcode keeps complaining that it cant find FMDatabase.h, yet its included in the project (albeit under a different project that is included into my project). I've copied how a sample app has been made yet the sample project doesnt get this error. The RMDBMapSource.h file is contained within the MapView project, so i shouldn't need to include the fmdb stuff myself (and because the sample project doesn't do that)
Surely if the files are under compile sources / copy headers under build phases, that means it should be able to find the file? This is a pretty lackluster explanation of my problem, but if anyone has used the route-me library before maybe they have had the same problem and can point me in the right direction

Resolved my own mistake. First off in the build settings of the main project, the 'search for header paths' was not set correctly, it was set to /MapView/ instead of /MapView/** that resolved the FMDatabase.h missing error.
Then in case someone else had a linker error like i did after i resolved the first issue, make sure you have libMapView.a included in your link binary with libraries section. (i had it their before, but during a version control commit, somehow our project file decided to not add that library anymore and i had totally forgotten about it, so took me quite a while to find out that it was missing)

Related

Undefined symbol "_OBJC_CLASS_$_CkoFtp2" link error with chilikat

When I'm writing simple code in ViewController, I wanted to run it and boom. Apple Mach-O linker error as shown. I don't know what is the problem. Then, I've made a quick research, according to research; I deleted Derived Data folder, I deleted Derived Data folder contents, I deleted test hosts in build settings(it is already empty), I cleaned the build folder and I applied clean action. But nothing changed same errors. Is there any specific solution of this error depends on app and what is that solution?
EDIT:
I moved the codes to a new xode project and I noticed that when I add the line let ftp = CkoFtp2(), the error occurs otherwise it compiles. But it is coloring the CkoFtp() part of line and I'm not getting any specific errors there. Just Match-O and linker command.You can see the CkoFtp2 code here.
I had the same issue. Please make sure to follow the directions on chilkat's site, particularly the following:
Add libChilkatCocoa.a to your list of libs for linking. In your project build settings, find Build Phases, Link Binary with Libraries, select Add Other, navigate to the libChilkatCocoa.a, and add it.
The Chilkat library internals are written in C++. Therefore, your Swift application will need to link against the C++ runtime libraries. In your Build Settings, go to the Linking section and add -lstdc++ to the Other Linker Flags.
https://www.chilkatsoft.com/chilkatSwiftCocoa.asp
I also ran into trouble because the libChilkatCocoa.a library resided in a folder that had a space in its name. Avoid that, or make sure it is correctly escaped under Build Settings.
Looks like you've got a reference to a framework located in your Downloads folder. Chances are you moved that somewhere else, yes? Remove the SimpleUnzipper framework from the project and re-add it from wherever you moved it to.
After the edits, this is clearly not the problem...
It's hard to tell from just the error message, but it appears that you're using a library that you downloaded from another developer. Are you sure you followed their instructions for setting things up? The linker error means that you're not linking your program with the library, though it looks like you've managed to set up a bridging header so that you can call the function without getting a compiler error.

How to integrate Unity inside native iOS App?

I'm having troubles integrating a simple Unity project inside a native iOS App.
I followed this this tutorial but I think that some things have changed since it was written. I'm stuck with this error:
And thats not the only one, there are 1600 files that include include that file. The problem is that all this 1600 files have a wrong reference to il2cpp-codegen.h
This are my build settings for the Unity project:
So, after following all the tutorial, should I change all the files so that all the references would be correct? Or am I missing something else?
Thanks!
Joel
EDIT
I'm currently using Unity 5.1.1f1 Personal version.
Do you have a warning saying folder not found or something like it?
I think you didn't set the path for Libraries/libil2cpp/include in your header search paths.
You probably didn't copy the Libraries/libil2cpp folder.
That folder isn't visible inside the Xcode project but you can find it in Finder. You should try and copy that folder also and maybe add it to the Build Phases in Xcode. Not sure about this last step.

Alamofire RED in Xcode project - No Alamofire.framework file

I'm trying to install Alamofire into my Xcode project. However, after following all the steps for installation given by the documentation on the github project, the Alamofire.framework file shows as red in Xcode, and the project will not build. Further, there seems to be no way to fix this, because the Alamofire.framework file does not exist in the package on github.
More detailed explanation:
Following the instructions on github to install manually is fine until the final step: "Click on the + button at the top left of the panel and select "New Copy Files Phase". Rename this new phase to "Copy Frameworks", set the "Destination" to "Frameworks", and add Alamofire.framework."
Because we have already included the project, when we go to add a new framework, Alamofire DOES show up in the list of available things to add. However, when we add it, it shows up red. As we know, this means that the path is incorrect relative to the SDK. Ok, fine... but when we go to correct the path by looking at the Alamofire directory that we put into our project directory, there are a lot of files and none of them are "Alamofire."
I know that I downloaded the package correctly. I installed as a git submodule, I deleted it to retry, I downloaded the zip from github, retried again, etc. Even for this tutorial (http://www.raywenderlich.com/85080/beginning-alamofire-tutorial), if you look at the pictures for this step, we can see that there is no framework file in the directory!
So, Xcode demands a path to a .framework file that doesn't exist... yet we were able to add the framework somehow. Forgive me if I am confused.
There are quite a few questions out there on Alamofire install issues, but I think there must be something here that noobs like me are missing. One poster, here (Alamofire framework not found), is asking something similar, but it appears that her question was misunderstood (she did not accept any answers). I notice the "It's red tho!" frustration showing up in many comments for Alamofire install-related posts- an answer here would really help clear that up.
I was having the same issue as you, however, I found this question which made me build the project even though everything was red. To my surprise it ended up actually building successfully and afterward I was able to import Alamofire into my Swift files.
I had tried to build earlier unsuccessfully, however, between builds I did change one thing. I moved the Alamofire-master folder to the first level of my App's file structure before including the .xcodeproj file in the Project Navigator, as indicated by the tutorial that you linked. I had initially just moved it from its place in my downloads folder.
The whole copy frameworks part seemed to be a nonissue for me because the framework ended up instead in embedded frameworks automatically, after doing the embedded bin step.

Includes fail to resolve correctly in Xcode workspace

I'm having trouble linking to a static library in Xcode 5. I did read the chapter on building and using a static library in the Pro iOS 5 Tools. What it told me to do after creating your static library, was to link against the framework in the Build Phases tab. That part is pretty straight forward. Then it says in the Build Settings, under "Header Search Paths", to add:
$(BUILT_PRODUCTS_DIR)
Then in order to use my static library, I just import it like so:
#import "ConversionCalculator/ConversionCalculator.h"
So this used to work up until yesterday. I tried adding a new static library to my project which didn't seem to work. So I cleaned my project, and tried rebuilding again, but now Xcode complains about #import "ConversionCalculator/ConversionCalculator.h". It says
Lexical or Preprocessor issue. 'ConversionCalculator/ConversionCalculator.h' file could not be found.
I was wondering if anyone has any tips on debugging this. I've looked through different tutorials like this:
http://blog.stevex.net/2012/04/static-libraries-in-xcode/
http://cocoamanifest.net/articles/2011/06/library-management-with-xcode-workspaces.html
http://www.raywenderlich.com/41377/creating-a-status-library-in-ios-tutorial
But I can't seem to find the "golden way" to link to a static lib, or how to troubleshoot why Xcode cannot find my file. My file structure is setup on my machine like so:
Projects\
DistanceCalculator\DistanceCalculator.xcodeproj
ConversionCalculator\ConversionCalculator.xcodeproj
DistanceCalculator.workspace
Like I said, this all used to work too when I followed the tutorial in Pro iOS 5 Tools book. Now I don't know why my workspace cannot find ConversionCalculator when it has used it before. The part I find hard is different articles say different things about the header search path, and I'm not sure what the best way to populate that field is. Any thoughts? Thanks in advance!
Edit:
I'll add that I can build for the device without errors. But when I switch to the iPhone simulator, it gives me that error about not being able to find the file. I also see that I get this warning:
ConversionCalculator was rejected as an implicit dependency for 'libConversionCalculator.a' because its architectures 'i386' didn't contain all required architectures 'i386 x86_64'
Looking at that, I'm not sure what that means. If it means that my library is not being built for all architectures, I just tried creating a Target that builds for all architectures according to the wenderlich article in the above link. That seems to work as when I go to the dervieddata folder, I see for debug, release, and universal, I see the libConversionCalculator.a file. But then when I go back into the workspace and try to rebuild the project for the simulator, I get that could not find file error and the implicit warning.
Edit #2:
I just saw a warning flag on Xcode that says upgrade to recommended Build Settings. Now I get no errors. Not sure what happened... but I guess no errors is good.
I would follow the description available in Xcode's Help topic "Linking Against Your Library" in chapter Configuration Your Application in Introduction to Using Static Libraries in iOS
(you may search within Xcode Help, too).
Except that I would recommend to include your headers from libraries always using angle brackets:
#import <ConversionCalculator/ConversionCalculator.h>
Using double quotes may inadvertently search and find files with the same name in some sub-folder relative to the file where this import directive is written. Only after there was no file in any sub-folder the preprocessor starts searching with the specified header search paths.
Using angle brackets, the preprocessor immediately searches only at the specified header search paths.
So, since you actually want to find headers for the corresponding library, always use angle brackets.
Note: If you follow the recommendation to create a static library project, you don't need to explicitly set a header search path in the target that links agains the library: Xcode will already add a search path:
$(BUILT_PRODUCTS_DIR)/includes
Your library headers are located in
$(BUILT_PRODUCTS_DIR)/includes/<product-name>
which are placed there through the "Copy-Files" phase of the iOS static library target, whose "Destination" is set to "Products Directory" and whose "Subpath" is set to "includes/${PRODUCT_NAME}" per default.
You may change these default settings to other reasonable and sensible values. (if you do, consider the the consequences for Xcode's default search paths!)

cant import NYXImagesKit library

I am trying to import the NYXImagesKit library in to my iOS 5.1 project but it will not show up as importable code. It cannot find the library. I have dragged the NYXImagesKit library in to the project and added the libraries. I have also added the following to my build phases:
However I still get an error saying it cannot find NYXImagesKit.h when i try to import it.
NYXImagesKit can be found from here: https://github.com/Nyx0uf/NYXImagesKit
Ive used this in a previous project so I know that it works.
screenshot of location of .h file:
header search paths:
You are not having an issue with "importing" the library proper. (I would not like to appear pedantic, but a library is linked, not imported). The issue you are having is with the header file which comes with the library.
To fix it, you should make sure to add the path to NYXImagesKit.h in your project build sentting (Search Headers Path). This can by found under Build options in your project settings.
Alternatively, an easier way is to add the NYXImagesKit.h file to your project (like any .m file). Then it will be found without the need to specify an header search path.
EDIT:
Since from what you report, everything seems ok, he only idea I can come up with is making sure that the paths are defined for your target (as opposed to the project overall); but I guess it is already like that.
Other than that, only resort is thinking that the project got corrupted somehow. You can inspect the project.pbxproj file inside your .xcodeproj document with a text editor and ensure that everything looks fine.
If everything fails, just start over with a new project.

Resources