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
Very Hot Topic (More than 25 Replies) Problems with libraries not working (Read 7701 times)
JeffB
Junior Member
**
Offline


Posts: 17
Joined: Mar 9th, 2020
Problems with libraries not working
Mar 9th, 2020 at 2:24am
Print Post  
Having problems with VMicro seeing libraries that are installed.  

Includes are:  
#include <Adafruit_GFX.h>
#include <SPI.h>
#include <Adafruit_ST77xx.h>
#include <Adafruit_ST7789.h>
#include "R2B2.h"
#include <JoystickLib.h>

Arduino IDE successfully compiles, no problems
VMicro says files aren't found, but when I go to the locations in the log file, they are clearly there.

I've looked at tons of library / include locations in VMicro settings but have been unsuccessful in finding something to make them work.  Admittedly, I'm relatively new to the Arduino environment

Verbose compiler logs attached.

Any hints or directions to get it working would be appreciated.
« Last Edit: Mar 14th, 2020 at 5:57pm by Tim@Visual Micro »  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problems with libraries not working
Reply #1 - Mar 9th, 2020 at 5:16am
Print Post  
Thanks for the files. Normally it's a good idea to switch off debug when looking at compile issues but maybe won't help in this case.   

It is finding the libraries but we have a strange issue trying to run the compile that attempts to create a file (.o)

For example this is the line that compiles the spi library. If you pasted this into cmd.exe it should run okay?  This might be a virus checker or permissions issue because the path to arm-none-eabi-g++ looks good it is trying to use the spi.h from braries\SPI\SPI.cpp. So the cmd.exe test will be interesting.

Code
Select All
cc\7-2017q4/bin/arm-none-eabi-g++" -c -w -g -Os -nostdlib variants\ARDUINO_NANO33BLE/defines.txt" variants\ARDUINO_NANO33BLE/cxxflags.txt" -DVM_DEBUG_BREAKPAUSE -DVM_DEBUGGER_TYPE=VM_DEBUGGER_TYPE_GENERIC_OBJECT -DVM_DEBUGGER_SOFT_TRANSPORT_WRITER=Serial -DVM_DEBUGGER_SOFT_TRANSPORT=Serial -DVM_DEBUG_BANDWIDTH_THROTTLE_MS=25 -DVM_DEBUG -DVM_DEBUG_ENABLE=1 -DVM_DEBUGGER_TYPE_GENERIC_OBJECT=21 -DVM_DEBUGGER_TYPE_NO_SERIAL=20 -DVM_DEBUGGER_TYPE_MS430_SERIAL_=19 -DVM_DEBUGGER_TYPE_SERIALUSB=18 -DVM_DEBUGGER_TYPE_USBAPI=17 -DVM_DEBUGGER_TYPE_NET_UDP=16 -DVM_DEBUGGER_TYPE_HARDWARESERIAL3=15 -DVM_DEBUGGER_TYPE_HARDWARESERIAL2=14 -DVM_DEBUGGER_TYPE_HARDWARESERIAL1=13 -DVM_DEBUGGER_TYPE_CDCSerialClass=12 -DVM_DEBUGGER_TYPE_COSA=11 -DVM_DEBUGGER_TYPE_Uart=10 -DVM_DEBUGGER_TYPE_NET_CONSOLE=9 -DVM_DEBUGGER_TYPE_TTYUART=8 -DVM_DEBUGGER_TYPE_USBSERIAL=7 -DVM_DEBUGGER_TYPE_USART=6 -DVM_DEBUGGER_TYPE_UART=5 -DVM_DEBUGGER_TYPE_TEENSY=4 -DVM_DEBUGGER_TYPE_USB=3 -DVM_DEBUGGER_TYPE_FASTSERIAL=2 -DVM_DEBUGGER_TYPE_SOFTWARESERIAL=1 -DVM_DEBUGGER_TYPE_HARDWARESERIAL=0 -DARDUINO_ARCH_NRF52840 -MMD -mcpu=cortex-m4 -DARDUINO=108012 -DARDUINO_ARDUINO_NANO33BLE -DARDUINO_ARCH_MBED \cores\arduino" \variants\ARDUINO_NANO33BLE" -I"D:\ArduinoProjects\Sketches\libraries\Adafruit_GFX_Library" \libraries\SPI" -I"D:\ArduinoProjects\Sketches\libraries\Adafruit_ST7735_and_ST7789_Library" -I"D:\ArduinoProjects\Sketches\libraries\JoystickLib" -I"d:\vs2019\community\common7\ide\extensions\p1hbfuhp.cmm\Micro Platforms\default\debuggers\VM_DBG" \cores\arduino/api/deprecated" \1.1.4\cores\arduino" variants\ARDUINO_NANO33BLE/includes.txt" ibraries\SPI\SPI.cpp" -o SPI\SPI.cpp.o" 

  
Back to top
WWW  
IP Logged
 
JeffB
Junior Member
**
Offline


Posts: 17
Joined: Mar 9th, 2020
Re: Problems with libraries not working
Reply #2 - Mar 10th, 2020 at 1:03am
Print Post  
So, unfortunately my trial has expired, and I don't really want to buy a license until I know this will work, so I can't try building as release vs debug.  If you can somehow extend the trial then we can keep debugging.

I tried the SPI.cpp single command line experiment.   

The CMD experiment reports the same error as the output in the VMicro IDE (per the attached VMicroFail.txt)

I went through all the directories / files as inputs in the command line and they all seem to be in their respective locations.  I've attached a verbose version of the g++ compile attempt, but I don't see anything obvious.

Only other weirdness I can think of is that I originally installed the Windows store version of Arduino - which I uninstalled and installed the stand alone version - perhaps there's some paths/leftovers from that install that VMicro is picking up?
  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problems with libraries not working
Reply #3 - Mar 11th, 2020 at 6:19pm
Print Post  
If you email us with link to this post then we will give you temp key.

You are right. The windows store version of arduino is certainly not supported. It prevents us from having permissions to access the files and works a different way. We are looking at ways to make this more obvious for users. The normal version works either from the .exe or the zip on arduino.cc.

The CMD.exe you made proves there are permissions issues.

« Last Edit: Mar 11th, 2020 at 9:27pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
JeffB
Junior Member
**
Offline


Posts: 17
Joined: Mar 9th, 2020
Re: Problems with libraries not working
Reply #4 - Mar 12th, 2020 at 3:15am
Print Post  
Sent email to support to extend the key for debug.

Did some detective work in registry and the environment variables... didn't really find anything that would point to weird problems with leftovers from the old Windows store install of the Arduino IDE.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problems with libraries not working
Reply #5 - Mar 12th, 2020 at 11:29pm
Print Post  
Thanks someone will contact you.
  
Back to top
WWW  
IP Logged
 
JeffB
Junior Member
**
Offline


Posts: 17
Joined: Mar 9th, 2020
Re: Problems with libraries not working (Windows Store Version of Arduino)
Reply #6 - Mar 14th, 2020 at 5:52pm
Print Post  
Update on debug w/ new activation keys:

It does seem to be a release vs debug problem - potentially with Arduino Nano only.  I've created a very simple sketch with essentially only the header files.  SPI and SD are core arduino libraries.  JoystickLib is my own custom lib in the sketeches/library folder.

#include <SPI.h>
#include <SD.h>
#include <JoystickLib.h>

Here are the log files for 2 different compiles:

Nano build:  Simple debug fail:  Includes all the headers, debug build fails.  Appears to be for JoystickLib?
Nano build: Simple debug success:  Removed the JoystickLib header, passes.

More build results in the next post.

FYI - you've changed the tile of the post to "Windows Store" problem, but just to be clear - I'm not using the Windows store version..  I have the standalone version, although the store version was installed and then uninstalled once I realized it had limitations and wasn't the latest IDE version.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
JeffB
Junior Member
**
Offline


Posts: 17
Joined: Mar 9th, 2020
Re: Problems with libraries not working (Windows Store Version of Arduino)
Reply #7 - Mar 14th, 2020 at 5:54pm
Print Post  
Two more build results:

Nano Build:  Simple release pass - includes all headers, and passes build
Uno Build:  simple debug pass for Uno - includes all headers, but build is Uno, not Nano.  Passes.
  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problems with libraries not working
Reply #8 - Mar 14th, 2020 at 6:15pm
Print Post  
Thanks for all the info!

In a new empty sketch with simple setup() and loop(). Please do the following.

1) In release mode click Build>Clean Solution. Then build and save the output as .txt
1) In debug mode click Build>Clean Solution. Then build and save the output as .txt

The clean operation simply clears the temp build cache so that we get a full compile.

Thanks
« Last Edit: Mar 14th, 2020 at 6:15pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
JeffB
Junior Member
**
Offline


Posts: 17
Joined: Mar 9th, 2020
Re: Problems with libraries not working
Reply #9 - Mar 14th, 2020 at 9:03pm
Print Post  
Ok, done.  Here are the builds after the clean for each.
  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problems with libraries not working
Reply #10 - Mar 14th, 2020 at 9:19pm
Print Post  
Thanks, does this file exist on your system?

d:\vs2019\community\common7\ide\extensions\p1hbfuhp.cmm\Micro Platforms\default\debuggers\VM_DBG\VM_mem_check_sam.cpp
  
Back to top
WWW  
IP Logged
 
JeffB
Junior Member
**
Offline


Posts: 17
Joined: Mar 9th, 2020
Re: Problems with libraries not working
Reply #11 - Mar 14th, 2020 at 11:21pm
Print Post  
Yes, it is there.
  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problems with libraries not working
Reply #12 - Mar 15th, 2020 at 2:03pm
Print Post  
I think it's the first time in 10 years that I am struggling to see the difference between what the compiler is able to do and then what it suddenly won't do.

It is failing on the debug libraries but they are just normal libraries. The compiler has not changed but in the next release you will find the debug libraries are compiled before your own libraries. This normally has not bearing on things but it would be a good test to prove things more clearly. Please install the latest Visual Micro from here and then post output for debug compile.

https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

Thanks
  
Back to top
WWW  
IP Logged
 
JeffB
Junior Member
**
Offline


Posts: 17
Joined: Mar 9th, 2020
Re: Problems with libraries not working
Reply #13 - Mar 15th, 2020 at 5:56pm
Print Post  
Ok, installed latest.  Interesting results:

The debug version seems to be failing for SPI now, instead of my user library, so order did seem to make some kind of difference.

Another data point: Build was set to DEBUG in VS2019, but I turned off debug in VMicro drop down.  With this setting, the build PASSES - attached.  Previously for passes I was only updating VS2019 to RELEASE.
  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problems with libraries not working
Reply #14 - Mar 16th, 2020 at 12:37pm
Print Post  
Thanks, there is some software on yourpc interfering with the builds. We can clearly see in the last report that the build now fails on exact same library that compiled okay previously. The command is the same as when it worked so that proves your install is correct.

I am sorry it is this news but other than virus checker or other anti-malware I can't think of anything else that would cause this to fail.

When we run a compile each command is just a seperate windows process, just running an .exe. You can run each command in cmd.exe and they should produce the same result.

I am not sure what else to say.
  
Back to top
WWW  
IP Logged
 
JeffB
Junior Member
**
Offline


Posts: 17
Joined: Mar 9th, 2020
Re: Problems with libraries not working
Reply #15 - Mar 16th, 2020 at 3:45pm
Print Post  
Well, thanks for trying.  I don't have anything special on this system other that Windows defender - I'll try disabling it.  Strange that it only happens with Nano and not Uno.  At least it works in release mode - so I'll buy a license since working in VS is way more preferred than just the standard IDE.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problems with libraries not working
Reply #16 - Mar 16th, 2020 at 3:59pm
Print Post  
Thanks a lot. I am very interested to hear if you find anything.
  
Back to top
WWW  
IP Logged
 
