I have a project that contains several header files, when the project imported into Xcode and compiled, on of the header files caused the following error:
expected identifier or )
../../../projjack/Lumbroot/xx.h
would you please suggest some solution to fix this issue, there are similar questions about solving the same error, but it does not address my issue.
also,why do you think I receive such an error despite the path to the header file does not contain ")" sign?
Because the error is in what is being included not in the file name.
would you please suggest some solution to fix this issue
In Xcode open the file reporting the error then select the menu item Product > Perform Action > Preprocess "<file>". This will produce you a "flat" view of the file with all files included and all processing tokens expanded. The view will contain lines starting with # which indicate the files the various lines originally came from. In this view locate the point at which Xcode shows the error in the original file and then examine the lines preceding that point. You should locate what is causing your issue. You can then open the original file containing the error and fix it.
HTH
Related
The exact code works for someone else, but on my computer it doesn't, I have the exact files as that person.
Here you can see the directory and some of the code1
And here you can see the fails 2
Edit your question and add - as a text - the source code, the error, and any other relevant information - like the directory structure of the project.
The secend screenshot shows errors that resource files are not found; from the output it looks like you are importing them as "Resources/file.robot".
In the same time in the first screenshot it looks like the Resources folder is on the same level as your suite's one. So change the imports to be "../Resources/file.robot", to set where the framework should find them.
I'm trying to get the example for creating a PDF/A document with Apache PDFBox up an running (CreatePDFA.java).
For this I copied the example class as is into a project module that includes a maven-dependency on PDFBox in version 2.0.0-RC3. I only changed the method signature and used a fixed font, filename and message instead of args[].
When trying to run the code I get an NPE in Line 107 because it cant't load the color profile (InputStream is null) When I check the included library in the project details I can see the resources folder, but it does not contain the expected file, namely "pdfa/sRGB Color Space Profile.icm".
Unfortunately, google-ing the problem only turned up more references to always the same example implementation, but after a while I acutally found what seems to be the needed file on apache.googlesource.com
I copied the file to our own resource directory and then used this line of code instead:
InputStream colorProfile = CreatePdfA.class.getResourceAsStream("/pdfa/sRGB Color Space Profile.icm");
This finally stopped the NPE - the file is apparently found - but now I get another exception which says:
java.lang.IllegalArgumentException: Invalid ICC Profile Data
Here, I'm stuck. I had hoped that this would work just out of the box, but it seems like I am missing something. Any ideas?
You already answered one part of the problem yourself: put the file into your resource directory.
The second problem may be a bad repository mirror or a transfer problem (binary to ascii). Here's the official repository URL with the ICC profile from the example:
https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/resources/org/apache/pdfbox/resources/pdfa/
I'm attempting to import my "-Swift.h" file into one of my Objective-C .h files but xcode keeps telling me that the file doesn't exist
#import "Aesculus-Swift.h"
If I command click on the file name it will take me to the generated header file so I know it exists. Why is xcode not able to find it?
This seems like just another issue with Xcode and it's complex tool chain of static analysers and compilers.
Openradar lists radar://21362856 - Swift to Objective-C bridging is unreliable. I am sure there are more but I stopped looking after finding one for this example.
The author imarcelv notes in the description:
I asked a Swift engineer at WWDC in a lab and even he didn't know how to fix this issue.
Steps to Reproduce:
Add a ramdom Swift class to an Objective-C project
Add the #import "ModuleName-Swift.h" file that Xcode generates automatically
Try to use it or just try to compile the project
From time to time it simply doesn't work
It's probably best to file a radar on this issue as it seems that others are already calling it out.
One other thing you could try...
Historically, it was possible for Xcode to completely lose it's syntax highlighting and you could always find out what files the static analyser was giving up on by increasing log level of clang.
I'm not sure if it's still relevant but if I was in your position I'd be trying this command:
defaults write com.apple.dt.Xcode IDEIndexingClangInvocationLogLevel 3
This generates logs you can search with using Console.app for just xcode to highlight the messages. You'll want to trash the derived data of your project to force it to re-compile things.
Although not the same issue as what you're seeing, I have had this post on the syntax highlighting issue bookmarked for years for the above defaults write command to try in times like these.
I solved this recently by adding the following entry to my .xcconfig (you could add it in Xcode's Build Settings > User Header Search Paths if you prefer).
USER_HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/MyFramework.framework/Headers
This tells the compiler to search for headers in the build output directory, which is where Xcode puts the generated header (at least in the case of this framework).
In my case this is a directory like ~/Library/Developer/Xcode/DerivedData/MyProject-LongCode/Build/Products/Debug-iphonesimulator/MyFramework.framework/Headers/MyFramework. You might find your generated header in there too.
Xcode's header and dependency management is a hot mess, and it's not surprising that it doesn't work for you.
I had trouble with this stuff & found that your -Swift file is the Product name of your Target ( not just the name of your Target ) . I found the details here helpful: http://ericasadun.com/2014/08/21/swift-calling-swift-functions-from-objective-c/
When you encounter such situation, just find your kinda "ProductName-Swift.h" file by just cmnd+click on it (even if xcode shows warning about it is not found, the #import "Aesculus-Swift.h" string is still clickable) and then in opened code editor window choose context menu and "Show in Finder" item, then explicitly add it to your project.
Im relatively new to programming and am just in the process of uploading my first app to the app store however i am getting the following error message which i just can't figure out / fix. I have looked everywhere online for a solution but as yet, no luck. Please can someone help? I am using Xcode 5:
Error:
ERROR ITMS-9000: "Invalid Image Path - No image found at the path referenced under key 'CFBundleIcons': 'AppIcon40x40'" at SoftwareAssets/SoftwareAsset (MZItmspSoftwareAssetPackage)
This really doesn't mean anything to me as i have tried all the usual asset catalogue stuff / looked at my p-list.
You need an App Icon.
If you created the project in Xcode 5 then there should be a catalogue called Images.xcassets where you should place the icons of the correct sizes for your app.
I have added a screenshot of my app as an example of what I am talking about:
I saw the same error. First I thought that the images where not correct (I found one with 144 dpi), but the error showed up again.
Just search for the exact name "AppIcon40x40" in the whole project using Shift+Cmd+F. I have seen it referenced in a plist file under another key. There you have to change the names to the appropriate ones.
when i compile my project, i have this error :
ld: duplicate symbol _OBJC_CLASS_$_DNCloseButton in /Users/.../Library/Developer/Xcode/DerivedData/...Objects-normal/i386/DNCloseButton-7045D069F03DAA13.o for architecture i386
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang++ failed with exit code 1
I know that the problem is about the class DNCloseButton but i don't how to solve it ? thanks for your answers.
Ensure you've only declared the interface once, in a header file (.h), and imported that header file with #import and not #include.
Sometimes XCode cocks up a little bit and links the same file twice at the linker stage. To fi this:
Remove the file from your project (select the 'remove references' option) and then add it again.
Clean with shift-cmd-k
Build
Hope this helps!
This will happen if a source file is include twice in your Compile Sources Build Phase.
To check this in Xcode 4:
Select your Project from the file list.
Select your target from the left column.
Click on the Build Phases tab on the top bar.
In the search field, type in the name of the class that is causing the linker error. In the case of the question above, it is DNCloseButton (ignore the preceding _).
If the source file for the class appears twice in the Compile Sources list, delete one of the entries.
You might also get this error if you by accident #import the .m file instead of the .h file.
This may happen in the following cases.
You have put the same class implementation into two different files;
You actually have just one implementation of this class, however you are also linking in your project a framework or library containing a class whose name is exactly the same of yours.
Try finding in the whole project your class and make sure only one copy is available within your project.