Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Deep Search bug ? (Read 913 times)
Visual Micro
Administrator
*****
Offline



Posts: 7915
United Kingdom
Re: Deep Search bug ?
Reply #17 - Jun 4th, 2017 at 12:06pm
 
I try to do as little as possible in atmel studio it is a dog when it comes to auto adding files.

1)

Anyone who uses normal IDE will complain that the compiler is not using the files they have included in the project/solution explorer. I tried this before and get a lot of complaints.

I think it makes sense for users to included the files in the way that the IDE has been designed and has been documented. However it can be an option to work a different way but not the default.

2)

.ino and sources in the main arduino folder are automatically added in Visual Studio when a project is opened but in atmel studio it can crash easily so I don't bother

3)

When using advanced features of VS such as shared projects it makes sense to understand that files must be included in a project.

4)

There is a new option in Visual Studio 2017 which allows for a "folder only" project, without project/solution. I might expand that option for Visual Micro where it would work the same as the arduino ide. There will be no confusion for users because they do not have a project and solution explorer.

5)

Adding debug breakpoints requires files to be included in a project. The debug/paid users are what is important to me. I have given free for 9 years and seen very few user blogs so free users are no longer of concern to me.

6)

Microsoft have mad a plugin for Visual Studio code which works exactly how you want it to work. Just does what the Arduino Ide does. Vscode is a cut down version of Visual Studio but it is fast and light and highly recommend.


Back to top
 
WWW  
IP Logged
 
testato
Full Member
***
Offline



Posts: 48
Re: Deep Search bug ?
Reply #16 - Jun 4th, 2017 at 9:06am
 
yeha, i readed it  Grin

this means that VisualMicro for atmelstudio work differently from VisualMIcro for VisualSTudio.
This must be investigated.

But pay attention, i think that there is a misunderstanding.
Arduino do not automatically include a Folder inside it's Sketch folder, but only permit to include it.
Please use my .zip for test, the #define that i included must be present in the .ino. If i remove the #define the code inside SomeDir must not be included.

So:
1) the correct way imho is do all that ArduinoIDE do (on AtmelSTudio and VisualSTudio visualmicro version)
2) the .ino created by multiple tab creation, must be automatically included (for now visualmicro have problem on this on AtmelSTudio)
3) a folder, named src or any other name that you want, can be manually included, example
#include "SomeDir\test.h"
This means that if I use this include the deep search on this include must work, so without manually add this folder on atmelstudio explorer i can compile.
4) on ArduinoIDE never a Folder inside Schetch folder is automatically included and compiled without manually # define it, so if this is the case for VisualMicro it is not correct, none for ArduinoIDE, none for standard IDE philosophy. So probably this is another bug to investigate.
Back to top
« Last Edit: Jun 4th, 2017 at 9:14am by testato »  
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 7915
United Kingdom
Re: Deep Search bug ?
Reply #15 - Jun 3rd, 2017 at 6:12pm
 
This makes me laugh. The opposite problem Smiley

http://www.visualmicro.com/forums/YaBB.pl?num=1496509620

Just goes to show, you can't please all of the people all of the time   Smiley Smiley

Actually it means the Visual Studio version of Visual Micro is working how you want it to work for .ino and .cpp in the project folder.
Back to top
« Last Edit: Jun 3rd, 2017 at 6:17pm by Visual Micro »  
WWW  
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 7915
United Kingdom
Re: Deep Search bug ?
Reply #14 - Jun 3rd, 2017 at 4:15pm
 
Yes very true, thanks very much for your patience.

but it means no serial debug
Back to top
« Last Edit: Jun 3rd, 2017 at 4:16pm by Visual Micro »  
WWW  
IP Logged
 
testato
Full Member
***
Offline



Posts: 48
Re: Deep Search bug ?
Reply #13 - Jun 3rd, 2017 at 4:14pm
 
this will be an important step, the power of ArduinoIDE is do not create building problem, so leave arduino builder work, and you can instead use you time for the other most importat thinks that VisualMicro can do
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 7915
United Kingdom
Re: Deep Search bug ?
Reply #12 - Jun 3rd, 2017 at 4:11pm
 
I didn't know that thanks. I will allow deep search to find everything then Smiley

Actually I have been thinking of adding an option where we can use the Arduino builder instead of visual micro for the compile. The builder is quite mature now and will make life easier Smiley It won't change what happens when editing code, just when building.
Back to top
 
WWW  
IP Logged
 
testato
Full Member
***
Offline



Posts: 48
Re: Deep Search bug ?
Reply #11 - Jun 3rd, 2017 at 4:08pm
 
On point 2) I do not agree.
Arduino IDE from many times, at least one year, probably two years, accept that you can use .h and .cpp under all kind of sobdirectory that you prefer.
If you try my examples .zip attached, you will find that Arduino compile it regularly.
It was one of mine request to the team, we can found the github Issue request.

So the special folder "src" is a deprecated folder, present only for retrocompatobility, but it is not necessary on ArduinoIDE.

For the Autoincluding of this kind of folder I understand your vision, but I think that the "standard" arduino target are important target foru you, so VisualMicro, imho, must follow the ArduinoIDE behaviour. If ArduinoTeam decided to Autoinclude all subfolder in the Arduino shetch folder, also VisualMicro must du this without think about other "standard ide filosophy"

my 2cent  Smiley

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



Posts: 7915
United Kingdom
Re: Deep Search bug ?
Reply #10 - Jun 3rd, 2017 at 4:05pm
 
One other bit of info. I just looked at the "compatibility setting" and it seems to be ignored. It defaults to ON meaning all .ino files should be compiled even if not properly included in the project.

I will look at this for the next release but in the meantime you can hold the CTRL + Click any files you want to "Include" then right click and "Include" them easily
Back to top
 
WWW  
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 7915
United Kingdom
Re: Deep Search bug ?
Reply #9 - Jun 3rd, 2017 at 3:59pm
 
Quote:
second .ino it is not visible in the solution Explorer and also it is not working.


Have you right click included the .ino in the project. If atmel studio does not show the .ino file it means you have not included it in the project.

There is a visual micro "tools>option" for arduino compatibility in this area, the option governs if files are compiled automatically or not. However I think you should focus on understanding how atmel studio expects to work because it's better to see all your code correctly in the solution explorer.

When add new .ino files what do you click?
Back to top
 
WWW  
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 7915
United Kingdom
Re: Deep Search bug ?
Reply #8 - Jun 3rd, 2017 at 3:55pm
 
Hi

Actually it's a bit more complicated than that. Here is some information

1) I will extend Visual Micro so that the project folder is added as a -I compiler include. This must be a recent addition for the Arduino IDE which never used to allow this. Visual Micro used to allow it but users complained it made Visual Micro different to the Arduino IDE for something that is not easy for users to clearly see. Uggh Smiley This would allow the header files to be discovered without needing to have them included in the project.

2) The Arduino IDE does not really support code in folders other than the project folder and the \src folder + \src sub folders. You need to understand this important fact otherwise you might try to add .cpp and .c files to other folders such as SomeDir. The Arduino IDE will not compile that code! It will only compile the code in the folders I have mentioned.

3) Visual Micro allows you to put code in any folder. This is how normal IDE's work and is more powerful and flexible but it always involves "Including" the code into the project. Otherwise it would mean looking at the project folder, which might contain other "test folders", but attempting to compile everything it finds. That is not how any IDE works.

So point 1) is the confusion that I can solve however you should also know that Atmel Studio and Visual Studio usually expect the files to be included in the project, then it can better determine intellisense.

I hope this is all clear now, ask if anything is still unclear.
Back to top
 
WWW  
IP Logged
 
testato
Full Member
***
Offline



Posts: 48
Re: Deep Search bug ?
Reply #7 - Jun 3rd, 2017 at 3:55pm
 
i made another test, i opened a project that contain simply a tab (so there is two .ino in the project folder), and the second .ino it is not visible in the solution Explorer and also it is not working.

are you made this kind of test for the last version ?
seems that visualmicro work on AtmelStudio only for a single .ino project

Back to top
 
 
IP Logged
 
testato
Full Member
***
Offline



Posts: 48
Re: Deep Search bug ?
Reply #6 - Jun 3rd, 2017 at 3:47pm
 
No, the SameDir folder is not included in the rpoject, the Show all files is not active, so i do not view the SomeDir folder.

I activated the Show all files, and manually included the SomeDir folder, and now it work.

But it is not a standard behaviour right ?
Because the target of VisualMicro is that a .ino working on ArduinoIDE will work also on VisualMIcro without modification, if I remember.

and also the special "src" folder do not work without modification
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 7915
United Kingdom
Re: Deep Search bug ?
Reply #5 - Jun 3rd, 2017 at 3:40pm
 
Thanks

Is the header actually included in the project?

Please ensure the button above the solution explorer called "Show all files" is not selected and then tell me if the header can be seen in the solution tree ?

If the header does not appear then switch back to "show all files", right click and "Include in Project"
Back to top
« Last Edit: Jun 3rd, 2017 at 3:40pm by Visual Micro »  
WWW  
IP Logged
 
testato
Full Member
***
Offline



Posts: 48
Re: Deep Search bug ?
Reply #4 - Jun 3rd, 2017 at 3:37pm
 
Code:
Compiling 'pippo' for 'Arduino Fio'
Build Folder: file:///C:/Users/win10/AppData/Local/Temp/VMBuilds/pippo/fio/Debug
Summary: Header=1 Prototypes=3 Imports=0
Additional Defines:
Architecture Tools: file:///D:/DATI/PERSONALE/Varie/Elettronica/ARDUINO/arduino-1.8.2/hardware/tools/avr/bin/
Api: 1705.7
Sketch Book: file:///D:/DATI/PERSONALE/Varie/Elettronica/ARDUINO/SKETCH
Sketch Include Paths
Core Include Paths
Include Path file:///D:/DATI/PERSONALE/Varie/Elettronica/ARDUINO/arduino-1.8.2/hardware/arduino/avr/cores/arduino
Include Path file:///D:/DATI/PERSONALE/Varie/Elettronica/ARDUINO/arduino-1.8.2/hardware/arduino/avr/variants/eightanaloginputs
Searching for libraries ...
"D:\DATI\PERSONALE\Varie\Elettronica\ARDUINO\arduino-1.8.2\hardware\tools\avr\bin\avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_FIO -DARDUINO_ARCH_AVR -I"D:\DATI\PERSONALE\Varie\Elettronica\ARDUINO\arduino-1.8.2\hardware\arduino\avr\cores\arduino" -I"D:\DATI\PERSONALE\Varie\Elettronica\ARDUINO\arduino-1.8.2\hardware\arduino\avr\variants\eightanaloginputs" "C:\Users\win10\AppData\Local\Temp\VMBuilds\pippo\fio\Debug\pippo.cpp" -o "nul"
"D:\DATI\PERSONALE\Varie\Elettronica\ARDUINO\arduino-1.8.2\hardware\tools\avr\bin\avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=8000000L -DARDUINO=10802 -DARDUINO_AVR_FIO -DARDUINO_ARCH_AVR -I"D:\DATI\PERSONALE\Varie\Elettronica\ARDUINO\arduino-1.8.2\hardware\arduino\avr\cores\arduino" -I"D:\DATI\PERSONALE\Varie\Elettronica\ARDUINO\arduino-1.8.2\hardware\arduino\avr\variants\eightanaloginputs" "C:\Users\win10\AppData\Local\Temp\VMBuilds\pippo\fio\Debug\pippo.cpp" -o "nul"

pippo.ino: 2:55: fatal error: SomeDir\test.h: No such file or directory
   #include "SomeDir\test.h" // This is the ISSUE request
   compilation terminated



	An error was encountered during the 'Deep Search' library discovery process.
Build failed for project 'pippo' 

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



Posts: 7915
United Kingdom
Re: Deep Search bug ?
Reply #3 - Jun 3rd, 2017 at 3:32pm
 
Thanks,

Please switch on vmicro>compiler>verbose and then click build. Post or email the output.

Then we can easily see the paths that are being passed to the compiler and also where and what error has been shown.

Thanks



Back to top
 
WWW  
IP Logged
 
testato
Full Member
***
Offline



Posts: 48
Re: Deep Search bug ?
Reply #2 - Jun 3rd, 2017 at 3:26pm
 
I attached a .zip, it is a very simple examples, no library, no code.
All that you need is inside the .zip

It use a subfolder named "SomeDir", that on Arduino work regularly. But I tried also whit the special "src" folder with the same negative result.

I using last arduino and last visualmicro on last atmelstudio7

I'm sure that my attached .zip do not work on your PC also
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 7915
United Kingdom
Re: Deep Search bug ?
Reply #1 - May 23rd, 2017 at 7:20pm
 
You need to provide verbose output with "show build properties" with all reports so we can see what you have installed in board manager, which board you are using, which libraries you have installed and from which location.

Without this information I can never help.

You should also provide the atmel cpproj (project) that you are using in your project. Otherwise I can check that you have included your source code in your project correctly.

You should also only use sub folder "src" or sub folders below that. Arduino does not support other sub folders although the odd header might work it's not right to do that.

Thanks

Back to top
« Last Edit: May 23rd, 2017 at 7:23pm by Visual Micro »  
WWW  
IP Logged
 
testato
Full Member
***
Offline



Posts: 48
Deep Search bug ?
May 23rd, 2017 at 4:51pm
 
the simple project that I attached do not compile on AtmelStudio7
On Arduino 1.8.2 it work.

Back to top
« Last Edit: May 23rd, 2017 at 4:52pm by testato »  

pippo_001.zip (0 KB | 28 )
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print