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) Additional Include directories: Support of C++ and .pde files under the same project. (Read 16854 times)
Shyam B
Junior Member
**
Offline


Posts: 18
Location: Netherlands
Joined: Aug 3rd, 2012
Additional Include directories: Support of C++ and .pde files under the same project.
Oct 2nd, 2012 at 2:44pm
Print Post  
Hi,

I found a bug while adding additional directories using VS 2010. Steps to reproduce:

1. In a VM enabled project under VS (having both C++ and .pde files), add some addiitional libraries under project properties->C/C++->General.
2. Build the solution. The additional library includes disappear!

Another issue:
Add a file to the project and exclude it from project (right click solution explorer on that file). Build again -> Error!
You may have to rename that file to .pde_ OR delete it/ move it away for the solution to build again!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Additional Include directories: Support of C++ and .pde files under the same project.
Reply #1 - Oct 2nd, 2012 at 3:01pm
Print Post  
Hi Shyam, it's not a bug, you are not creating a C++ project you are creating an Arduino project. 

If Visual Micro allowed you to add your own include directories then Visual Studio (with the plugin) would be the only software in the world that could compile your code. This would be wrong.

Visual Micro ensures that you can only do things that would still allow your project to build correctly in the Arduino IDE. It maintains 100% compatibility with Arduino.

I know this can be frustrating for experienced C++ programmers but the Arduino platform is the choice you have made so I hope this makes sense.

I have had a few requests to allow the rules to be broken. It might be an option in future releases but it has the capability to allow for much confusion among the various levels of user.

You can only do what the arduino allows. To include your own files from another location you have the option to make them libraries and then include them using the "Project>add arduino library". Notice that when you do this vm will ensure the correct VC++ include paths.

I hope this makes sense and that you realize this is not a bug. None of the deviations from normal C++ are bugs, this is just Arduino (for better or for worse)  Undecided
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Additional Include directories: Support of C++ and .pde files under the same project.
Reply #2 - Oct 2nd, 2012 at 3:38pm
Print Post  
By the way I already replied to your 2nd point in the other thread that you created. It's the same answer as below
« Last Edit: Oct 2nd, 2012 at 3:39pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Marius
Developer
****
Offline


Posts: 204
Location: Centurion RSA
Joined: Sep 7th, 2011
Re: Additional Include directories: Support of C++ and .pde files under the same project.
Reply #3 - Oct 2nd, 2012 at 3:46pm
Print Post  
Although I dont like it, I have to agree with you. Keep the Arduino stuff as it is. More than that will cause huge confusion. One gets used to it soon enough.
  
Back to top
IP Logged
 
Jeff B
Newbies
*
Offline


Posts: 7
Location: Rome, GA
Joined: Dec 9th, 2012
Re: Additional Include directories: Support of C++ and .pde files under the same project.
Reply #4 - Mar 13th, 2014 at 2:30pm
Print Post  
Wow, I just ran into this same problem trying to use the RFduino and needing to access the NRF51 stuff using intellisense. I added the include directories, intellisense worked and then I compiled. The include directories were gone. Spent several hours trying to determine what's going on until I found this post. I feel this is a great tool but generalizing that everyone using this is tool will only be working inside the Arduino box is very disappointing. If there's no way out of the box, I will need to drop this tool.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Additional Include directories: Support of C++ and .pde files under the same project.
Reply #5 - Mar 13th, 2014 at 2:44pm
Print Post  
Hi Jeff,

It is up to you if you use the tool or not. It is billed as Arduino compatible and if users are able to switch back to the Arduino ide as a safeguard at any time then they need to be kept on track!

If you would like to make a sensible suggestion feel free but before commenting please make sure you understand the Arduino build process and all the things that are happening in the background to ensure you don't need so much knowledge.

There are plenty of ways to add more libraries to Arduino. Shyam show created this thread wa s anew Arduino user who didn't understand what Arduino is and had not read about how it works and what config options there are. Maybe you are the same?
« Last Edit: Mar 13th, 2014 at 2:49pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Jeff B
Newbies
*
Offline


Posts: 7
Location: Rome, GA
Joined: Dec 9th, 2012
Re: Additional Include directories: Support of C++ and .pde files under the same project.
Reply #6 - Mar 13th, 2014 at 6:33pm
Print Post  
Hi Tim,
Don't get me wrong, you have a great product for the Arduino community. I purchased the plugin because it allows me to setup a plain Arduino project with debug very quickly on Visual Studio and it does it very well. I understand your logic for maintaining backward compatibility with the Arduino IDE. But if an advanced user would like to work outside the box with the understanding that the backward compatibility might be broken, then that option(s) would be a great addition to the plugin, even if it's a paid option.

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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Additional Include directories: Support of C++ and .pde files under the same project.
Reply #7 - Mar 13th, 2014 at 8:38pm
Print Post  
Hi Jeff,