JeffB
Junior Member
**
Offline


Posts: 17
Joined: Mar 9th, 2020
Re: Problems with libraries not working
Reply #17 - Mar 16th, 2020 at 7:32pm
Print Post  
So some updates:

Disabling windows defender didn't work.
But changing debug mode to Hardware (vs Serial) does work.

So there must be something weird going on with Serial debug mode, only for the Nano.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problems with libraries not working
Reply #18 - Mar 16th, 2020 at 7:36pm
Print Post  
Unfortuently not. The error is a windows process error causing the process to fail, not some strange code causing the compile to fail.

By selecting hardware debug you are simply using less libraries because the software debugger adds a reference to the debugger libraries. The debugger libraries are proven to work by many people and also on your machine in your last posted output.

Sadly, the issue seems to happen after x number of libraries are being compiled.

A final test might be to try software debug in a new project that simply has a setup() and loop() then add libraries till it breaks. How many libraries before breakage?
« Last Edit: Mar 16th, 2020 at 7:37pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
JeffB
Junior Member
**
Offline


Posts: 17
Joined: Mar 9th, 2020
Re: Problems with libraries not working
Reply #19 - Mar 16th, 2020 at 8:49pm
Print Post  
So did that experiment.. clean build with nothing empty setup and loop.

#include <JoystickLib.h>
#include <SPI.h>
#include <SD.h>

Using these headers.   Basic answer is that it always works with two, order doesn't seem to matter.  As soon as you go to 3, at least one will fail with "can't find file".

Since the paths for the Nano are so much longer (and more libraries I assume due to MBOS), are we dealing with some kind of path overflow, max path size limitation here?  Is there an env. variable to increase that?  Could explain why Uno works (simpler, less libraries and shorter paths)...
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problems with libraries not working
Reply #20 - Mar 16th, 2020 at 8:58pm
Print Post  
That's very interesting. I think the stm32 or esp32 has many more paths in each command. Can you confirm same issue in the standard arduino ide?
« Last Edit: Mar 16th, 2020 at 8:59pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
JeffB
Junior Member
**
Offline


Posts: 17
Joined: Mar 9th, 2020
Re: Problems with libraries not working
Reply #21 - Mar 16th, 2020 at 9:13pm
Print Post  
What would you like to be confirmed - I would need more details...?  AFAIK, the standard IDE doesn't have a way to enable debug builds, so the sketches never fail (essentially always running release mode?).
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problems with libraries not working
Reply #22 - Mar 16th, 2020 at 9:32pm
Print Post  
Oh sorry I wrongly thought you were testing multiple libs without debug. Please switch to release in visual micro and add a couple more libraries to see if it compiles. We could see an issue after 4 libs (vm adds 1 for debug). Can we see an issue with 4 or 5 libs in release mode in visual micro?
  
Back to top
WWW  
IP Logged
 
JeffB
Junior Member
**
Offline


Posts: 17
Joined: Mar 9th, 2020
Re: Problems with libraries not working
Reply #23 - Mar 17th, 2020 at 1:48am
Print Post  
Well, I can't seem to break it.. added all of these to the release build.. took forever, but still no problems.

#include <SRDistLib.h>
#include <JoystickLib.h>
#include <SPI.h>
#include <SD.h>
#include <Servo.h>
#include <Stepper.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ST7789.h>
#include <ArduinoBLE.h>

So building release looks pretty robust.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problems with libraries not working
Reply #24 - Mar 17th, 2020 at 1:34pm
Print Post  
Sorry this has been so difficult to report and thanks again for the effort. We have replicated and you are right some windows limit is being hit. 

We are looking into reworking how the debug -D compiler defines and other elements of the serial debug are added to the compiler statement. We will also be determining exactly which element was failing (for the ble) and why!

More to follow
« Last Edit: Mar 17th, 2020 at 1:35pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2169
Joined: Feb 13th, 2019
Re: Problems with libraries not working
Reply #25 - Mar 17th, 2020 at 2:48pm
Print Post  
While investigating this it seems to be related to the version of the toolchain installed with the core itself (as soon as the total command grows over 2486 chars it breaks in our tests), and there is a workaround below which should improve things:-

1) Update the Additional JSON URLs on the vMicro > General > Arduino IDE Locations screen to include the below:
Code
Select All
https://raw.githubusercontent.com/stm32duino/BoardManagerFiles/master/STM32/package_stm_index.json 



2) Install the "STM32 Core"  from Visual Micro Explorer > Board Platforms > All Platforms > STM32 Cores (v1.8.0), and Rescan the Toolchains and Libraries (or restart Visual Studio)

3) Right click on your project and Add > Local Board.txt

4) Add the below Entry to the Board.txt created above in the project
Code
Select All
compiler.path={runtime.tools.xpack-arm-none-eabi-gcc.path}\bin\
# resolved: C:\Users\[username]bin/ 



5) Try rebuilding again with Debug Enabled

Let us know if this helps at all, or if the instructions above are unclear.
  
Back to top
 
IP Logged
 
JeffB
Junior Member
**
Offline


Posts: 17
Joined: Mar 9th, 2020
Re: Problems with libraries not working
Reply #26 - Mar 17th, 2020 at 3:42pm
Print Post  
Great to hear you were able to reproduce.  I've applied the w/a above and it does indeed solve the problem, regardless of the number of libraries.

Good luck on identifying a final solution and thanks for the excellent customer support!


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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problems with libraries not working
Reply #27 - Mar 17th, 2020 at 7:03pm
Print Post  
Thanks, it is an issue that the version of the toolchain is 3 years old, our suggestion explains how to use a more recent version. We will notify Arduino, I suspect they don't realize the toolchain version they selected is so limited. They can easily use a later version.
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problems with libraries not working
Reply #28 - Mar 19th, 2020 at 8:39pm
Print Post  
It seems the arduino ide work around the restriction by converting many of the paths to relative paths. We will do same, we already do this for the linker because it has a list of every project and lib .o file.
  
Back to top
WWW  
IP Logged
 
JeffB
Junior Member
**
Offline


Posts: 17
Joined: Mar 9th, 2020
Re: Problems with libraries not working
Reply #29 - Mar 19th, 2020 at 8:51pm
Print Post  
Ah, makes sense.  Kudos to you all for being so diligent to fix issues  Wink  Any idea for when you'll release the update?
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2169
Joined: Feb 13th, 2019
Re: Problems with libraries not working
Reply #30 - Jul 2nd, 2020 at 8:00pm
Print Post  
The latest release 20.06.30.1 contains the update for the 8dot3 filenames to alleviate the path length issues.

This is the latest release at the top of the below board:
https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

If you have trouble installing this release please see this Video Guide for this process.

  
Back to top
 
IP Logged
 
JeffB
Junior Member
**
Offline


Posts: 17
Joined: Mar 9th, 2020
Re: Problems with libraries not working
Reply #31 - Jul 3rd, 2020 at 4:48am
Print Post  
Latest release doesn't seem to fix the issue.  Seems worse.  Did clean builds with and without debug enabled.  Release passes, debug still fails.  Logs attached.
  

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problems with libraries not working
Reply #32 - Jul 3rd, 2020 at 10:40am
Print Post  
The output suggests you have not applied the latest update. The 20.06.30.1 update is  pinned to the top of the new releases with subjest that starts LATEST - 

Please use that one.

Thanks
  
Back to top
WWW  
IP Logged
 
JeffB
Junior Member
**
Offline


Posts: 17
Joined: Mar 9th, 2020
Re: Problems with libraries not working
Reply #33 - Jul 3rd, 2020 at 6:27pm
Print Post  
My bad - I only updated using the VS interface.  Just updated to 20.06.30.2 version directly and have confirmed it can now build the debug versions just fine.  Good work!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problems with libraries not working
Reply #34 - Jul 3rd, 2020 at 6:46pm
Print Post  
Great, thanks again for the report.
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: [1] 
Send TopicPrint