Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic error: expected unqualified id (Read 3102 times)
WielandB
Newbies
*
Offline


Posts: 4
Joined: Apr 28th, 2018
error: expected unqualified id
Apr 28th, 2018 at 9:35pm
Print Post  
I am getting this error:
'LEDSkulptur_Dodo.ino: 18:1: error: expected unqualified-id before 'if'

I know normally it appears if you miss a semicolon or brace or something like that. But trust me, I did not. The code compiles well in the Arduino IDE but in Visual Studio/Micro it throws this error. 

What can I do to fix that?

Verbose = 1 Output:
[code]Compiling debug version of 'LEDSkulptur_Dodo' for 'WeMos D1 R2 & mini'
Build Folder: _mini/Debug
Additional Defines: VM_DEBUG;VM_DEBUG_ENABLE 1;VM_DEBUG_BANDWIDTH_THROTTLE_MS 33;VM_DEBUGGER_TYPE_HARDWARESERIAL 0;VM_DEBUGGER_TYPE_SOFTWARESERIAL 1;VM_DEBUGGER_TYPE_FASTSERIAL 2;VM_DEBUGGER_TYPE_USB 3;VM_DEBUGGER_TYPE_TEENSY 4;VM_DEBUGGER_TYPE_UART 5;VM_DEBUGGER_TYPE_USART 6;VM_DEBUGGER_TYPE_USBSERIAL 7;VM_DEBUGGER_TYPE_TTYUART 8;VM_DEBUGGER_TYPE_NET_CONSOLE 9;VM_DEBUGGER_TYPE_Uart 10;VM_DEBUGGER_TYPE_COSA 11;VM_DEBUGGER_TYPE_CDCSerialClass 12;VM_DEBUGGER_TYPE_HARDWARESERIAL1 13;VM_DEBUGGER_TYPE_HARDWARESERIAL2 14;VM_DEBUGGER_TYPE_HARDWARESERIAL3 15;VM_DEBUGGER_TYPE_NET_UDP 16;VM_DEBUGGER_TYPE_USBAPI 17;VM_DEBUGGER_TYPE_SERIALUSB 18;VM_DEBUGGER_TYPE VM_DEBUGGER_TYPE_HARDWARESERIAL;VM_DEBUG_BREAKPAUSE;
Architecture Tools: x106-elf-gcc/1.20.0-26-gb404fb9-2/bin/
Api: 180306
Sketch Book: file:///C:/Users/Wieland/Documents/Arduino
Sketch Include Paths
Core Include Paths
Include Path 66/2.4.1/cores/esp8266
Include Path 66/2.4.1/variants/d1_mini
Searching for libraries ...
f-gcc\1.20.0-26-gb404fb9-2\bin\xtensa-lx106-elf-g++" -DVM_DEBUG_BREAKPAUSE -DVM_DEBUGGER_TYPE=VM_DEBUGGER_TYPE_HARDWARESERIAL -DVM_DEBUGGER_TYPE_SERIALUSB=18 -DVM_DEBUGGER_TYPE_USBAPI=17 -DVM_DEBUGGER_TYPE_NET_UDP=16 -DVM_DEBUGGER_TYPE_HARDWARESERIAL3=15 -DVM_DEBUGGER_TYPE_HARDWARESERIAL2=14 -DVM_DEBUGGER_TYPE_HARDWARESERIAL1=13 -DVM_DEBUGGER_TYPE_CDCSerialClass=12 -DVM_DEBUGGER_TYPE_COSA=11 -DVM_DEBUGGER_TYPE_Uart=10 -DVM_DEBUGGER_TYPE_NET_CONSOLE=9 -DVM_DEBUGGER_TYPE_TTYUART=8 -DVM_DEBUGGER_TYPE_USBSERIAL=7 -DVM_DEBUGGER_TYPE_USART=6 -DVM_DEBUGGER_TYPE_UART=5 -DVM_DEBUGGER_TYPE_TEENSY=4 -DVM_DEBUGGER_TYPE_USB=3 -DVM_DEBUGGER_TYPE_FASTSERIAL=2 -DVM_DEBUGGER_TYPE_SOFTWARESERIAL=1 -DVM_DEBUGGER_TYPE_HARDWARESERIAL=0 -DVM_DEBUG_BANDWIDTH_THROTTLE_MS=33 -DVM_DEBUG_ENABLE=1 -DVM_DEBUG   -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ 4.1/tools/sdk/include" 4.1/tools/sdk/lwip2/include" 4.1/tools/sdk/libc/xtensa-lx106-elf/include" \Debug/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -ffunction-sections -fdata-sections -w -x c++ -E -CC -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DARDUINO=10803 -DARDUINO_ESP8266_WEMOS_D1MINI -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_WEMOS_D1MINI" -DESP8266 4.1\cores\esp8266" 4.1\variants\d1_mini" ebug\LEDSkulptur_Dodo.cpp" -o "nul"
f-gcc\1.20.0-26-gb404fb9-2\bin\xtensa-lx106-elf-g++" -DVM_DEBUG_BREAKPAUSE -DVM_DEBUGGER_TYPE=VM_DEBUGGER_TYPE_HARDWARESERIAL -DVM_DEBUGGER_TYPE_SERIALUSB=18 -DVM_DEBUGGER_TYPE_USBAPI=17 -DVM_DEBUGGER_TYPE_NET_UDP=16 -DVM_DEBUGGER_TYPE_HARDWARESERIAL3=15 -DVM_DEBUGGER_TYPE_HARDWARESERIAL2=14 -DVM_DEBUGGER_TYPE_HARDWARESERIAL1=13 -DVM_DEBUGGER_TYPE_CDCSerialClass=12 -DVM_DEBUGGER_TYPE_COSA=11 -DVM_DEBUGGER_TYPE_Uart=10 -DVM_DEBUGGER_TYPE_NET_CONSOLE=9 -DVM_DEBUGGER_TYPE_TTYUART=8 -DVM_DEBUGGER_TYPE_USBSERIAL=7 -DVM_DEBUGGER_TYPE_USART=6 -DVM_DEBUGGER_TYPE_UART=5 -DVM_DEBUGGER_TYPE_TEENSY=4 -DVM_DEBUGGER_TYPE_USB=3 -DVM_DEBUGGER_TYPE_FASTSERIAL=2 -DVM_DEBUGGER_TYPE_SOFTWARESERIAL=1 -DVM_DEBUGGER_TYPE_HARDWARESERIAL=0 -DVM_DEBUG_BANDWIDTH_THROTTLE_MS=33 -DVM_DEBUG_ENABLE=1 -DVM_DEBUG   -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ 4.1/tools/sdk/include" 4.1/tools/sdk/lwip2/include" 4.1/tools/sdk/libc/xtensa-lx106-elf/include" \Debug/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -ffunction-sections -fdata-sections -w -x c++ -E -CC -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DARDUINO=10803 -DARDUINO_ESP8266_WEMOS_D1MINI -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_WEMOS_D1MINI" -DESP8266 4.1\cores\esp8266" 4.1\variants\d1_mini" 4.1\libraries\ESP8266WiFi\src" ebug\LEDSkulptur_Dodo.cpp" -o "nul"
f-gcc\1.20.0-26-gb404fb9-2\bin\xtensa-lx106-elf-g++" -DVM_DEBUG_BREAKPAUSE -DVM_DEBUGGER_TYPE=VM_DEBUGGER_TYPE_HARDWARESERIAL -DVM_DEBUGGER_TYPE_SERIALUSB=18 -DVM_DEBUGGER_TYPE_USBAPI=17 -DVM_DEBUGGER_TYPE_NET_UDP=16 -DVM_DEBUGGER_TYPE_HARDWARESERIAL3=15 -DVM_DEBUGGER_TYPE_HARDWARESERIAL2=14 -DVM_DEBUGGER_TYPE_HARDWARESERIAL1=13 -DVM_DEBUGGER_TYPE_CDCSerialClass=12 -DVM_DEBUGGER_TYPE_COSA=11 -DVM_DEBUGGER_TYPE_Uart=10 -DVM_DEBUGGER_TYPE_NET_CONSOLE=9 -DVM_DEBUGGER_TYPE_TTYUART=8 -DVM_DEBUGGER_TYPE_USBSERIAL=7 -DVM_DEBUGGER_TYPE_USART=6 -DVM_DEBUGGER_TYPE_UART=5 -DVM_DEBUGGER_TYPE_TEENSY=4 -DVM_DEBUGGER_TYPE_USB=3 -DVM_DEBUGGER_TYPE_FASTSERIAL=2 -DVM_DEBUGGER_TYPE_SOFTWARESERIAL=1 -DVM_DEBUGGER_TYPE_HARDWARESERIAL=0 -DVM_DEBUG_BANDWIDTH_THROTTLE_MS=33 -DVM_DEBUG_ENABLE=1 -DVM_DEBUG   -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ 4.1/tools/sdk/include" 4.1/tools/sdk/lwip2/include" 4.1/tools/sdk/libc/xtensa-lx106-elf/include" \Debug/core" -c -w -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -ffunction-sections -fdata-sections -w -x c++ -E -CC -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DARDUINO=10803 -DARDUINO_ESP8266_WEMOS_D1MINI -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="ESP8266_WEMOS_D1MINI" -DESP8266 4.1\cores\esp8266" 4.1\variants\d1_mini" 4.1\libraries\ESP8266WiFi\src" 4.1\libraries\ESP8266WebServer\src" "C:\Users\Wieland\AppData\Local\Temp\VMBuilds\LEDSkulpt
« Last Edit: Apr 28th, 2018 at 9:39pm by WielandB »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: error: expected unqualified id
Reply #1 - Apr 28th, 2018 at 9:37pm
Print Post  
Please switch the toolbar from Debug to Release and try the build again
  
Back to top
IP Logged
 
WielandB
Newbies
*
Offline


Posts: 4
Joined: Apr 28th, 2018
Re: error: expected unqualified id
Reply #2 - Apr 28th, 2018 at 9:43pm
Print Post  
Now it compiles, thank you!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: error: expected unqualified id
Reply #3 - Apr 28th, 2018 at 9:48pm
Print Post  
If you get a chance to email your .ino code to info[at]visualmicro.com that would help thanks
« Last Edit: Apr 28th, 2018 at 9:49pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Evgeny Zhekaus
Junior Member
**
Offline


Posts: 38
Joined: Sep 19th, 2018
Re: error: expected unqualified id
Reply #4 - Oct 3rd, 2018 at 6:11am
Print Post  
I have had an exact same problem after my VS 2017 had crashed. It looks like, my .ino file was some-how damaged. There was no any visual evidence though. However, when I rewrote this .ino with another editor (it was vim), problem disappeared.

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: error: expected unqualified id
Reply #5 - Oct 7th, 2018 at 12:37pm
Print Post  
Thanks for the post. If it happens again pls zip and email the .ino to info[at]visualmicro.com.

I guess this must relate to encoding.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint