Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 8 of 8

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

  1. #1
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    210

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

    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


  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    14,490
    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.

  3. #3
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    210
    Mmmm..

    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

    My code:
    Last edited by Rolfdegen; 07-12-2021 at 06:33 PM.

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    14,490
    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.

  5. #5
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    210
    That's a good tip. I will test it. Thanks

  6. #6
    Senior Member Rolfdegen's Avatar
    Join Date
    Sep 2020
    Location
    Germany
    Posts
    210
    Mmmm.. I can't find this function in Microchip Studio

  7. #7
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    14,490
    In the IDE it looks like this:
    Click image for larger version. 

Name:	IDE_AutoFormat.png 
Views:	6 
Size:	33.4 KB 
ID:	25244

    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.

  8. #8
    Senior Member
    Join Date
    Jul 2014
    Posts
    3,281
    Quote Originally Posted by Rolfdegen View Post
    Mmmm..

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •