Microchip Studio (Atmel Studio 7) Build error in the ino file but no error display

Rolfdegen

Well-known member
Hallo friends :)

I use Microchip Studio and visual micro and Teensy 4.1. I have a problem with the display of errors in the ino file.

Compiler makes a build error, but no errors are listed. See example: Semicolon is missing.

This is only in the ino file. Errors in the other files are displayed :confused:

Error-Listing.png
 
That's odd.

A workaround could be to move all code from the INO to a .CPP file.

An empty INO works in other build tools.

Then that CPP would need to follow standard CPP rules: Include Arduino.,h manually, and declare prototypes, etc as needed to build.
 
Mmmm.. :confused:

I don't think that's a good idea. This may cause other problems in my large code. But thanks for your tip.

I use the visual micro plugin. There seems to be a problem with that :confused:

My code:
MC-stdudio.png
 
Last edited:
Others use that plugin - but probably not in Atmel studio, and have not seen this issue come up.

YMMV .... Not seeing how one more MySketch.CPP for {empty} MySketch.INO would cause trouble in project of any size?

One thing found here - when syntax errors are present in the Arduino IDE a "Ctrl+T" does a uniform code reformat. Generally when there is a syntax error paging through the code will show broken indenting. Not sure if the Atmel Studio has a handy "Ctrl+T" option that might help - in some cases.
 
In the IDE it looks like this:
IDE_AutoFormat.png

Good luck. Tried the VisualMicro too long ago - am sure it is much improved by now. Found my alternative to IDE in a good editor that can run command line build - capture the output and jump to errors: github.com/Defragster/Tset That and integrated TyCommander for Upload and SerMon.
 
Mmmm.. :confused:

I don't think that's a good idea. This may cause other problems in my large code. But thanks for your tip.

On the contrary!
having all code (or at least all relevant code) in .cpp files avoids that Arduino or other pre-compilers, that only reshuffle and augment .ino code into .cpp code. to interfere with your programming logic and as @defragster noted you program your code in proper way.
 
Back
Top