PSOC Creator 4.4 Libclang.dll crash

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
pefa_4425936
Level 2
Level 2
5 replies posted 5 sign-ins First solution authored

Hi. Over the past couple days I’ve been suffering from an issue where my PSOC creator crashes within seconds of typing code.

Upon further investigation, windows event viewer said it was Libclang.dll and the internet said that I could disable semantic parsing to stop the crashing.

that worked except now I might as well be using notepad to code. This is a recent issue. Is there any way to fix this?

0 Likes
1 Solution
pefa_4425936
Level 2
Level 2
5 replies posted 5 sign-ins First solution authored

I FIGURED IT OUT HAHA.

OK. Here's the story. I was getting fancy with my programming. Sorta doing object oriented programming using structs. The issue came with #include-ing two files recursively, which apparently libclang does not know how to handle.

The way I figured it out was by opening up the project in VSCode, which threw an error that a file was #include-ing itself. This made no sense because I had #include guards. It didn't crash like PSoC Programmer, but intellisense (which does the same that libclang does in PSoC Creator) smartly disabled itself for those specific files. With a bit of trial and error, commenting out the includes, intellisense reactivates itself. Then I open up PSoC Creator and its working perfectly again.

For those interested - here's the science behind why it broke.

I have one header file, H1, defining a struct myStruct.

I have another header file, H2, defining functions which take an argument of type myStruct. Obviously I have to include H1 in H2 in order for this to work.

My mistake was including H2 in H1 as well. Even though H1 doesn't use anything in H2. These files are built one at a time, So if H1 is built first, one of the first lines in H1 is to include H2. No problem, the compiler goes and starts building H2, but one of the first lines in H2 is to include H1. And so on and and so on.

I will read this soon, but for those interested in avoiding these problems, apparently this is a good read. http://www.cplusplus.com/forum/articles/10627/

View solution in original post

12 Replies