xcode-build-server icon indicating copy to clipboard operation
xcode-build-server copied to clipboard

Bridging Header processed as C/C++ instead of ObjectiveC++

Open clemzio opened this issue 2 years ago • 2 comments

Hey there, I just setup Cursor with xcode-build-server for iOS development. Everything seems to be fine but I do get a non-valid error for my BridgingHeader.h (non-error as in, it is reported as such but in reality compiles fine with xcode-build). Most of the project is in Swift/SwiftUI with a single .h file (bridgingHeader) causing the problem (see screenshot below). Anything I could be doing wrong?

Screenshot 2024-11-23 at 21 27 45

clemzio avatar Nov 23 '24 20:11 clemzio

can you provide your buildServer.json and run LSP with the environment variable SOURCEKIT_LOGGING=3 to provide detailed logs to help locate the problem?

also the detailed unrecognized preprocessing directive error logs

SolaWing avatar Nov 25 '24 03:11 SolaWing

Hey there, apologies for posting this a bit too fast. I spent more time on this issue today and realized it was due to two factors:

  • conflicting C++ parsers
  • having to manually specify the file as Objective-C++

With this done properly, it works like a charm. Thank you again for taking the time to reply, I'll go ahead and close it.

clemzio avatar Nov 27 '24 10:11 clemzio