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) Allow Local Libraries breaks build (Read 22300 times)
Toshik_
Junior Member
**
Offline


Posts: 20
Joined: Dec 16th, 2015
Allow Local Libraries breaks build
Dec 16th, 2015 at 4:25pm
Print Post  
Hi.

VisualMicro version (from options menu) 1.1511.21
VisualMicro version (from extensions list) 1512.14.0
Visual Studio 2015

If I use option Allow Local Libraries (Tools -> Options -> Visual Micro -> Allow Local Libraries) build process breaks with following error:

Code
Select All
core.a(main.cpp.o)*:In function `main
main.cpp:undefined reference to `setup
main.cpp:undefined reference to `loop
collect2.exe*:error: ld returned 1 exit status
Error creating .elf 



Once I switch off that option - sketch builds well
« Last Edit: Dec 16th, 2015 at 4:30pm by Toshik_ »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Allow Local Libraries breaks build
Reply #1 - Dec 16th, 2015 at 4:30pm
Print Post  
Hi,

Thanks for the message. That is an old option that needs to be removed.

Local sketch libraries are supported by default. You do not need to switch anything on.

To see the correct location to place libraries right click the project name in the solution explorer and click "Add>New Arduino Library". This will create a v2 format library in \src\_micro-api\libraries\libName

Old style (v1) and new style (v2) format libraries are supported.

Hope that helps
  
Back to top
IP Logged
 
Toshik_
Junior Member
**
Offline


Posts: 20
Joined: Dec 16th, 2015
Re: Allow Local Libraries breaks build
Reply #2 - Dec 16th, 2015 at 4:36pm
Print Post  
Tim@Visual Micro wrote on Dec 16th, 2015 at 4:30pm:
Hi,

Thanks for the message. That is an old option that needs to be removed.

Local sketch libraries are supported by default. You do not need to switch anything on.

To see the correct location to place libraries right click the project name in the solution explorer and click "Add>New Arduino Library". This will create a v2 format library in \src\_micro-api\libraries\libName

Old style (v1) and new style (v2) format libraries are supported.

Hope that helps


Thanks for answer.

I have tried that way before messing with "libraries option".

I use "Add New Arduino Library", it creates 2 files (.cpp +.h) in /src/_micro-api/libraries/NAME/src folder. Also it adds #include of newly created .h to my sketch

But it fails to compile with:
Code
Select All
TEST.ino:17:17: fatal error: RGB.h: No such file or directory
:#include "RGB.h"
:compilation terminated
Error compiling sketch sources
 

« Last Edit: Dec 16th, 2015 at 4:37pm by Toshik_ »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Allow Local Libraries breaks build
Reply #3 - Dec 16th, 2015 at 5:36pm
Print Post  
Thanks for clarity.

1)
Can you please post a screen shot of your solution with the RGB library that you have created. Please ensure the solution view shows the directory structure so I can see the folder structure with the RGB library sources.

Or email to info[at]visualmicro.com

2)
If you are a novice user that is simply trying to use the standard Arduino RGB library please tell me this so I can give you some alternative advice.

3)
If you have changed any of the Compatibility settings in the options? please tell me that you have done that. It affects the compilation of local libraries.

Thanks
« Last Edit: Dec 16th, 2015 at 6:36pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Toshik_
Junior Member
**
Offline


Posts: 20
Joined: Dec 16th, 2015
Re: Allow Local Libraries breaks build
Reply #4 - Dec 17th, 2015 at 8:14am
Print Post  
Tim@Visual Micro wrote on Dec 16th, 2015 at 5:36pm:
Thanks for clarity.

1)
Can you please post a screen shot of your solution with the RGB library that you have created. Please ensure the solution view shows the directory structure so I can see the folder structure with the RGB library sources.

Or email to info[at]visualmicro.com

2)
If you are a novice user that is simply trying to use the standard Arduino RGB library please tell me this so I can give you some alternative advice.

3)
If you have changed any of the Compatibility settings in the options? please tell me that you have done that. It affects the compilation of local libraries.

Thanks


It is not related to any code inside. I have made test with newly created empty sketch and empty local library.

« Last Edit: Dec 17th, 2015 at 8:33am by Toshik_ »  

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


Posts: 20
Joined: Dec 16th, 2015
Re: Allow Local Libraries breaks build
Reply #5 - Dec 17th, 2015 at 8:18am
Print Post  
Options
« Last Edit: Dec 17th, 2015 at 8:36am by Toshik_ »  

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


Posts: 20
Joined: Dec 16th, 2015
Re: Allow Local Libraries breaks build
Reply #6 - Dec 17th, 2015 at 8:34am
Print Post  
Reuploaded screenshots in suitable size Smiley
« Last Edit: Dec 17th, 2015 at 8:35am by Toshik_ »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Allow Local Libraries breaks build
Reply #7 - Dec 17th, 2015 at 8:37am
Print Post  
Thanks. Switch on local libraries in the tools options. It was on by default and should be on.
  
Back to top
IP Logged
 
Toshik_
Junior Member
**
Offline


Posts: 20
Joined: Dec 16th, 2015
Re: Allow Local Libraries breaks build
Reply #8 - Dec 17th, 2015 at 8:40am
Print Post  
Tim@Visual Micro wrote on Dec 17th, 2015 at 8:37am:
Thanks. Switch on local libraries in the tools options. It was on by default and should be on.


Same error
  

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


Posts: 20
Joined: Dec 16th, 2015
Re: Allow Local Libraries breaks build
Reply #9 - Dec 17th, 2015 at 8:43am
Print Post  
If I use following options (screenshot) I am getting error from 1st message:

Code
Select All
core.a(main.cpp.o)*:In function `main
main.cpp:undefined reference to `setup
main.cpp:undefined reference to `loop
collect2.exe*:error: ld returned 1 exit status
Error creating .elf
 

  

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: Allow Local Libraries breaks build
Reply #10 - Dec 17th, 2015 at 8:43am
Print Post  
If I recall the compile files in project was also on by default
  
Back to top
IP Logged
 
Toshik_
Junior Member
**
Offline


Posts: 20
Joined: Dec 16th, 2015
Re: Allow Local Libraries breaks build
Reply #11 - Dec 17th, 2015 at 8:44am
Print Post  
Tim@Visual Micro wrote on Dec 17th, 2015 at 8:43am:
If I recall the compile files in project was also on by default


Message #9 Wink
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Allow Local Libraries breaks build
Reply #12 - Dec 17th, 2015 at 8:50am
Print Post  
Okay so remove the strange paths you have added to the options.
  
Back to top
IP Logged
 
Toshik_
Junior Member
**
Offline


Posts: 20
Joined: Dec 16th, 2015
Re: Allow Local Libraries breaks build
Reply #13 - Dec 17th, 2015 at 8:58am
Print Post  
Tim@Visual Micro wrote on Dec 17th, 2015 at 8:50am:
Okay so remove the strange paths you have added to the options.


Totally the same error
  
Back to top
 
IP Logged
 
Toshik_
Junior Member
**
Offline


Posts: 20
Joined: Dec 16th, 2015
Re: Allow Local Libraries breaks build
Reply #14 - Dec 17th, 2015 at 9:17am
Print Post  
Here is full compile log

« Last Edit: Dec 17th, 2015 at 9:19am by Toshik_ »  

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: Allow Local Libraries breaks build
Reply #15 - Dec 17th, 2015 at 10:16am
Print Post  
Oh, I didn't see that you had also switched off Compatibility>Compile ALL project folder sources

Please switch it back on

Thanks

  
Back to top
IP Logged
 
Toshik_
Junior Member
**
Offline


Posts: 20
Joined: Dec 16th, 2015
Re: Allow Local Libraries breaks build
Reply #16 - Dec 17th, 2015 at 10:20am
Print Post  
Tim@Visual Micro wrote on Dec 17th, 2015 at 10:16am:
Oh, I didn't see that you had also switched off Compatibility>Compile ALL project folder sources

Please switch it back on

Thanks



Sorry, but the same error:

