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
Hot Topic (More than 8 Replies) Intellisense and build errors with known valid Arduino project (Read 9558 times)
Greg Terrell
Junior Member
**
Offline


Posts: 23
Joined: Oct 3rd, 2016
Intellisense and build errors with known valid Arduino project
Oct 4th, 2016 at 1:50pm
Print Post  
Background...
First off, I will say that I am new to Visual Micro and just setup our environment, so the issue I am reporting is likely our environment's setup.  I have tried the basics like re-installation of the Arduino IDE and Visual Micro VSIX, with no improvement, so I am looking for advice on how to get a functioning Visual Micro environment.  My organization found the Visual Micro value propositions (Intellisense, basic debugging, and better code navigation) appealing and purchased Visual Micro for commercial use in porting some libraries to AVR; the Arduino IDE is painful after using Visual Studio for years.

I have a benchmark project provided by the Microsoft Azure team that works perfectly when built with Arduino 1.6.12.  The test target device is a Adafruit Feather M0, which we have successfully deployed simple "hello world, blinky" type applications to.

Issue...
Open the INO file and to start off, a handful of known defined symbols are Intellisense detected as "undefined".  Build generates about a dozen errors, all in the VM_DBG.h file, which looks to have been injected into my project to support your debugging feature. 

Thanks in advance for suggestions,
Greg
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense and build errors with known valid Arduino project
Reply #1 - Oct 4th, 2016 at 2:20pm
Print Post  
Hi,

Thanks for the info.

Let's ignore intellisense errors for now they are unconnected to the build.

First of all switch the toolbar from "Debug" to "Release" then build

If you get errors please post as a .txt after switching on vMicro>Compiler>Verbose

If you prefer to email the .txt you can do so to info@visualmicro.com

Thanks
  
Back to top
IP Logged
 
Greg Terrell
Junior Member
**
Offline


Posts: 23
Joined: Oct 3rd, 2016
Re: Intellisense and build errors with known valid Arduino project
Reply #2 - Oct 4th, 2016 at 3:21pm
Print Post  
Changed target configuration to "Release", build failed on 1 missing library (vs. 14 line syntax errors previously).  Moved project folder from my Github folder structure to my Arduino folder.  Release builds without error now.  I uploaded the build results to the development board successfully and it executes the code correctly.

Debug build produces the following errors...

Compiling debug version of 'remote_monitoring' for 'Adafruit Feather M0 (Native USB Port)'
 
remote_monitoring.c:7: In file included from
 
VM_DBG.h: 88:1: error: unknown type name 'class
   class VisualMicroDebug
 
VM_DBG.h: 89:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 
VM_DBG.h: 352:2: error: unknown type name 'VisualMicroDebug
   extern VisualMicroDebug MicroDebug
 
VM_DBG.h: 359:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   template<typename T>
 
VM_DBG.h: 373:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   template<typename T>
 
VM_DBG.h: 379:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   template<typename T>
 
VM_DBG.h: 403:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   template<typename T>
Error compiling project sources




Thank you for the quick response, I look forward to future suggestions.
Greg

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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense and build errors with known valid Arduino project
Reply #3 - Oct 4th, 2016 at 6:41pm
Print Post  
The initial error was probably because visual micro was not managing your project. Thus you will see standard Microsoft build errors for an invalid c++ project and the intellisense would also not be updated.

The error now is likely to be an invalid breakpoint position outside of code.

Please post as a .txt with the full build output after switching on vMicro>Compiler>Verbose

If you prefer to email the .txt you can do so to info@visualmicro.com
  
Back to top
IP Logged
 
Greg Terrell
Junior Member
**
Offline


Posts: 23
Joined: Oct 3rd, 2016
Re: Intellisense and build errors with known valid Arduino project
Reply #4 - Oct 11th, 2016 at 5:43pm
Print Post  
Sorry for the delay... I thought I posted the result of the detailed build back on Oct 5th.  But, apparently I didn't.

I have sent the verbose output from the Debug build to this posting separately (too large to attach).

l.txt

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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense and build errors with known valid Arduino project
Reply #5 - Oct 11th, 2016 at 7:40pm
Print Post  
Thanks for the output. The debug is failing to compile for a .c file.

Can you confirm you don't have a breakpoint in remote_monitoring.c?

Thanks

  
Back to top
IP Logged
 
Greg Terrell
Junior Member
**
Offline