Yes I know thanks for buying the product. If we made any changes like this I am sure all paid debugger users would automatically get the update but thanks for the extra offer.

Right now we have users who are downloading the beta of Atmel 6.2 or Arduino 1.5.6 and are unable to read the notices everywhere to download the Visual Micro beta and other users who get confused and think Arduino 1.0.5 is Arduino 1.5.x. So the focus is on turning the current beta into the recommended download.

If you come up with a reasonable recommendation(s) for how your request should be implemented by Visual Micro it will be considered and if it makes sense implemented. You have to investigate or consider the following:-

1) Visual Micro needs to control the lib paths so that intellisense is correct. maybe you want a switch that states you will control the paths. In which case you would need to make sure they are correct (event the arduino ones) otherwise compile will fail.

2) Or maybe you want a vm project property where you can simply add a few extra paths

3) Visual Micro compiles library cpp sources into .o files using a standard set of compiler definitions read from the arduino config. Would the code in the paths you specify adhere to the same build rules.

4) You should provide some examples of what you are trying to do so it can be replicated and understood.

5) If you think you have an idea that will work then you can try it out by creating your own Arduino core with your own build definitions. You should use arduino 1.5 to do that because the build process entirely defined in a few simple .txt files. If you can use 1.5 then you will be able to hardcode the include paths in the .txt build system for proof of concept.

If you get your RFduino working in 1.5 and would like some tips as to how and what to change then please open a new thread.

Thanks
  
Back to top
IP Logged
 
Gilles Plante
Full Member
***
Offline


Posts: 156
Location: Québec, Canada
Joined: Oct 31st, 2013
Re: Additional Include directories: Support of C++ and .pde files under the same project.
Reply #8 - Mar 13th, 2014 at 8:55pm
Print Post  
My 2 cents.

Should VisualMicro ever have 2 modes, a compatible mode and a super-duper mode, I think that that the settings should be grouped under each mode, even if the same parameter needs to be provided in both mode. This way, you switch from one mode to the other one, and voilà  Cheesy.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Additional Include directories: Support of C++ and .pde files under the same project.
Reply #9 - Mar 13th, 2014 at 9:14pm
Print Post  
Hi Gilles,

If I understand you right it's where I got to and then got stuck. Some settings need to be overridden and some don't? Or certain sets/groups need to be overridden? For the entire compile or on a file per file, then archive, link, epp, hex2elf etc?

So it got complicated and I hoped that at some point we can discuss some suggestions of what UI options would support what?

There is also the question of it makes sense to extend the build process to include libs in the .a format?

Or I considered a tool window which names every potential arduino build property followed by a "Set" button. The set button would set the respective atmel project property(ies) but the window would also serve as a crib sheet for people who want to manually configure and merge with their own existing atmel project settings.

With all of this it is complicated by the arduino 1.5 build config which is important to enable compile or arduino and clone boards without Visual Micro having prior knowledge of each board.

Take a look at the arduino15exe/hardware/arduino/avr/platform.txt and boards.txt. These two files define the entire build process. The .pattern properties in the platform.txt is key.

Ideally we would like Atmel Studio to perform the compile but that is a biggy.

Current focus is to make it easier to use "File>Open object file for debugging" which allows an Arduino with a hacked reset to be debugged using the native Atmel Studio debugger and hardware such as an Atmel ICE3. This work might involve an options to copy/toggle/link all arduino core and libs locally to below the sketch folder. This in itself will be a step towards a "convert arduino to atmel" option for the more advanced user.

So there is lot to consider and that is being considered the only limiting factor is time to experiment and knowledge.

Ideas or working examples will be very welcome   Smiley

The other shut cut is that more people start posting reviews on facebook and twitter etc. so that we get enough sales to hire some help. Hint hint  Cheesy
« Last Edit: Mar 13th, 2014 at 9:18pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Jeff B
Newbies
*
Offline


Posts: 7
Location: Rome, GA
Joined: Dec 9th, 2012
Re: Additional Include directories: Support of C++ and .pde files under the same project.
Reply #10 - Mar 13th, 2014 at 11:58pm
Print Post  
Hi Tim,
What I'm trying to do is get intellisence to work with the ARM defines used by the RFduino. I can use them now without intellisence and it compiles the code just fine. I can add the ARM directories to "Additional Include Directories" and intellisence is happy but the directories gets cleared when I hit build.
The directories needed are described in the platform.txt file as follows:

RFduino.build.variant_system_include="-I{build.system.path}/RFduino" "-I{build.system.path}/RFduino/Include" "-I{build.system.path}/CMSIS/CMSIS/Include"

Is there another way to make intellisence happy?

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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Additional Include directories: Support of C++ and .pde files under the same project.
Reply #11 - Mar 14th, 2014 at 12:49pm
Print Post  
Hi Jeff,

Okay now I understand. You can already extend Visual Micro to include the defines for intellisense purposes. In fact we aleardy do this for arduino 1.5/sam

If I recall, you have added your own rfarduino core but using Arduino 1.0.5. I haven't tested this combination, normally we would expect the arm stuff defined for arduino 1.5 but it should work. If not we can tweak it.

Take a look at C:\Program Files (x86)\Visual Micro\Visual Micro for Arduino\Micro Platforms\arduino15x\hardware\sam\platforms.txt. This shows exactly how to do this for arduino 1.5.x but it should work for a 1.0.x app.

If I recall you simply need to create an RfArduino folder below "C:\Program Files (x86)\Visual Micro\Visual Micro for Arduino\Micro Platforms\arduino10x\hardware\". Then copy the platform.txt from the same folder mentioned above then tweak the paths.

# Intellisense info not used during build
# -------------------
Code
Select All
intellisense.tools.path={runtime.ide.path}/hardware/tools/g++_arm_none_eabi
rm-none-eabi\4.4.1\include\
 



After that "click tools>visual micro>reload toolchains then compile" or re-start the ide.

Because you have a paid license, if it works, I can tell you how to make the same defines in a custom folder away from the visual micro program files folder. But this first test under the visual micro folder will give less confusion.

Look forward to hearing how you get on.

ps: In future releases we hope to automatically extract the -I includes from the build command. This would dedupe so should not cause issues  with duplicate include paths.
« Last Edit: Mar 14th, 2014 at 1:41pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Jeff B
Newbies
*
Offline


Posts: 7
Location: Rome, GA
Joined: Dec 9th, 2012
Re: Additional Include directories: Support of C++ and .pde files under the same project.
Reply #12 - Mar 15th, 2014 at 3:47am
Print Post  
Tim,
The RFduino has it's own installer for 1.5.x which is what I'm using.
I had no idea that "intellisense.include.paths" existed and after including it in platforms.txt for RFduino, intellisence worked great.

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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Additional Include directories: Support of C++ and .pde files under the same project.
Reply #13 - Mar 15th, 2014 at 1:15pm
Print Post  
Hi Jeff,

Great. I suddenly remembered you were using 1.5 that fits really well. The intellisense tweak isn't widely published yet. The whole app management system in Visual Micro was only released  last year and is maturing. 

Save me looking can you please confirm that similar -I includes are defined in the RFduino platform.txr that installs with the custom core? I hope you say the -I includes are there which means future version of Visual Micro can work this out automatically and negate the need for the intellisense.includes.

Thanks again, it's been a spot on test and easier than the original discussion because it relates to intellisense and not the compilation. We can easily extend intellisense without screwing up the build  Smiley

« Last Edit: Mar 15th, 2014 at 1:40pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Jeff B
Newbies
*
Offline


Posts: 7
Location: Rome, GA
Joined: Dec 9th, 2012
Re: Additional Include directories: Support of C++ and .pde files under the same project.
Reply #14 - Mar 16th, 2014 at 2:45am
Print Post  
I'm not sure this is what your looking for but the includes needed for the intellisence are found in the 'board.txt' file under 'variant_system_include'.
Code
Select All
...
RFduino.build.variant=RFduino
RFduino.build.variant_system_include="-I{build.system.path}/RFduino" "-I{build.system.path}/RFduino/Include" "-I{build.system.path}/CMSIS/CMSIS/Include"
RFduino.build.variant_system_lib=libRFduinoSystem.a
...
 



So I added this line to the 'platform.txt' file:
Code
Select All
no/Include;{build.system.path}/CMSIS/CMSIS/Include
 


I also had to add '#define __INLINE inline' to the top of "arduino.h" to fix another intellisence issue required by a couple of NRF51 includes.
Everything seems to be working fine now.

Hope this helps.
Jeff
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Additional Include directories: Support of C++ and .pde files under the same project.
Reply #15 - Mar 16th, 2014 at 2:59am
Print Post  
Makes sense thanks. your board is like the sam stuff.

You can add an intellisense.code.h file to the same location under visual micro that you added the platform.txt. You can put any defines in there that only affect intellisense, you will see a whole load of stuff piled into the one in the visual micro "sam" folder.

I hope this will avoid your having to hack the real sources such as arduino.h. Any pointers in this area will be aprpeciated, it's a weak area for me.

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