Code
Select All
core.a(main.cpp.o)*:In function `main
main.cpp:undefined reference to `setup
main.cpp:undefined reference to `loop
collect2.exe*:error: ld returned 1 exit status
Error creating .elf
 



Notice: After each options change I make full clean, VS restart and rebuild
« Last Edit: Dec 17th, 2015 at 10:21am by Toshik_ »  

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: Allow Local Libraries breaks build
Reply #17 - Dec 17th, 2015 at 10:25am
Print Post  
The error suggests you don't have a setup() and loop() but it's in your picture

If you zip and email the "TestLocalLibrary" folder and all sub folder it might save us both some time Smiley

Email to info[at]visualmicro.com
  
Back to top
IP Logged
 
Toshik_
Junior Member
**
Offline


Posts: 20
Joined: Dec 16th, 2015
Re: Allow Local Libraries breaks build
Reply #18 - Dec 17th, 2015 at 10:34am
Print Post  
Tim@Visual Micro wrote on Dec 17th, 2015 at 10:25am:
The error suggests you don't have a setup() and loop() but it's in your picture

If you zip and email the "TestLocalLibrary" folder and all sub folder it might save us both some time Smiley

Email to info[at]visualmicro.com


Thanks, I have sent project.

But there is no any special - just newly created sketch + newly created local library.
I did not write any line of custom code there
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Allow Local Libraries breaks build
Reply #19 - Dec 17th, 2015 at 10:44am
Print Post  
Thanks for the zip. Sorry no idea what the problem is. As you say it's a very simple project and there are plenty of people compiling that without issue.

Maybe try restarting Visual studio or the pc.

Failing that delete the visual micro registry key HKEY_CurrentUser\Software\Visual micro.

Then restart vs and re-enter your ide location but do not change any other settings.

Thanks
  
Back to top
IP Logged
 
Toshik_
Junior Member
**
Offline


Posts: 20
Joined: Dec 16th, 2015
Re: Allow Local Libraries breaks build
Reply #20 - Dec 17th, 2015 at 10:48am
Print Post  
Tim@Visual Micro wrote on Dec 17th, 2015 at 10:44am:
Thanks for the zip. Sorry no idea what the problem is. As you say it's a very simple project and there are plenty of people compiling that without issue.

Maybe try restarting Visual studio or the pc.

Failing that delete the visual micro registry key HKEY_CurrentUser\Software\Visual micro.

Then restart vs and re-enter your ide location but do not change any other settings.

Thanks


Here is result of registry cleaning

In error window written (translation) "...Unknown error (Exception from HRESULT..."
« Last Edit: Dec 17th, 2015 at 10:52am by Toshik_ »  

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: Allow Local Libraries breaks build
Reply #21 - Dec 17th, 2015 at 11:05am
Print Post  
Thanks.

The error dialog is related to intellisense however it suggests that you are not using a standard Visual Studio project or that the project has been switched from win32/app/dll to a make project.

I suggest you create a new project as a test using "File>New>Arduino Project". Then build and confirm the empty project compiles okay. Then click "add>arduino library" and check it compiles okay?

If that works I will tell you what the problem was with the current test project.

Thanks







  
Back to top
IP Logged
 
Toshik_
Junior Member
**
Offline


Posts: 20
Joined: Dec 16th, 2015
Re: Allow Local Libraries breaks build
Reply #22 - Dec 17th, 2015 at 11:10am
Print Post  
Tim@Visual Micro wrote on Dec 17th, 2015 at 11:05am:
Thanks.

The error dialog is related to intellisense however it suggests that you are not using a standard Visual Studio project or that the project has been switched from win32/app/dll to a make project.

I suggest you create a new project as a test using "File>New>Arduino Project". Then build and confirm the empty project compiles okay. Then click "add>arduino library" and check it compiles okay?

If that works I will tell you what the problem was with the current test project.

Thanks


* I have created totally new Adruino project.
* I did not created any local libraries

And, as I mentioned in first post, results:

1. If I switch option "Compile Files In Project" to "True" I get:
Code
Select All
Compiling 'TestLocalLibrary' for 'Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)'
core.a(main.cpp.o)*:In function `main
main.cpp:undefined reference to `setup
main.cpp:undefined reference to `loop
collect2.exe*:error: ld returned 1 exit status
Error creating .elf
 



2. If I switch option "Compile Files In Project" to "False" project compiles well:
Code
Select All
Compiling 'TestLocalLibrary' for 'Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)'
Binary sketch size: 642 bytes (used 0% of a 253 952 byte maximum) (0,19 secs)
Minimum Memory Usage: 9 bytes (0% of a 8192 byte maximum)
  

« Last Edit: Dec 17th, 2015 at 11:11am by Toshik_ »  
Back to top
 
IP Logged
 
Toshik_
Junior Member
**
Offline


Posts: 20
Joined: Dec 16th, 2015
Re: Allow Local Libraries breaks build
Reply #23 - Dec 17th, 2015 at 11:24am
Print Post  
Another experiment:

0. Got new, fresh PC
1. Installed VS2015 Enterprise
2. Installed VMicro
3. Downloaded and unzipped Arduino 1.6.6
4. Run once arduino.exe then closed
5. Run VS, specified Arduino IDE path 
6. Created new Arduino project
7. Build it and got same error:

Code
Select All
Compiling debug version of 'TestCompile' for 'Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)'
core.a(main.cpp.o)*:In function `main
main.cpp:undefined reference to `setup
main.cpp:undefined reference to `loop
collect2.exe*:error: ld returned 1 exit status
Error creating .elf 



Notice: nothing was changed in any settings, it was first VS2015 and VMicro installation on that PC
  
Back to top
 
IP Logged
 
Toshik_
Junior Member
**
Offline


Posts: 20
Joined: Dec 16th, 2015
Re: Allow Local Libraries breaks build
Reply #24 - Dec 17th, 2015 at 12:32pm
Print Post  
Finally! I found out what is the problem:
If any part of path to sketch location contains leading point "." build will fail with error:

Code
Select All
core.a(main.cpp.o)*:In function `main
main.cpp:undefined reference to `setup
main.cpp:undefined reference to `loop
collect2.exe*:error: ld returned 1 exit status
Error creating .elf
 



And we use such pathes now like ".Sketches"/".Projects" etc
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Allow Local Libraries breaks build
Reply #25 - Dec 17th, 2015 at 12:37pm
Print Post  
Yes I just found an article on google about this issue also with the arduino ide (but maybe fixed more recently)

But I didn't see a . or other illegal characters in the output you posted. No .Sketches"/".Projects etc.

Which operating system are you using?
Which path contained the "."?

Thanks
« Last Edit: Dec 17th, 2015 at 12:37pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Toshik_
Junior Member
**
Offline


Posts: 20
Joined: Dec 16th, 2015
Re: Allow Local Libraries breaks build
Reply #26 - Dec 17th, 2015 at 12:44pm
Print Post  
I use Windows 10 and Linux based PCs, by fact - point by itself is not illegal character, in linux it "hides" folder, e.g. in ftp

In my output, when I have changed real pathes due to privacy I've made mistake and replaced leading dot too.. 
So it is my fault with logs. Real path contains dot in "Projects" => ".Projects"
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Allow Local Libraries breaks build
Reply #27 - Dec 17th, 2015 at 12:54pm
Print Post  
Okay thanks very much for all the info.

I will try to replicate and change if possible.

Pleased it's working now. 

Hopefully local libraries etc all work without any change of settings?
  
Back to top
IP Logged
 
Toshik_
Junior Member
**
Offline


Posts: 20
Joined: Dec 16th, 2015
Re: Allow Local Libraries breaks build
Reply #28 - Dec 17th, 2015 at 12:56pm
Print Post  
Tim@Visual Micro wrote on Dec 17th, 2015 at 12:54pm:
Okay thanks very much for all the info.

I will try to replicate and change if possible.

Pleased it's working now. 

Hopefully local libraries etc all work without any change of settings?


Just tested local libraries - works perfect Smiley

Thank you for your time!

It would be nice if you could fix "dot issue", ofcourse in case it is VisualMicro related.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Allow Local Libraries breaks build
Reply #29 - Dec 17th, 2015 at 12:58pm
Print Post  
Will try but it might be a gcc issue. Did it cause a problem in the arduino ide?
  
Back to top
IP Logged
 
Toshik_
Junior Member
**
Offline


Posts: 20
Joined: Dec 16th, 2015
Re: Allow Local Libraries breaks build
Reply #30 - Dec 17th, 2015 at 1:30pm
Print Post  
Tim@Visual Micro wrote on Dec 17th, 2015 at 12:58pm:
Will try but it might be a gcc issue. Did it cause a problem in the arduino ide?


1. It compiles well in Arduino IDE
2. It compiles well in VMicro with option "Compile Files In Project" set to "false"
3. It fails to build in VMicro with option "Compile Files In Project" set to "true"

So, I assume it is VMicro related
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Allow Local Libraries breaks build
Reply #31 - Dec 17th, 2015 at 1:38pm
Print Post  
Excellent thanks. 

There is a difference between compiling files in the sketch folder and compiling only the files "included" in the VS project. This is what the compatibility settings control.

I expect a Visual Micro bug when excluding files that are supposed to be hidden source control files (which normally start with a "."). 

Thanks again for the useful diagnostic work!

« Last Edit: Dec 17th, 2015 at 1:39pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Toshik_
Junior Member
**
Offline


Posts: 20
Joined: Dec 16th, 2015
Re: Allow Local Libraries breaks build
Reply #32 - Jan 12th, 2016 at 12:55pm
Print Post  
Hi! Any news on fixing this?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Allow Local Libraries breaks build
Reply #33 - Jan 15th, 2016 at 6:23am
Print Post  
Hi,

Yes fixed in the next release due shortly. 1601.15+

Thanks for the report.
  
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 
Send TopicPrint