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 Linker error in VisualMicro, build ok in Arduino IDE (Read 2161 times)
AndiS
Newbies
*
Offline


Posts: 3
Location: Germany
Joined: Apr 15th, 2021
Linker error in VisualMicro, build ok in Arduino IDE
Apr 18th, 2021 at 3:15pm
Print Post  
Hi,
I have a problem with my project, that it throws a linker error while building the project. In Arduino IDE all builds well.
Arduino IDE 1.8.9, Arduino pro micro (Atmega32U4).
Attached is the build output and project.
I hope someone can give a hint, where the problem is.

Thanks
  

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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error in VisualMicro, build ok in Arduino IDE
Reply #1 - Apr 18th, 2021 at 3:21pm
Print Post  
Thanks we are going to look into the issue. I notice that two different HID libraries are discovered when only one should be. 

Out of interest, if you remove the following folder then click "vMicro>General>Reload Toolchains" (or restart the ide) does it then build okay?

E:\Arbeit\Arduino\libraries\HID\src



« Last Edit: Apr 18th, 2021 at 3:21pm by Tim@Visual Micro »  
Back to top
IP Logged
 
AndiS
Newbies
*
Offline


Posts: 3
Location: Germany
Joined: Apr 15th, 2021
Re: Linker error in VisualMicro, build ok in Arduino IDE
Reply #2 - Apr 18th, 2021 at 3:49pm
Print Post  
Hello,
no, it got me this error:
Gamepad_Leonardo.ino: 7:25: fatal error: HID-Project.h: No such file or directory
   compilation terminated

An error was encountered during the 'Deep Search' library discovery process.
Build failed for project 'Gamepad_Leonardo'

this should be correct, because the included header file is in this directory.

BUT, you gave me the hint with the 2 different HID libraries. I renamed the HID-library in E:\Arbeit\Arduino\libraries\ to HIDproject and it builds just fine and is functional.
In Arduino IDE it builds also ok with the change.

Thanks for your fast response.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error in VisualMicro, build ok in Arduino IDE
Reply #3 - Apr 18th, 2021 at 5:14pm
Print Post  
Great thanks. We will resolve that in the next release. The HID that you had installed should have overriden the HID library installed by the core. Different names for different libraries are always recommended but that combination should have worked.
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error in VisualMicro, build ok in Arduino IDE
Reply #4 - Apr 19th, 2021 at 4:42pm
Print Post  
We have looked at this and it seems correct that the build fails. We also see a build failure in the Arduino IDE but slightly different error.


Ccan you please rename the library folder back to HID and then in the Arduino IDE please switch on "File>Preferences>Compile Verbose" and build. Then post the output from the Arduino IDE.

The problem is that many of the .h files in the HID library that you are using contain #include "HID.h", but the library does not contain a "HID.h". The auto discovery of libraries that both the Arduino IDE and Visual Micro use, detects the need for a "HID.h" and throw error when it is either "not found" or "only available in a different incorrect location".

We will update visual micro so that it handles the breakage the same way as the Arduino IDE. At least both IDE's will show the same error which might be less confusing. 

If you have the time, I am keen to see the Arduino IDE build output so we can see why/how it is working for you.

Thanks again for the report.
  
Back to top
IP Logged
 
AndiS
Newbies
*
Offline


Posts: 3
Location: Germany
Joined: Apr 15th, 2021
Re: Linker error in VisualMicro, build ok in Arduino IDE
Reply #5 - Apr 21st, 2021 at 7:05am
Print Post  
Hi,
I have compiled the project with the Arduino IDE.
The output is attached. I have no errors.
  

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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error in VisualMicro, build ok in Arduino IDE
Reply #6 - Apr 21st, 2021 at 5:15pm
Print Post  
Interesting thanks. You are using an older Arduino 1.8.9 IDE which I just tried and it worked OK. The more recent Arduino IDE versions (such as 1.8.13) fail.

It seems the older Arduino version, whilst working in this case, it doing something that could cause unexpected results. Taking some source code from "Library Version A" and part source from "Library Version B". 

In this case renaming the folder of the override HID library (as you have done) certainly resolves and in a more reliable manner. This allows both libraries to be used fully.

We will change this behaviour if the Arduino IDE build guidelines officially recognize this way of working but currently we can't find that in the docs.

Will continue to review, thanks for the post.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint