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 Name conflict - How to change PATH? (Read 4698 times)
Bob4K
Newbies
*
Offline


Posts: 8
Joined: Dec 30th, 2015
Name conflict - How to change PATH?
Jan 1st, 2016 at 10:28pm
Print Post  
Hi,

I'm using Visual Studio 2015, and I want to use the IR remote library described here:

http://www.righto.com/2009/08/multi-protocol-infrared-remote-library.html

The test program looks like:

Code
Select All
#include <IRremote.h>

int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value
  }
}
 



Unfortunately, there is a name conflict.

The loaded file IRremote.h is not the one from this library that I installed on "D:\m1\soft\A\Arduino\Arduino-IRremote-master", but the one from "C:\Program Files (x86)\Arduino\libraries\RobotIRremote\src", which is similar but older, and buggy:

Code
Select All
Compiling 'IRLearn' for 'Arduino/Genuino Uno'
IRremoteTools.cpp:5:16: error: 'TKD2' was not declared in this scope
Error compiling 



I tried to change the include directory path in the project properties setting it to:

D:\m1\soft\A\Arduino\Arduino-IRremote-master;$(IncludePath)

but that does not help (see attached picture).

I'm missing probably something very obvious, any idea?

I also tried to set the include file with its full path, but that does not compile:

Code
Select All
#include <D:\m1\soft\A\Arduino\Arduino-IRremote-master\IRremote.h> 



Code
Select All
IRLearn.ino:In function `loop
IRLearn.ino:decode(decode_results*)
IRLearn.ino:resume()
IRLearn.ino:In function `__static_initialization_and_destruction_0
IRLearn.ino:IRrecv(int)
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: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Name conflict - How to change PATH?
Reply #1 - Jan 1st, 2016 at 10:35pm
Print Post  
Hi,

The easiest solution is to rename "Arduino-IRremote-master" to "IRremote" and then click tools>reload toolchains or restart the ide.

note: A .h file name that matches a lib name gets priority. A library in in the user libs folder gets priority over ide libs. The text "-master" at the end of a folder name is ignored 

more info:-  The "arduino-" text at the start of your lib folder name will mean the IRemote.h header can't be matched with the user library but can be matched to a core lib folder.
« Last Edit: Jan 1st, 2016 at 10:37pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Bob4K
Newbies
*
Offline


Posts: 8
Joined: Dec 30th, 2015
Re: Name conflict - How to change PATH?
Reply #2 - Jan 1st, 2016 at 10:56pm
Print Post  
That was a fast reply, thanks!

Unfortunately, it did not seem to help.

I changed the installation directory to:

Code
Select All
D:\m1\soft\A\Arduino\IRremote 



I also updated the properties pages with this new path (is that useful?), but I'm getting the same error, my path is no recognized and the IDE finds the include in the default location.

After that, I saw that there is an "add library" in the Visual Micro menu. 

I added the Arduino-IRremote-master.zip file, and now it compiles fine.

I'm missing the way to update the path, it must be different than what I use and works with regular C++ projects. The workaround above does work, so I'm not stuck anymore, but I'd be curious to know what I did wrong with the PATH settings.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Name conflict - How to change PATH?
Reply #3 - Jan 1st, 2016 at 11:01pm
Print Post  
Okay. Sorry I assumed you were familiar with Arduino and didn't look at your lib path properly. 

With Arduino you can only install libraries into the sketchbook\libraries folder. That's what the install from zip does. The default [sketchbook] is "document\arduino"

For this reason you have no control over the visual studio c++ project properties, the are automatically managed by visual micro

Thanks very much for the update

« Last Edit: Jan 1st, 2016 at 11:01pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Bob4K
Newbies
*
Offline


Posts: 8
Joined: Dec 30th, 2015
Re: Name conflict - How to change PATH?
Reply #4 - Jan 1st, 2016 at 11:07pm
Print Post  
Yes, I'm a beginner with Arduino, it's my first project.

Thanks for the tutorial, I probably will have to come back on this great forum from time to time.

I just bought a license, it's certainly worth it!
« Last Edit: Jan 1st, 2016 at 11:07pm by Bob4K »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Name conflict - How to change PATH?
Reply #5 - Jan 1st, 2016 at 11:11pm
Print Post  
What a star and Happy new year

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