vscode-cmake-tools icon indicating copy to clipboard operation
vscode-cmake-tools copied to clipboard

cannot open source file "cblas.h"

Open konradglas opened this issue 5 years ago • 9 comments
trafficstars

I get an intellisense include error that is reproducible by a minimal project that I can share. The Accelerate framework is somehow not included properly.

konradglas avatar Nov 11 '20 08:11 konradglas

Probably worth a different issue, but I have also discovered an include issue when precompiled headers are involved. I added this to the minimal project

konradglas avatar Nov 11 '20 10:11 konradglas

Thank you for reporting this and also for creating a simple project that we can work with!

@andreeis just FYI, this is on macOS. I was surprised to not see any code in cpptools.ts that handled Mac frameworks. Perhaps it's just passing flags over to cpptools and expecting it to pick it up, but I don't have a mac to test it out on right now.

bobbrow avatar Nov 11 '20 16:11 bobbrow

fyi: I just realised I forgot to add the precompiled header command in the minimal example's CMakeLists.txt ... added now

konradglas avatar Nov 15 '20 19:11 konradglas

We have this bug about not passing the iframework switch on Mac. https://github.com/microsoft/vscode-cmake-tools/issues/1178. I'll investigate both.

andreeis avatar Nov 25 '20 18:11 andreeis

Can confirm that this is still an issue.

MiroFurtado avatar Nov 23 '21 00:11 MiroFurtado

Is there an update on this? As a workaround I am using clangd for my Windows and MacOS projects. A solution that works out of the box for both platforms would be very nice though...

konradglas avatar Oct 20 '22 06:10 konradglas

@konradglas Thank you very much for your suggestion of clangd. I didn’t know about it and it fixed the error for me 😁

leafac avatar Dec 09 '22 22:12 leafac

I recently hit this issue in another form, but suspect it's a similar underlying cause.

@andreeis I do not think the Framework path issue (#1178) is related here. The recommended fix in that issue is to direct CppTools to use compile_commands.json (@bobbrow finds that there's an issue with the framework path args provided by the CMake configuration provider in #2324). However, in the very nice minimal repro provided by @konradglas, the missing header Intellisense error still exists when the CppTools extension uses compile_commands.json.

Given that, I suspect there's some issue with the CppTools extension's handling of macOS frameworks (though would love if someone could confirm or find if it's a known issue), which would also explain why clangd is a viable workaround for this.

aymarino avatar Dec 22 '22 22:12 aymarino

I'm running into this error as well and from my understanding, it's specific to the cmake extension. Before adding the extension, I was able to get around the issue by setting "C_Cpp.errorSquiggles": "enabled" in the settings.json. With the extension, the intellisense now is unable to resolve certain frameworks, specifically Accelerate on macOS with the same error as the original poster, "cannot open source file "cblas.h"" Maybe because cblas.h is contained in an internal framework VecLib inside Accelerate?

lucianthorr avatar Apr 04 '23 20:04 lucianthorr