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
Hot Topic (More than 8 Replies) How can I import Libraries?! (Read 26144 times)
rgp
Newbies
*
Offline


Posts: 5
Joined: Oct 24th, 2011
How can I import Libraries?!
Oct 24th, 2011 at 5:22pm
Print Post  
I was using the previos version (Visual.Micro.Arduino.1.8) and I could import libraries putting in the folder "Libreries" but now, I can't do it.

I am using the Visual Studio 2008.

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How can I import Libraries?!
Reply #1 - Oct 24th, 2011 at 6:54pm
Print Post  
Hi,

The 2nd item down on the "Project" menu should be "Add Arduino Library". It should have two sub menus "Core" and "User". 

"Core" relates to libs in the "arduino\libraries" folder and "User" are the libs in the "<sketch book>\libraries" folder

Does this answer your question and do you have the menu items?

Thanks
  
Back to top
WWW  
IP Logged
 
rgp
Newbies
*
Offline


Posts: 5
Joined: Oct 24th, 2011
Re: How can I import Libraries?!
Reply #2 - Oct 24th, 2011 at 8:01pm
Print Post  
Thank you for your reply, but this option doesn't work correctly.
In the sub menu "User" I don't have any option even if I create the folder and put the library inside.
Then, If I select "Show all Arduino files" I can see the folder "_libreries", and I can add the "Core" libraries but this doesn't work also.

I have an image of my Visual Studio and my test program here:
http://dl.dropbox.com/u/42059104/24-10-2011%2021-53-57.png

And here I have my test project with the libraries:
http://dl.dropbox.com/u/42059104/Test.rar

All this code was running with the version 1.8.

Thank you again  Wink
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How can I import Libraries?!
Reply #3 - Oct 24th, 2011 at 9:06pm
Print Post  
oh okay. few things...

1) It is best to switch off the "include all arduino files" until we sort out this problem. it is confusing for reasons that will become obvious later.

2) when you add an arduino library in visual studio a #include for each .h in the include folder should be added to the top of your Test.pde source code. 

I will have to test adding libraries in 2008 as soon as I get a moment. 

For now you can add try adding the library again or if that doesn't work then you can easily add the #include of each .h yourself

For example add these to the top of the Test.pde and click save

#include Bateria.h
#include BTS555.h

That's done you will now be able to compile and use the include all arduino files option. 

Remember that the include all files option does not affect compile

Actually, the only thing that an arduino really needs to do when you add a library is add the #include code to the top of your source file Smiley It's the only important thing!

Once thing to note is that when you "add library" the addin should add the #include syntax BUT the addin will not save the .pde (your code). You must click save yourself.


  
Back to top
WWW  
IP Logged
 
rgp
Newbies
*
Offline


Posts: 5
Joined: Oct 24th, 2011
Re: How can I import Libraries?!
Reply #4 - Oct 24th, 2011 at 10:24pm
Print Post  
Perfect, writing the "#includes" in the sketch, I could solve the problem.
I thought that this is not necessary, like the last version.
Now, it runs correctly.

Congratulations for this great job, I hope you continue improving this great addin!!  Grin
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How can I import Libraries?!
Reply #5 - Oct 24th, 2011 at 10:39pm
Print Post  
thanks for letting me know you are happy.

i would still like to understand if there is a bug in 2008...

when you add a library are the .h files added for you or must you add them manually?

thanks again
  
Back to top
WWW  
IP Logged
 
rgp
Newbies
*
Offline


Posts: 5
Joined: Oct 24th, 2011
Re: How can I import Libraries?!
Reply #6 - Oct 25th, 2011 at 9:23pm
Print Post  
I don't need add manually, I had the problem because I didn't write the "includes" in the pde file.

I think that it work correctly!

If I find some possible error, I will write here.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How can I import Libraries?!
Reply #7 - Oct 25th, 2011 at 9:34pm
Print Post  
Okay then I assume the #includes were added automatically but you removed them because of your experience with the older version of the addin Smiley

Other users reading this, when you click the "Add Arduino Library" option then one (or more) #includes will automatically be added to the top of the main .pde source code. This is how arduino works when you add a library and the addin does the same. 

If this is not happening for you then please report the problem.
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How can I import Libraries?!
Reply #8 - Oct 27th, 2011 at 12:54pm
Print Post  
  
Back to top
WWW  
IP Logged
 
rgp
Newbies
*
Offline


Posts: 5
Joined: Oct 24th, 2011
Re: How can I import Libraries?!
Reply #9 - Oct 29th, 2011 at 1:22am
Print Post  
Sorry for my explanation. 
In my case, when I add the library, this is added at the solution, but I have to write in the .pde the "include", this doesn't work as you say, so I think that it is a litle problem.

But only adding the library and then writing the "include" you will solve the problem.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How can I import Libraries?!
Reply #10 - Oct 29th, 2011 at 1:51am
Print Post  
ok thanks for letting us know. we will do some 2008 testing Smiley

By the way of you want 2010 then read this

http://www.visualmicro.com/page/Offer-Visual-Studio-Professional-Free-For-3-Year...
« Last Edit: Oct 29th, 2011 at 1:54am by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
MarvinMartian
Junior Member
**
Offline


Posts: 11
Joined: Apr 15th, 2010
Re: How can I import Libraries?!
Reply #11 - Feb 9th, 2012 at 9:52am
Print Post  
Tim@Visual Micro wrote on Oct 25th, 2011 at 9:34pm:
Okay then I assume the #includes were added automatically but you removed them because of your experience with the older version of the addin Smiley

Other users reading this, when you click the "Add Arduino Library" option then one (or more) #includes will automatically be added to the top of the main .pde source code. This is how arduino works when you add a library and the addin does the same. 

If this is not happening for you then please report the problem.


Just a note to say I'm not seeing the addition of the #include in 2008 (Running VM "26" from codeplex, although this reports as v25 in the AppVersion column of the Options dialog)

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How can I import Libraries?!
Reply #12 - Feb 9th, 2012 at 10:28am
Print Post  
both core and user libraries are supported so what can't you do exactly? please send screen shot of your visual studio "add arduino library" menu

which vm version have you installed?
  
Back to top
WWW  
IP Logged
 
MarvinMartian
Junior Member
**
Offline


Posts: 11
Joined: Apr 15th, 2010
Re: How can I import Libraries?!
Reply #13 - Feb 9th, 2012 at 4:53pm
Print Post  
I see the "add arduino library" menus ok - it's just when I click on one of the libraries, nothing happens. It does not insert the #include<xxxx.h> line into the .pde

I'm not exactly sure what version I'm running - I downloaded & installed what I thought was 26 from here http://visualmicro.codeplex.com/releases/77923/download/334959 but when I look in the options dialog in VS under VisualMicro/General/AppVersion it says 25....

(I had done uninstall & VS reset before this)
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How can I import Libraries?!
Reply #14 - Feb 9th, 2012 at 5:29pm
Print Post  
Edit: Sorry got confused as to which question I was responding. Please setup a new topic for further questions.

Please upgrade to latest visual micro and join codeplex for update notifications. There was a bug recently fixed that failed to add the #includes.

ps: uninstall should never be required and reset isn't required unless specifically mentioned in the version notes. 
the only thing that changes accross most versions is the dlls.
« Last Edit: Feb 9th, 2012 at 5:39pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How can I import Libraries?!
Reply #15 - Feb 9th, 2012 at 5:37pm
Print Post  
Sorry again. Been getting out of sync with questions. 

The fact that the version hasn't changed says that maybe there was a problem with the 2008 compile for the last build. I'll post a new codeplex update shortly, please try it.

You are using 2008 aren't you?
« Last Edit: Feb 9th, 2012 at 5:38pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How can I import Libraries?!
Reply #16 - Feb 9th, 2012 at 6:25pm
Print Post  
Okay i have installed the v26 build, you are right it shows up as v25 but works okay.

it adds #includes correctly for me. can you zip and email your solution and/or send a screen shot of the solution explorer

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How can I import Libraries?!
Reply #17 - Feb 15th, 2012 at 11:55pm
Print Post  
okay i got your email with the library and VS2008  adds the include and compiles fine. 

so this is a problem being localised to your vs 2008 installation. 

can we be clear about the problem(s) you are having, I have lost the thread Smiley 

1) If you add the include can you compile okay in VS 2008?
2) Do both user lib and core lib menus show all of your libraries?

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


Posts: 11
Joined: Apr 15th, 2010
Re: How can I import Libraries?!
Reply #18 - Feb 16th, 2012 at 5:27pm
Print Post  
Hi

1) yes if I add manually, it will compile ok
2) yes all libraries are shown.

if it's down to my VS, I'd say don't worry about it. I hope to be switching to a whole new PC soon, so I'll try it out with a fresh install. I can live with the manual step til then

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How can I import Libraries?!
Reply #19 - Feb 16th, 2012 at 6:31pm
Print Post  
ok thanks, but i will keep a look out for what might cause the problem

out of interest...
1)
if the main.pde is closed and you add a lib does the main pde open? do you get an astrix * in the document title to show it has been altered?

2)
if the main pde is open and active does it add the reference?

...

the code handles things different if the pde is or is not open

thanks
  
Back to top
WWW  
IP Logged
 
MarvinMartian
Junior Member
**
Offline


Posts: 11
Joined: Apr 15th, 2010
Re: How can I import Libraries?!
Reply #20 - Feb 17th, 2012 at 3:55pm
Print Post  
1) If closed, the pde is opened, but the ref is not added and no *

2) If opened, the ref is not added (and no * )

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How can I import Libraries?!
Reply #21 - Feb 17th, 2012 at 4:27pm
Print Post  
ok thanks
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: [1] 
Send TopicPrint