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 Simple example build OK in Arduino IDE but fails in VS/VMicro (Read 175 times)
romeo
Junior Member
**
Offline


Posts: 27
Joined: Aug 3rd, 2024
Simple example build OK in Arduino IDE but fails in VS/VMicro
Jul 24th, 2025 at 6:19am
Print Post  
I downloaded a simple example from https://github.com/vickash/RotaryEncoderPCNT/blob/main/

It (the simple demo) builds fine in Arduino 2.3.6, but fails in VS/VMicro. I have attached the log. The error message is beyond my pay grade; can anyone help with interpretation?
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2758
Joined: Feb 13th, 2019
Re: Simple example build OK in Arduino IDE but fails in VS/VMicro
Reply #1 - Jul 24th, 2025 at 10:08am
Print Post  
The log shows no Prototypes are generated (hence missing reference to setup and loop for the linker), and the library code isn't being built for some reason either.

Can you attach your INO file which you are using in this case?

I can compile the same example fine on the v3.2.1 ESP32 Board package for the same board.
  
Back to top
IP Logged
 
romeo
Junior Member
**
Offline


Posts: 27
Joined: Aug 3rd, 2024
Re: Simple example build OK in Arduino IDE but fails in VS/VMicro
Reply #2 - Jul 24th, 2025 at 11:00am
Print Post  
Here is the .ino. It also failed with the same report when I tried the basic 4 line .ino in the readme on that github page.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2758
Joined: Feb 13th, 2019
Re: Simple example build OK in Arduino IDE but fails in VS/VMicro
Reply #3 - Jul 24th, 2025 at 12:15pm
Print Post  
Thanks, I've sent a PM as well.

Do you have another file in the project called "RotaryEncoderPCNT.cpp" as well as the "RotaryEncoderPCNT.ino"? 

Having this gives the same log as you get, but there should only be the "RotaryEncoderPCNT.ino" and not the "RotaryEncoderPCNT.cpp"

Can you ZIP the whole Solution folder and attach it here, or email it to us?
  
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2758
Joined: Feb 13th, 2019
Re: Simple example build OK in Arduino IDE but fails in VS/VMicro
Reply #4 - Jul 24th, 2025 at 1:25pm
Print Post  
Thanks for working through this with me.

The root cause was the CPP and H from the library were added in the root of the project, which also had the same name for itself and the INO.

This means when it builds there is a conflict between the RotaryEncoderPCNT.ino (which is converted to RotaryEncoderPCNT.cpp in the build process), and the original library "RotaryEncoderPCNT.cpp", which would overwrite it. 

The INO and Project being renamed to RotaryEncoderPCNTDemo.ino resolves this.

As discussed installing the library in Sketchbook\Libraries folder would have also resolved this, and ensures it can be used in other projects and the ArduinoIDE as well:
https://www.visualmicro.com/page/User-Guide.aspx?doc=Add-Libraries.html

There are multiple options if you want to encapsulate the library with the project, with the full Portable Solution route allowing the whole board package and libraries to all be contained with the project to avoid update chaos down the line:
Manual Library Capture with a Project: https://www.visualmicro.com/page/How-to-Encapsulate-Libraries-Within-a-Solution....
Complete Portable Solution: https://www.visualmicro.com/page/New-Arduino-Portable-Solution.aspx
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint