Expected identifier or "(" error on .h file - ios

I have inherited development of an iPhone app that was originally created overseas. The original developers are no longer available for questions. The app is currently available on the app store. So I assume the zip file that I received of the project is current and complete.
When I first open the project in xcode and do a build, I get hundreds of errors. They are all the same basic error. There are hundreds of .h files with one line:
../../../FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/ServerConfiguration/FBSDKServerConfiguration.h
I get the error "expected identifier or '(' on the first character of this line in every file.
I tried changing the line to:
#include "/../../../xxxxxxxxx"
and that worked. But as I said, there are several hundred of these files in the project. If this was a running app 'supposedly' from this source code, why should I need to go change hundreds of files and add #include to each line?
This project uses an old version of swift, and I had to go all the way back to xCode 7 to find a development environment that would support it. Is the .h syntax in these files some sort of deprecated syntax that stems from an even older version of xCode? Can some seasoned iPhone app developer tell me about this particular .h file syntax of including another .h file (and why it's failing for me now)?
Basically, if I need to change all of the .h files, then so be it. But I'm more than a bit concerned making this drastic a change to code that supposedly recently built a running app.
Suggestion? Enlightenments? Thanks.
Jerry

The "syntax" you described -- just a single line containing a file name (with a relative path)
../../../FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/ServerConfiguration/FBSDKServerConfiguration.h
has never ever been correct C/C++/Objective C (preprocessor) syntax. Either is some strange, proprietary custom preprocessing is running, or it's just garbage.
Using
#include "/../.."
is also nonsense: If you start a path with /, you start at the root directory, so navigating up with .. will lead you to root again, and xxxxxxxxx is expected exactly there in the root directory.
This was to the syntax. The semantics is hard to tell without the project.
Maybe it might just help if you completely remove those strange header files,
or comment out the erronous lines
or you need to adjust your include paths in the project to help Xcode find the files

Related

Transferring Xcode Project from one computer to another brings random errors?

I have a Xcode project I got from another developer. Initially when I opened it it has a bunch of errors (most of which were un-updated frameworks). I got it to work after a while and I fixed it. I want pass it back to the manager since I'm leaving uni in a few months. I copied it over to my friends Mac to see what would happen if I just took the project and all it's folders and made it a zipfile. It didn't work for some reason. It gave me an error:
error: using bridging headers with framework targets is unsupported
But why did that come up? I mean it's the same code on the slightly different versions of Xcode (13.1 versos 14.1) but I doubt there was a massive change between the two that would cause this. I want to be able to pass these app later in the future without having to care about this stuff. I made a GitHub (link below) would cloning that work? Also the laptop I chose was just a fresh reset. Would it be due to not having coco-pods installed?
I feel like I could go through and fix it all on that laptop and document that but then I'm afraid that every time I put it on a new one it would come up with random errors every single time making my documentation moot.
https://github.com/AbdullahMSaid/SonicExperiment-Works
With big help this was Fixed.
Things that fixed it.
Having the correct version of Xcode
Turning everything from absolute path to relative
Lots of other code fixes. But those are my project specific.
You don't need bridging headers in framework. Use should have something like "YourFramework.h" where you can import your .h files.

need to recover trados project with translation

I was working on a language translation project in trados on a virtual machine. Half of the work was done and the translated words were exported into a Word docx file. Upon restarting the virtul machine, the project file appears to have been corrupted as trados shows no signs that the project was worked on. When I manually open the sdlproj (trados project) file, trados cannot open the file mentioning the following:
: An error occured whilst trying to determine the file version
I have tried creating a new project and used pre-translate using batch tasks but that did not seem to have imported the previously translated document. I need to figure out how to recover my project so that I can recover the translated document (so I do not have to redo the work) as well as recover the translation memory for trados. The translation memory folder is present inside the original project folder. I would really appreciate any suggestion to further troubleshoot and fix this issue. I have tried their support desk but they do not appear to be available today. Two solutions I observed from their forum suggested:
save the project file with a zip extension, extract the contents and then open the sdlxiff file from there
recreate the project and use pre-translate.
In my case, I was able to open the sdlxiff file from the translated language directory. This opened the project with the text that had previously been translated. I am not certain whether I need to remove the sdlproj file or simply save the project hoping that it will overwrite the corrupted file. In either case, I will update this post once I get an answer to that.

Lexical or Preprocessor issue / xmlversion.h not found when using Sudzc/VTK in an iOS app

I've set up VES and am modifying the Kiwiviewer app in XCode 4.3.2. Kiwi builds and runs fine, so I'm now trying to set up Sudzc within my app (it works fine standalone). I've followed the tutorial here but at the point after modifying the headers, where his app builds and runs, mine instead comes up with a succession of errors. At first, it gives >150 errors all along the lines of:
Lexical or Preprocessor Issue
Invalid token at start of a preprocessor expression
Mostly pointing at the line
#include "xmlversion.h"
in a file tree.h, which is a part of vtkmodular/Utilities/vtklibxml2/include/libxml/tree.h.
Changing the " " to < > (which was suggested for a similar problem) instead gives another Lexical or Preprocessor Issue, this time that 'xmlversion.h' file not found - seemingly all in the file tree.h. The file's in my Project Navigator (and cmd-clicking on #include "xmlversion.h" does indeed load the file, so it understands it that way).
Presumably then the problem is with vtk having its own version of libxml2? If this is the case - what can I do about this? All of the errors I've looked at seem to originate from within soap handler classes, and eventually get through to "include < libxml/tree.h>" - which is then in the vtk directory shown above. I'm not really sure where to go from here - is it wrong to include the library that's added in the instructions? Can/should I modify the header paths? If this isn't the tree.h the rest of the code is looking for, where is it - a quick system search didn't find it?
Or am I completely off the mark?
Thanks in advance!
I got an answer from the VES Mailing List, link here. It ended up being as simple as removing the VTK version of libxml2, which it seems VES doesn't use. Hope this might be of use to someone!

Xcode Code Coverage and fopen$UNIX2003

I am facing what seems to be a pretty wide spread issue : when I activate code coverage in Xcode (4.2.1) with Lion it shows the following error :
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
fopen$UNIX2003 called from function llvm_gcda_start_file
I followed the workaround described here and added a file to my test target with a mapping for the fopen function but it won't work for me. With the new C file, I get a lot of Parse and Semantic issues, as if it was completly messing the compilator up.
Is there a specific config/compiler option I am missing ? How exactly should I add the new file ?
Actually the problem was fixed when I renamed the .c file in a .m file... I don't know if it could be an issue linked to ARC for instance.

Including a C++ header in an Objective-C project yields "Expected * before *" errors

I'm new to Objective C and (unfortunately) also to the project I am working on. I was given a small sample project that refers to work from my predecessors (in C++) and uses it for an iPhone app (Objective C). Rather than extending the sample (it was quick n dirty and I didn't wanna mess around in it) I created a new project from scratch for my stuff. To get it working I need to set up the same links to the previous libraries as the other one, but although in my settings I can't find any differences to the existing project it won't do the trick.
With the help of colleagues and Google I reached this:
1) The project includes two library files, libyid.a and libvrpn.a, via Xcode's "Add files" dialogue. It automatically added the libraries' paths to the Library Search Paths in the Build Settings and the files show in the projects folder structure in XCode.
As far as I can tell this bit seems not to cause problems.
Edit: if i remove these files from the project I get the same errors. I'm now thinking that XCode can resolve the headers, but can't find the implementation and that the libraries may have been there but not been properly set up?
2) One of my custom classes uses
#import "DisplayYid.h"
I added the path to the file's location to the "Header Search Paths" in the Build Settings and it seems to be found alright. (I also added the file via the "Add files" dialogue at some point, but it didn't change anything, so I left it this way)
Now the problem: in
#interface YidController : NSObject {
DisplayYid *myYid;
// (etc. etc.)
}
the identifier "DisplayYid" seems to remain unknown (Error: Expected specifier-qualifier-list before DisplayYid). In addition, all the class definitions in the headers that DisplayYid itself includes yield
error: expected '=', ',', ';', 'asm' or '__attribute__' before '__declspec'
My knowledge here is unfortunately very limited, but it seems to me that XCode can find the headers in question, but somehow would expect the content in a different format/language?
When I had DisplayYid.h included as a file in the project hierarchy I tried to set its file type in the file inspector to "C++ header" (as suggested by some hits I found on Google for my problem), but this doesn't change a thing.
I feel I am missing some tiny but crucial detail, but am not sure-footed enough in any of this to test around further. Hopefully somebody sees my missing link? And sorry if this is too lengthy, I simply tried to include the detailed steps in case this is were the problem lies.
Thanks in advance for your time ;)
EDIT: This question seems to be the same problem, especially the fact that he gets the error multiple times from files simply copied. But none of the suggested solutions seem to work for me.
It's been a while now, but I got hold of the guy who worked on this previously. It took him an hour, but he found the missing bit: In the project settings, two compiler flags needed to be set:
-DIOS (defining the flag iOS)
-x objective-c++
From there on everything went fine. Since this was a rather project-related question and solution, should I delete it all together?

Resources