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
Normal Topic VS2008 Unable to use / import libraries (Read 8258 times)
Alex15
Newbies
*
Offline


Posts: 4
Joined: Mar 27th, 2014
VS2008 Unable to use / import libraries
Mar 29th, 2014 at 11:16pm
Print Post  
Hello,
I installed and use visual micro ok until yesterday today.ç
I need to use the libraries from adafruit for aruino for tft 2.8" shield, si basically the GFX and the one from the display.

If I use the code:

//run.h
#include "Adafruit_ILI9341.h"
class run 
..


then i get error : "error: Adafruit_ILI9341.h: No such file or directory"

If i click on Project / add / import library / User, then it is blank and there is nothing, just a blank field

If i click on show all sketches files i dont know what to do

I have the adafruit libraries installed in the Arduino app (not visual micro) sketch book, so i can see it in arduino app / menu file / examples, and use it along with code from arduino app, but im unable to use it within visual studio 2008 with visual micro.

How can i resolve that situation ?

It is a no way to use visual micro if i cannot use any user or 3rd party library


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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VS2008 Unable to use / import libraries
Reply #1 - Mar 29th, 2014 at 11:22pm
Print Post  
Hi Alex,

Visual Micro should work with user libraries but it sounds like the sketchbook folder in visual micro has been set different to the arduino ide.

Please do this :-

In Visual Micro...

Drop down the list of apps such as Arduino 1.0.x and click <Configuration Manager>

What is the Sketchbook Folder set to?

nb: If blank is should use the same as the arduino ide.

Thanks
  
Back to top
IP Logged
 
Alex15
Newbies
*
Offline


Posts: 4
Joined: Mar 27th, 2014
Re: VS2008 Unable to use / import libraries
Reply #2 - Mar 29th, 2014 at 11:32pm
Print Post  
Hi Admin,
Yes , i remember i choose another folder for visual micro skeetchbook, cause i want to differentiate projects made with vs & vm than those on arduino.

Im using arduino 1.5

config manager shows, for:

IDE LOCATION: C:\Program Files (x86)\Arduino
OPTIONALLY ENTER A SKETCHBOOK LOCATION: C:\PRODUCCION\cinemartin\D1\arduino

This is (above last) the folder from where im developing in vs

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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VS2008 Unable to use / import libraries
Reply #3 - Mar 29th, 2014 at 11:38pm
Print Post  
The "User" libraries are expected to be in a folder called libraries below the sketch book folder. 

Example: [SketchBookFolder]\Libraries

If the sketch book folder is different to that of the arduino ide then the user libraries need to be copied over. Then re-start the ide or click "tools>visual micro>reload tool chains"
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VS2008 Unable to use / import libraries
Reply #4 - Mar 29th, 2014 at 11:44pm
Print Post  
ps: Visual Micro projects and arduino projects are the same, so maybe best to use the same sketch book folder. 

+ You can save your projects anywhere they do not have to be in the sketchbook folder or can be in sub folder of the sketchbook folder such as "sketchbook folder\my vs projects\project1"

+ After Visual Micro has opened a sketch for the first time you can use the standard Visual Studio "File>Open>Project" commands to open your VS/Arduino projects. They will then appear on the recent list on the VS file menus. 

Working this way means the sketchbook folder only useful for the location of user libraries  Smiley
  
Back to top
IP Logged
 
Alex15
Newbies
*
Offline


Posts: 4
Joined: Mar 27th, 2014
Re: VS2008 Unable to use / import libraries
Reply #5 - Mar 29th, 2014 at 11:51pm
Print Post  
Well, now i copied the libraries folder with al the libraries from the users/arduino/libraries folder (default arduino sketchbook folder) to the aforementioned OPTIONALLY ENTER A SKETCHBOOK LOCATION of visual micro.

Now the libraries are show on  Project / add / import library / User

So i select to import one from adafruit, then visual miccro adds  "#include <Adafruit_ILI9341.h>"

Now i got a lot of errors, well the file was found (i mean, no not found error) but i get:


Adafruit_ILI9341.h:100: error: expected class-name before '{' token
Adafruit_ILI9341.cpp:In file included from
Adafruit_ILI9341.h:100: error: expected class-name before '{' token
Adafruit_ILI9341.cpp:In constructor 'Adafruit_ILI9341::Adafruit_ILI9341(int8_t, int8_t, int8_t, int8_t, int8_t, int8_t)'
Adafruit_ILI9341.cpp:25: error: class 'Adafruit_ILI9341' does not have any field named 'Adafruit_GFX'
Adafruit_ILI9341.cpp:In constructor 'Adafruit_ILI9341::Adafruit_ILI9341(int8_t, int8_t, int8_t)'
Adafruit_ILI9341.cpp:38: error: class 'Adafruit_ILI9341' does not have any field named 'Adafruit_GFX'
Adafruit_ILI9341.cpp:In member function 'void Adafruit_ILI9341::begin()'
Adafruit_ILI9341.cpp:161: error: 'SPI' was not declared in this scope
Adafruit_ILI9341.cpp:162: error: 'SPI_CLOCK_DIV2' was not declared in this scope
Adafruit_ILI9341.cpp:164: error: 'SPI_MODE0' was not declared in this scope
Adafruit_ILI9341.cpp:In member function 'void Adafruit_ILI9341::drawPixel(int16_t, int16_t, uint16_t)'
Adafruit_ILI9341.cpp:352: error: '_width' was not declared in this scope
Adafruit_ILI9341.cpp:352: error: '_height' was not declared in this scope
Adafruit_ILI9341.cpp:In member function 'void Adafruit_ILI9341::drawFastVLine(int16_t, int16_t, int16_t, uint16_t)'
Adafruit_ILI9341.cpp:373: error: '_width' was not declared in this scope
Adafruit_ILI9341.cpp:373: error: '_height' was not declared in this scope
Adafruit_ILI9341.cpp:375: error: '_height' was not declared in this scope
Adafruit_ILI9341.cpp:In member function 'void Adafruit_ILI9341::drawFastHLine(int16_t, int16_t, int16_t, uint16_t)'
Adafruit_ILI9341.cpp:400: error: '_width' was not declared in this scope
Adafruit_ILI9341.cpp:400: error: '_height' was not declared in this scope
Adafruit_ILI9341.cpp:401: error: '_width' was not declared in this scope
Adafruit_ILI9341.cpp:In member function 'void Adafruit_ILI9341::fillScreen(uint16_t)'
Adafruit_ILI9341.cpp:418: error: '_width' was not declared in this scope
Adafruit_ILI9341.cpp:418: error: '_height' was not declared in this scope
Adafruit_ILI9341.cpp:In member function 'void Adafruit_ILI9341::fillRect(int16_t, int16_t, int16_t, int16_t, uint16_t)'
Adafruit_ILI9341.cpp:426: error: '_width' was not declared in this scope
Adafruit_ILI9341.cpp:426: error: '_height' was not declared in this scope
Adafruit_ILI9341.cpp:427: error: '_width' was not declared in this scope
Adafruit_ILI9341.cpp:428: error: '_height' was not declared in this scope
Adafruit_ILI9341.cpp:In member function 'void Adafruit_ILI9341::setRotation(uint8_t)'
Adafruit_ILI9341.cpp:467: error: 'rotation' was not declared in this scope
Adafruit_ILI9341.cpp:471: error: '_width' was not declared in this scope
Adafruit_ILI9341.cpp:472: error: '_height' was not declared in this scope
Error compiling





So it does not work, this is maybe a problem with my file that its a class or what, why that errores ??

My project consist on 

//d1.ino 
#include <Adafruit_ILI9341.h> //added by visual micro
#include "Arduino.h";
#include "Action.h";
#include "Run.h";
/* ITEAD */ int dirPin1 = 3; int stepperPin1 = 2; int dirPin2 = 7; int stepperPin2 = 6;
void setup(){ /* ITEAD */ pinMode(dirPin1, OUTPUT); pinMode(stepperPin1, OUTPUT); pinMode(dirPin2, OUTPUT); pinMode(stepperPin2, OUTPUT);}
void loop(){Run run = Run(dirPin1,stepperPin1,dirPin2,stepperPin2);}

//run.h
#ifndef Run_h
#define Run_h
#include "Arduino.h"
class Run
{
public:
typedef enum eWindow {HOME = 0};
typedef enum eUserAction {NOTHING = 0, GOABOUT = 1, GOPRESETS = 2};
Run(void); Run(int dirPin1, int stepperPin1, int dirPin2 , int stepperPin2);
void step(boolean dir,int steps, int dirPin1, int stepperPin1, int dirPin2, int stepperPin2);
void listenUser();
};
#endif
      
//run.cpp
#include "Arduino.h"
#include "Run.h"
#include "Util.h"
Run::eWindow currentWindow = Run::HOME;
Run::eUserAction userAction = Run::NOTHING;
void Run::listenUser(){
        //I CANNOT USE THIS CODE CAUSE I NEED THE LIBRARY <Adafruit_ILI9341.h> WORKING, AND IT IS NOT
       // i need to use:
       //Adafruit_STMPE610 ts = Adafruit_STMPE610(STMPE_CS); //that object comes from that library
     //if (!ts.bufferEmpty()) {
           //userAction==Run::GOABOUT;

     //}

}

etc ..


WHY ?

SOLUTION ?

« Last Edit: Mar 29th, 2014 at 11:57pm by Alex15 »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VS2008 Unable to use / import libraries
Reply #6 - Mar 30th, 2014 at 12:12am
Print Post  
1)
Is this exact same code that works in the Arduino Ide?

2)
The error says the SPI library needs to be included for the Adafruit library to work.
  
Back to top
IP Logged
 
Alex15
Newbies
*
Offline


Posts: 4
Joined: Mar 27th, 2014
Re: VS2008 Unable to use / import libraries
Reply #7 - Mar 30th, 2014 at 12:56pm
Print Post  
Thanks, Solved adding the other libraries

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint