VSC on MacOS #include header files missing?

ok so when i create the C++ class in UE, it opens in VSC no problem, however, multiple #include libraries and or header files are missing? These appear to be from the created C++ Actor created in UE5. Please advise.

VSC details:
Version: 1.66.2 (Universal)
Commit: dfd34e8260c270da74b5c2d86d61aee4b6d56977
Date: 2022-04-11T07:49:20.994Z
Electron: 17.2.0
Chromium: 98.0.4758.109
Node.js: 16.13.0
V8: 9.8.177.11-electron.0
OS: Darwin x64 21.4.0

Did you change the changed path of your project to somewhere else from the folder where you first created the project?

I did not move anything. In addition, I created a new C++ project from scratch with 1st person game template and got the same result with unrecognized header files.

Delete the Saved, Intermediate, Build and Binaries folder then launch your project, and at the end again rebuild your project as ObstacleAssault2Editor Win64 Development Build.

Have you tried using Tools > Refresh VS Code Project within Unreal?

yes, tried to refresh and also tried to compile from UE. Header files still not found.

  1. this happens even on a brand new C++ project with no changes aside from adding a New C++ Class Actor.
  2. I’m on MacOS so I’m trying to develop for MacOS. Win64 Development Build isn’t even an option.

Thank you though! :wink:

one thing that I notice is that if I change the Source Code preference in UE5 to Xcode, there seem to be no errors with Xcode. I assume the header errors I’m getting have to do with Visual Studio Code which is giving me a notification that the “C/C++ extension does not match my system.” Reinstalling the extension seems to make no difference. Perhaps C++ should be installed via Homebrew and the Terminal instead of VSC? If that sounds logical and someone knows (maybe Sam can pipe in), it would be very helpful. Unfortunately I’m in unfamiliar territory.

Thanks everyone!

VSC info:
Version: 1.66.2 (Universal)
Commit: dfd34e8260c270da74b5c2d86d61aee4b6d56977
Date: 2022-04-11T07:49:20.994Z
Electron: 17.2.0
Chromium: 98.0.4758.109
Node.js: 16.13.0
V8: 9.8.177.11-electron.0
OS: Darwin arm64 21.4.0

from the VSC Output log (note: “MyActorXcode” is just the name of a C++ Actor I created in UE5 to test Xcode as the Source Code Editor and doesn’t reflect any changes made to files in Xcode to my knowledge):

[5/3/2022, 9:45:38 PM] For C source files, IntelliSenseMode was changed from “macos-clang-x64” to “macos-clang-arm64” based on compiler args and querying compilerPath: “/usr/bin/clang”

[5/3/2022, 9:45:38 PM] IntelliSenseMode was changed because it didn’t match the detected compiler. Consider setting “compilerPath” instead. Set “compilerPath” to “” to disable detection of system includes and defines.

[5/3/2022, 9:45:38 PM] For C++ source files, IntelliSenseMode was changed from “macos-clang-x64” to “macos-clang-arm64” based on compiler args and querying compilerPath: “/usr/bin/clang”

[5/3/2022, 9:45:38 PM] IntelliSenseMode was changed because it didn’t match the detected compiler. Consider setting “compilerPath” instead. Set “compilerPath” to “” to disable detection of system includes and defines.

[5/3/2022, 9:45:39 PM] For C++ source files, IntelliSenseMode was changed from “macos-clang-x64” to “macos-clang-arm64” based on compiler args and querying compilerPath: “/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++”

[5/3/2022, 9:45:42 PM] For C source files, IntelliSenseMode was changed from “macos-clang-x64” to “macos-clang-arm64” based on compiler args and querying compilerPath: “/usr/bin/clang”

[5/3/2022, 9:45:42 PM] IntelliSenseMode was changed because it didn’t match the detected compiler. Consider setting “compilerPath” instead. Set “compilerPath” to “” to disable detection of system includes and defines.

[5/3/2022, 9:45:42 PM] For C++ source files, IntelliSenseMode was changed from “macos-clang-x64” to “macos-clang-arm64” based on compiler args and querying compilerPath: “/usr/bin/clang”

[5/3/2022, 9:45:42 PM] IntelliSenseMode was changed because it didn’t match the detected compiler. Consider setting “compilerPath” instead. Set “compilerPath” to “” to disable detection of system includes and defines.

[5/3/2022, 9:45:42 PM] For C++ source files, IntelliSenseMode was changed from “macos-clang-x64” to “macos-clang-arm64” based on compiler args and querying compilerPath: “/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++”

[5/3/2022, 9:45:45 PM] “MyActorXcode.cpp” not found in “${workspaceFolder}/.vscode/compileCommands_Default.json”. ‘includePath’ from c_cpp_properties.json in folder ‘ObstacleAssualt2’ will be used for this file instead.

[5/3/2022, 9:45:49 PM] “MyActorXcode.cpp” not found in “${workspaceFolder}/.vscode/compileCommands_Default.json”. ‘includePath’ from c_cpp_properties.json in folder ‘ObstacleAssualt2’ will be used for this file instead.

Well you can also use Xcode if you prefer. The main reason the course uses VS Code is to give a consistent experience across all platforms. In the past Visual Studio on Windows and Xcode on macOS with the recordings done in the former; some students were displeased when a feature/functionality was not available/different in Xcode.

Gotcha - fair point and makes perfect sense. So are we thinking this is a VSC/UE5 bug on Mac? Btw, on my Windows machine, everything works perfectly according to the course. I’m mainly using the Mac side because I work in music and everyone in music is Mac, like almost as a religion.

It would be more convenient to have this system working perfectly on the Mac side but I’m OS bilingual so I can manage. I guess I’ll give Xcode a whirl after I finish this course. Thanks DanM!

do you mean to delete these folders from the finder or from VSC? not sure if it makes a difference. Thanks! :wink:

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms