Post

Replies

Boosts

Views

Activity

Reply to Project Won't Build with .h File
When my program starts up it calls some code to validate its App Store receipt. Now this logs the same error three times: 2023-07-14 11:35:23.905145-0600 appname[2702:35564] [Security] delegate_identifier:Performance Diagnostics__:::__message:This method should not be called on the main thread as it may lead to UI unresponsiveness. Yes, I can guess what it wants me to do but this is an example of an unhelpful message.
Jul ’23
Reply to Project Won't Build with .h File
Problem solved: When XCode crashed I wound up with a single '*' way down in one of my header files. When I looked at it I wouldn't see it. This is weird because I wasn't doing anything with that file. I probably did it myself but I don't know how. Then the preprocessor would add the header file to the source code file and when it built it would report an error but not in a way that told me what was wrong. Another strange thing is that it reported this error in all of my .c and .m files so when I followed johnSOS' very excellent advice to preprocesses some files and look at the output, I didn't happen to look at ones with the messed up header file. So, XCode was very unhelpful in letting me find the problem. Also strange, DTS can't build my sample project without #import <Cocoa/Cocoa.h> in one of my .h files so the .m file knows about Cocoa. This looks like a bug because the project includes an appname_Prefix.pch file with: #ifdef OBJC #import <Cocoa/Cocoa.h> #endif This is supposed to be a prefix file for all source files in the target so they know about Cocoa. This is weird. Finally one of my source files wouldn't compile for DTS without <Foundation/Foundation.h> in its header. This is also strange because it did for years for me. Maybe I should #import this in the .pch file as well just to be safe. Finally DTS suggests that I use DIF to file errors. I've never had to do this before but I will. Thanks to everyone for helping me with this issue.
Jul ’23
Reply to Project Won't Build with .h File
I keep all of my source code files and header files together in groups in the project folder. I can delete them from the project and then drag them back into the project. They will appear in the project navigator but they won't build. Spurious error: Expected identifier or '(' in the headers and the analyzer thinks that the header file is not a member of any targets in the current scheme that build for analyzing. I tried to add some headers individually and check the target box to force XCode to include them in my project but as you say, you can't and shouldn't do this. I didn't change the inclusion of any .h .c or .m files. These are in the project folder. Adding them using the several options won't fix this. On June 15th I moved an NSTextField in a .xib a few pixels. When I built the project it and all of my projects stopped working on three versions of XCode and two Macs - Intel and Apple Silicon. XCBBuildService - a component of XCode crashed at this time. On the new M1 iMac this is not happening. To verify that it isn't the project files, I created a new project (several times) and started adding files, carefully following the directions in the XCode documentation. Of course the documentation is inaccurate, for example I couldn't add some illustrations to the project without putting it in a workspace. They won't build. I'll study your post and see if I've missed anything.
Jul ’23
Reply to Project Won't Build with .h File
The project has both C and Objective C source code files. XCode won't build either .c or .m files because it doesn't include the .h files in the target so the functions in the .c and .m files are undefined. Also there are a few other weird errors like: NSString - unknown type. This is probably also a no headers error. There is no Swift. On June 15th I changed the location or an NSTextField in a .xib. XCode blew up and never worked again in spite of my extraordinary efforts to fix it, checking everything, reading the documentation, rebuilding everything and even buying a new Apple Silicon Mac (which I needed to do anyway), knowing that there is not really any help for Mac developers. It is VERY unlikely that there is a name collision. This project was created in about 2010 so it would have been obvious by now. Also if you add the same file to an xcodeproj twice it will generate a warning so it is likely that XCode will report this as an error. Here is an example of real source code in a .h file: #include <stdio.h> void cocoaAlertForC(char *errorType, char *message); XCode underscores the void declaration and reports Expected identifier or '(' - obviously a spurious error. It does this with or without the #include. There's just no way to Force XCode to recognize header files in the Build folder with the old Project or in the target in the newly created project. DTS is not interested in helping me. I feel like I have to give up.
Jul ’23
Reply to Project Won't Build with .h File
I decided to create a new project. This was very difficult because XCode wanted me to a lot of things that weren't required before and aren't described as needed in the documentation, for example put the project in a workspace and use a hierarchy with the .xcodeproj in a folder with the source code files in a folder in the same parent folder. I still have the same problem. I can drag a .h file from the source code files to the project navigator. XCode asks if I want to add it to the target. I check yes but when I build the project I get two errors: in the .h file the first character in the first line of code is underscored and there is an error "Expected identifier or'('. The second error is if I analyze or compile the .h file: "'headerfile.h' is not a member of any targets in the current scheme that build for running". When I use the attributes inspector to look at the target membership of the .h file the checkbox for target membership is not selected. Obviously these are spurious errors. I can't build any .c or .m file with the header #included or #imported because XCode won't add it to the target. It has now been three weeks since I filed a Developer Technical Service request so my speculation that "as soon as I have time" means never is probably correct. Since I haven't been able to get any help anywhere I might have to accept the fact that after about 25 years of programming on the Mac I am now an ex-developer.
Jul ’23
Reply to Project Won't Build with .h File
Now there is a little good news. This computer has a number of small projects used to develop relatively small pieces of code for use in larger programs. These will now build and run. I don't know if I can add new .h, .c or .m files to them but at least they build and run. Since there is some problem with files in the files/folders created for my program that I need to update, could I delete everything related to the project in my ~/Library/Developer/XCode/DerivedData/appname-ishkabbiblegobbldegook folder? Or at least the ishkabibble/Build folder? When you create and build a new project, XCode creates these so will it create the folders/files it needs or will I be even more screwed than I am now?
Jul ’23
Reply to Project Won't Build with .h File
I moved everything to a new 24" Apple silicon iMac, hoping that it would help. I installed XCode 14.3.1. During the installation from the App Store it checked my old version of XCode and it said that it was damaged and recommended that I move it to the trash - good idea, since it was FUBAR. After I installed XCode 14.3.1 I tried to build my most important project it still won't build, With the same errors - it can't build any .m or .c file with a #include or #import any .h. Any .h header file in the project won't build with a spurious error: Expected identifier or '(' at the first line of text after the #includes. Then the file in which the .h is #included won't build:undeclared function (in the .h file that won't build). The newer version of XCode reports a different error: missing input '/Users/myname/Library/Developer/XCode/DerivedData/appname-gobldegookishkabibble/Build/intermediates.noindex/appname.build/Debug/appname.build/Objects-normal/arm64/sourcecodefilename.o'and no rule to build it Of course this is not helpful. I filed a DTS request for help on June 16th - 19 days ago but all I have received is a response saying that DTS is swamped (I'll bet) and that when the representative assigned to this case has some time I will get a response. I'm guessing that this will be never. I guess that when XCode decided to commit suicide it also killed all of my projects. On difference is that I don't see an XCBBuildService crash in the Console.
Jul ’23
Reply to Project Won't Build with .h File
Today I upgraded to MAC OS 12.6.7. After I restarted my mac XCode asked me to install additional shared components. I did. This didn't help. According to XCode Help You can go to File > Project Settings... This will show a panel that will have a pop-up menu to select either the old or new Build System. This sounded promising but unfortunately In XCode 14.2 there isn't really any pop-up menu to do this. No help from DTS.
Jun ’23