I develops PHP extension, and have a problem with search include paths.
With development i create a empty project (Create new project -> Other -> Empty), and add header file:
#include "php.h"
And if i CMD+Click on this file, XCode view Symbol not found. In project configuration section Search paths not exists ;(
In project build setting i have only User Defined section.
How i add include paths to XCode, if i created empty project?
Thank.
P.S.
XCode - 5.1.1
As solution:
Add target Command line application, then there will be search paths section.
Related
I am trying to use the react-native-notifications library but I am getting a file not found error when I try to import "RNNotifications.h".
I followed the "Linking Libraries Manually" guide on the React Native docs. Play by play, this is what I did:
Step 1:
I opened my project on Xcode, clicked my project's name, opened its "Libraries" folder, then used Finder to add "RNNotifications.xcodeproj" (a file located inside my project's node_modules/react-native-notifications/RNNotifications folder).
Step 2:
Made sure my project was selected, targeted my project's name, then added "libRNNotifications.a" in "Build Phases" under "Link Binary With Libraries".
Step 3: I went under "Build Settings" and added the following path to my "Header Search Paths":
$(SRCROOT)/../node_modules/react-native-notifications/RNNotifications
I did so with the "non-recursive" option because there are no sub-folders inside the RNNotifications folder.
Step 4:
I went inside my project's "AppDelegate.m" and added the following import statement:
#import "RNNotifications.h"
After these four steps, I get a "'RNNotifications.h' file not found" error.
On step 3 when you search for "Header Search Paths" make sure to select the target which is your projects name, you can do this by looking at the left tab, you should see the Project tab with the xcodeproj file under it and another Targets tab. just select your project under the Targets before searching for "Header Search Paths" then add the path there
$(SRCROOT)/../node_modules/react-native-notifications/RNNotifications
This image shows the TARGETS tab which you must select first
As I experiences with these issue.
I have no idea with this package installment.
It's working fine in Android, but not in iOS.
But I have solved it by re-create RNNotifications.h and RNNotifications.m into directory of the main project instead.
Because Main project it's connected with Firebase Library directed.
But if we call from RNNotifications project, you will got error by 'RNNotifications.h' file not found
Here is my structure and edition sample for you, hope it will be help you for some idea:
I had the same problem, so what I did is steps 1, 2, and 3 you have listed above, but before I did step 4, close Xcode and open it which will re index the project or workspace, then type your import statement and it should work, thats what worked for me. If you don't restart xcode or close and open your por
Strangely enough, this seems to have resolved itself. I did nothing differently, nor did I make any modifications--I suppose it is another "wonderful" quirk of Xcode. – user8951490 Jan 25 at 12:17
Use pod install and this will install required library
To access the resource file namefile from a program:
I ostensibly just need to check the box "target membership" to identify it as a resource file:
but this box is disabled.
What am I missing?
The helloworld target in your project is configured as a command-line tool (the square black icon that looks like a Terminal indicates this). Those compile to a single, standalone file thus Xcode cannot embed a resource file with it (which is why it's disabled).
You need to build a "Cocoa Application" target if you want to be able to include resource files. You can start a new project using the Cocoa Application template or manually add a target to your current project. You'll probably find it easier to start with a new project.
Add resource files to a command line tool
Add the file to the "Copy Files" section of your project's Build Phases:
Make sure to set Destination to "Resources", clear Subpath, and untick Copy only when installing.
Then whenever you build, Xcode will copy the file into your app's build directory, right next to the executable:
That's a screenshot of the ~/Library/Developer/Xcode/DerivedData/[your project]/Build/Products/Debug folder.
This method also works when you archive your app.
Note: if you want the file to be in some subfolder relative to the executable, e.g. res/images/, set the Subpath to that path.
I have deleted my .pch file by mistake, and now my project cannot be built anymore.
What should I do?
I take it you don't have version control?
You could just use the contents of a pch file from a different project or create a new one. If you search in your build settings for "pch" you'll see what the name of this pch file is expected to be and where it should be in your project
I as using visual studio 2010. My solution is having more than one projects in it which are have relationships to each. When I adding a reference to a other project I can use public components (classes,enums ) of that. But when I compile it it gives error saying that those classes are not referenced(Not available).
But when I change the folder structure(When I reduce the level of folder hierarchy/when project folders borings to the root folder ex: d:\ ) it works fine.
Is it because of the length of the folder hierarchi ?
Check your namespaces
When you're adding reference, add it using Project References. So what it does is it compiles the dependencies first. Check if all projects are compiling individually.
Verify target framework versions
No, it is not because of folder hierarchy.... it is because not setting hierarchy properly !!
Follow this steps:
Lets say you have project A and project B.
Project A is dependent on Project B. So we need to add dependency of Project B to Project A.
So right click on Project A -> Open Folder in File Explorer.
Then check which folder it opens into (Lets call it "source folder") and check where the project files whose dependency to be added (Lets call it "destination folder") are located from that folder location. Add the relative path from source to destination folder. (Ex: "..\..\destination folder" ).
Add this relative path in Project A Properties -> Configuration Properties -> C/C++ ->Additional Include Directories.
Good luck.
Yes, hangar18 has suggested correctly. Add reference of each project (Static Libraries) to you execuatble project ( Console Application Project / Startup project).
Also add path of each folder where the header files and corresponding C/C++ files are residing.
I have been trying to build a code that has dependencies with other header files that are not in the project directory. I added the paths to these header files in both HEADER_PATH and USER_PATH. However, I still see error while building. It says that the file is not found. I verified that the file exist in the path added to the header search path in project settings.
How do I make sure that all my header files referenced in the project is included and the paths are being picked by Xcode during compilation?
I tried copying all the files to the project with no luck. This is the first time iam using Xcode, so its kind of frustrating. Iam a linux guy and comfortable with make files. Is there a Make file for xcode which i can modify to include the header file directories.
You might want to check the order of your source files in your target's build phases to ensure that your dependencies are compiled before your source files that reference them.
Select your project in the Project Navigator.
Select your target.
Click on the Build Phases tab.
Click on Compile Sources to expand the section.
Drag the dependencies to the top of the list.
Are you sure you spelled the header file name correctly ? Is the case correct ? Did you use user quotes "" rather than system quotes <> ?
Assuming you've checked all the obvious things such as the above then one other thing to try is to quit Xcode, delete the "build" folder in your project directory, and try again - sometimes the build folder gets in a pickle internally.