Posts: 23
Joined: Oct 3rd, 2016
Re: Intellisense and build errors with known valid Arduino project
Reply #6 - Oct 11th, 2016 at 8:34pm
Print Post  
I am pretty sure I don't have any breakpoints... I don't find any indicators in the left margin, further Debug has "Delete All Breakpoints" grayed out (aka disabled).   

Just to test that there were no orphan breakpoints I set one, then invoked Debug|Delete All Breakpoints, verified the left-margin breakpoint indicator had been removed, then performed a Debug build.  Got the same errors in VM_DBG.h.

I can zip up the full project directory, nothing proprietary, and send it you if you would like.

Thanks,
Greg 

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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense and build errors with known valid Arduino project
Reply #7 - Oct 11th, 2016 at 9:13pm
Print Post  
Thanks. 

Yes seeing the code would be useful but also a zip of the files in the build folder after attempting a compile.

The build folder path will be visible in the compiler output after  debug build with vMicro>Compiler>show build folder switched on.

Out of interest is the first valid line of code in the project_name.ino an #if condition?

Thanks
  
Back to top
IP Logged
 
Greg Terrell
Junior Member
**
Offline


Posts: 23
Joined: Oct 3rd, 2016
Re: Intellisense and build errors with known valid Arduino project
Reply #8 - Oct 12th, 2016 at 1:42pm
Print Post  
Sent build folder and project source folder zips moments ago.

the .ino starts with some comments then a set of #includes.


// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

// Use Arduino IDE 1.6.8 or later.


#include "Adafruit_FeatherOLED_WiFi.h"
#include <Adafruit_BME280.h>
#include <iot_logging.h>
#include <AzureIoTHubClient.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <time.h>


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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense and build errors with known valid Arduino project
Reply #9 - Oct 12th, 2016 at 7:03pm
Print Post  
I've installed the Iot libraries but please confirm what other software or libraries you have installed.

Thanks
  
Back to top
IP Logged
 
Greg Terrell
Junior Member
**
Offline


Posts: 23
Joined: Oct 3rd, 2016
Re: Intellisense and build errors with known valid Arduino project
Reply #10 - Oct 12th, 2016 at 7:43pm
Print Post  
I think I may have discovered a potential source of the issue while working on extending the code interfacing with AzureIoTHub and accessing basic C++ library functions from within code sections in the remote_monitoring.c file.  The bulk of the work in the solution is being performed in remote_monitoring.c, this is definitely C and not C++ code, further the Azure library supplied by Microsoft is ANSI C.

"The Azure IoT device SDK for C is written in ANSI C (C99) to maximize portability. This makes it well-suited to operate on a number of platforms and devices, especially where minimizing disk and memory footprint is a priority."  from Introducing the Azure IoT device SDK for C on the Microsoft Azure site.

Does Visual Micro support mixed C, C++ projects?

Installed...
Adafruit BME280
RTCZero
AzureIoTHub
Adafruit WINC1500
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense and build errors with known valid Arduino project
Reply #11 - Oct 12th, 2016 at 7:55pm
Print Post  
Visual Micro supports what Arduino supports. Does the project build in the Arduino Ide?
  
Back to top
IP Logged
 
Greg Terrell
Junior Member
**
Offline


Posts: 23
Joined: Oct 3rd, 2016
Re: Intellisense and build errors with known valid Arduino project
Reply #12 - Oct 12th, 2016 at 8:19pm
Print Post  
Yes it builds in Arduino IDE.  I builds in Visual Micro, if Solution Configuration is set to Release (that is how I am working now).

Only if Debug is selected, does the build fail.

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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense and build errors with known valid Arduino project
Reply #13 - Oct 12th, 2016 at 8:39pm
Print Post  
Okay thanks, Visual Micro just uses Arduino commands so the issue shouldn't be related to code issues.

I will install all the libs over the next few days and try it.

Please make sure you are on the latest Visual Micro because it has some better errors messages for the debugger. Not that I think it will change things for you but just to be sure.

The latest is always shown in "tools>extensions and updates>online" or under the updates section if an update is available.
« Last Edit: Oct 12th, 2016 at 8:39pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Greg Terrell
Junior Member
**
Offline


Posts: 23
Joined: Oct 3rd, 2016
Re: Intellisense and build errors with known valid Arduino project
Reply #14 - Oct 12th, 2016 at 9:04pm
Print Post  
Thank you for your assistance Tim.  Not urgent, I have work-arounds.

Updated Visual Micro this morning... 1610.4.2

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint