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 [2]  Send TopicPrint
Very Hot Topic (More than 25 Replies) Allow Local Libraries breaks build (Read 22292 times)
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
*****
Online


Posts: 12190
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
*****
Online


Posts: 12190
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
*****
Online


Posts: 12190
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
*****
Online


Posts: 12190
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
*****
Online


Posts: 12190
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
*****
Online


Posts: 12190
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 [2] 
Send TopicPrint