Sysprogs forums › Forums › VisualGDB › Clang Intellisense: Undeclared identifier
Tagged: Intellisense
- This topic has 9 replies, 2 voices, and was last updated 4 years ago by support.
-
AuthorPosts
-
October 18, 2020 at 11:22 #29303GastParticipant
I have a function
void setADCs()
In the line where it is called
setADCs()
the call is marked as Error: Clang Intellisense “use of undeclared identifier” or,
when looking for the definition: “The selected location does not refer to a C/C++ entity”
This also happens to any other function.
The code however runs and debugs as expected.
Is this just because something is missing in Clang?
October 22, 2020 at 09:11 #29362supportKeymasterHi,
Unfortunately, we were not able to reproduce the problem based on the description you provided.
If VisualGDB behaves differently than you expect, please share the complete steps to reproduce the problem from scratch per our problem reporting guidelines and we will try to investigate this further.
October 25, 2020 at 12:13 #29378GastParticipantAfter restarting this was fixed.
November 7, 2020 at 11:34 #29462GastParticipantProblem came back. Example:
This shows the error ” Clang Intellisense “use of undeclared identifier”” when calling test().
void setup() { pinMode(LED_BUILTIN, OUTPUT); } void loop() {test(); digitalWrite(LED_BUILTIN, HIGH); delay(1000); digitalWrite(LED_BUILTIN, LOW); delay(1000); } void test() { int x = 9; }
When the function test() is moved above loop() the error is not shown.
Do functions need to be put in front of loop()?
November 7, 2020 at 11:55 #29463GastParticipantUpdate:
I found out by chance that after creating the VisualGDB project from an Arduino .ino file the error always shows up.
However, when I open the vcxproj file again it is ok.
This is quite confusing since I was used to start the project usually from the Arduino file instead from the vcxproj file that drives me into Visualmicro which I have also installed. Visualmicro has to be disabled to run the project in VisualGDB by loading the vcxproj file.
November 7, 2020 at 14:58 #29464GastParticipantNo, it works only for the small blink sketch.
For my large project reloading the sln file does not help. On all functions errors ( “The selected location does not refer to a C/C++ entity”).
Many more errors like undeclared identifiers, though the program will run correctly.
November 7, 2020 at 23:46 #29465supportKeymasterThanks for your feedback. We have added it to our internal issue tracker and will investigate it further if the issue is confirmed by other users.
November 8, 2020 at 01:52 #29466GastParticipantSolved:
The nightmare has ended after several days of trials (and hopefully persistent):
I changed Intellisense Settings to “Clang-format (advanced)” and the functions etc. were recognized correctly.
November 8, 2020 at 11:08 #29467GastParticipantSorry, the nightmare had not ended…
After restarting Visualstudio the intellisense errors popped up again. I tried to remember how I fixed it previously, but I had no success anymore.
The solution then was to painfully reorder the function definitions so that each of them was located on top of a corresponding call, i.e. putting the functions behind the definitions in the “correct” sequential calling order.
Now it seems to work even after restarting Visualstudio….
Can anyone tell me why intellisense under certain (unknown to me) circumstances does not recognize function calls when the function is declared behind the call? Arduino does not require that.
November 8, 2020 at 11:39 #29468supportKeymasterPlease note that we prioritize the reported issues based on the amount of affected users. As this issue does not affect other users, we will not be able to provide any further help with it. If you are not able to continue your VisualGDB trial due to it, please consider using other tools as we will not be able to address it at this point.
-
AuthorPosts
- You must be logged in to reply to this topic.