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 22218 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: 12187
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: 12187
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: 12187
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: 12187
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: 12187
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: 12187
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: 12187
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: 12187
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
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint