VS Arduino
Visual Micro >> Visual Studio 2017, 2019, 2022 >> Problem with 'Startup Project' and size_t ambiguity
https://www.visualmicro.com/forums/YaBB.pl?num=1550248042

Message started by Todd Osborne on Feb 15th, 2019 at 4:27pm

Title: Problem with 'Startup Project' and size_t ambiguity
Post by Todd Osborne on Feb 15th, 2019 at 4:27pm
I am evaluating Visual Micro now, and for the most part it works great. Being able to develop using a modern and capable IDE really speeds up the process. However, I am having 2 problems.

1) Visual Micro seems to ignore the Startup Project when building. I have a solution that has 1 Windows program and 2 Arduino projects. I have to unload one of the Arduino projects to build the other. Setting it as the Startup Project, like the manual says to do, has no impact, Visual Micro always builds the first Arduino project it finds. Loading and unloading projects is tiresome.

2) Visual Studio always complains about size_t be ambiguous. In my Arduino projects, I have cleared the Visual Studio include directory, and made sure that all include files are coming from the Teensy headers. There are no Windows or Visual C++ files being included, but the IDE still complains and underlines all size_t types. When I right click and choose "Peek" it finds 0 size_t to navigate to. If I right click and choose view the declaration, it jumps to the correct Teensy include file where size_t is defined.

Thanks!

Title: Re: Problem with 'Startup Project' and size_t ambiguity
Post by Visual Micro on Feb 15th, 2019 at 6:24pm
Thanks for the post and good to hear things are going well. Answer and question below


Quote:
1) Visual Micro seems to ignore the Startup Project when building. I have a solution that has 1 Windows program and 2 Arduino projects. I have to unload one of the Arduino projects to build the other. Setting it as the Startup Project, like the manual says to do, has no impact, Visual Micro always builds the first Arduino project it finds. Loading and unloading projects is tiresome.


This behavior is optional.

Why

The problem is that most arduino users do not understand the concept of a Visual Studio Start-up project. In fact they find it confusing.

Default way of working

Therefore Visual Micro builds the project of the code that is active in the code editor. This means that is you are editing/viewing "Project1.ino" it will build when you click build. If you are editing/viewing "Project2.ino" then Project2 will build.

Using the Startup Project

If I recall you can enable use of Startup project by switching OFF vMicro>General>Active Code Has Priority Over Solution Explorer

Documentation

Maybe this needs to be documented better. If you have seen a link on visualmicro.com that is incorrect then please provide otherwise I will add to the docs.



Quote:
2) Visual Studio always complains about size_t be ambiguous. In my Arduino projects, I have cleared the Visual Studio include directory, and made sure that all include files are coming from the Teensy headers. There are no Windows or Visual C++ files being included, but the IDE still complains and underlines all size_t types. When I right click and choose "Peek" it finds 0 size_t to navigate to. If I right click and choose view the declaration, it jumps to the correct Teensy include file where size_t is defined.


Visual Micro manages the build process to ensure it is accurate but we leave a lot of intellisense to Visual Studio.

Sometimes VS intellisense needs a little extra info for certain boards/platforms. Therefore, for intellisense reports please always state the board/mcu you are using and if not standard arduino then provide a link to the board support package or git repository. Failing that at least say the name of the board and hardware package.


Thanks

Title: Re: Problem with 'Startup Project' and size_t ambiguity
Post by Todd Osborne on Feb 15th, 2019 at 6:31pm
Thank you for your very quick response. I disabled the option you mentioned and Visual Micro does indeed build the startup project, so that issue is resolved. Thanks! As for the size_t issue, my build target is Teensy 3.2 and I have Visual Micro set to target Teensy 3.1/3.2.

Title: Re: Problem with 'Startup Project' and size_t ambiguity
Post by Todd Osborne on Feb 15th, 2019 at 6:34pm
Where I found the bad information about how the Startup Project defines which project to build came from https://www.visualmicro.com/page/User-Guide.aspx?doc=Projects-and-Solutions.html

which states...

The Startup Project
From all projects within a solution, exactly one project is the startup project. This is the project whose executable code will be uploaded to the board if you activate the Build & Upload command. If you have debugging enabled, this will also be the Arduino board and project that you are debugging. Building with multiple projects: VM does noit work this way anymore
You can change the startup project by right clicking on the project in Solution Explorer (indicated by the 2 and 3 above) and choosing "Set as Startup Project".

Title: Re: Problem with 'Startup Project' and size_t ambiguity
Post by Visual Micro on Mar 18th, 2019 at 2:21am
Sorry I missed this response.

Thanks, yes the docs were currently being updated and we found that old reference.

Which version of visual studio or atmel are you using for teensy dev?


Title: Re: Problem with 'Startup Project' and size_t ambiguity
Post by Visual Micro on Mar 23rd, 2019 at 6:33pm
Debug question moved to here

VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.