Visual Studio Ide for Arduino
https://www.visualmicro.com/forums/YaBB.pl
Visual Micro >> Installation & Troubleshooting >> Visual Micro Arduino Command Line Interface failes to build Project from command line
https://www.visualmicro.com/forums/YaBB.pl?num=1567426178

Message started by stm on Sep 2nd, 2019 at 1:09pm

Title: Visual Micro Arduino Command Line Interface failes to build Project from command line
Post by stm on Sep 2nd, 2019 at 1:09pm
I am trying to automate a build of a project using your Command Line Interface tool (https://www.visualmicro.com/page/Visual-Micro-Command-Line-Interface.aspx).

The project builds from within Visual Studio but the build fails from the command line. Already the first header file that is used from one of our own libraries is not found and the build fails.

To me it looks like the "AdditionalIncludeDirectories" property of the project file is not respected when using the Command Line Interface. Also the additional defines don't seem to be used for the CLI build.

The AdditionalIncludeDirectories property from the project .vcxproj file looks as follows:

[code] <PropertyGroup />
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <ClCompile>
      <WarningLevel>Level3</WarningLevel>
      <Optimization>Disabled</Optimization>
      <SDLCheck>true</SDLCheck>
      <AdditionalIncludeDirectories>$(ProjectDir)..\RunningTargetMotor;$(ProjectDir)..\libraries\MinionSanityCheck\src; ...
...[/code]

Attachment 1: Failing build log of CLI
Attachment 2: Working build log of Visual Studio

Let me know if you need more details of anything. Thank you.
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=VmCliBuildLog_20190902_1400.txt (12 KB | 7 )
https://www.visualmicro.com/forums/YaBB.pl?action=downloadfile;file=VmVsBuildLog_20190902_1400.txt (688 KB | 6 )

Title: Re: Visual Micro Arduino Command Line Interface failes to build Project from command line
Post by Visual Micro on Oct 12th, 2019 at 2:37pm
Sorry this took so long. The command line tool has been updated.

Visual Micro Command Line Tool

Title: Re: Visual Micro Arduino Command Line Interface failes to build Project from command line
Post by stm on Oct 14th, 2019 at 3:11pm
Hello Tim
Just tried the new version and unfortunately the issue has not been resolved from what I see. All entries in AdditionalIncludeDirectories are still not considered. The build log shows many -IC entries but none of them coming from the .vcxproj project file. the build log looks the same as above and shows the same error messages so I pass on attaching them again.

Title: Re: Visual Micro Arduino Command Line Interface failes to build Project from command line
Post by Visual Micro on Oct 14th, 2019 at 3:37pm
Hi

Sorry I didn't fully read your intiial post. There was an issue with the command line tool which is now fixed however your report about include directories is unrelated.

The additiona include directories in the project settings should be considered read-only for intellisense only.

You can specify additional compiler includes using the extra flags F4 project properties. Use the -IdirName syntax.

Switching on the build properties on the vMicro compiler menu will also allow you to see all the build variables which can also be used when specifying include paths. For example, if there is a project_path variable it can be used like so:-

-I{project_path}\..\myHeaders -I{project_path}\..\myHeaders2



Title: Re: Visual Micro Arduino Command Line Interface failes to build Project from command line
Post by Visual Micro on Oct 19th, 2019 at 3:35pm
Once again appologies for the delay and thanks for providing such useful info in the outputs.

The issue is some confusion that we will clarify in the documentation and also provide better feed back in the CLI.

As stated previously the include paths are not stored in VS, in fact they are dynamically recreated each time a project changes or builds. That is for Vs intellisense.

In Arduino paths are generally worked out dynamically and in this case what is missing is the Arduino Sketch Book folder location. We can see the sketch book location easly in the IDE build output but it is missing from your CLI build output.

For Arduino, the user installed libraries are always assumed to be in "SketchBook\Libraries" which the CLI can't see. This is why you believed include paths are missing.

The reason the CLI can not see the sketchbook is that your CI command does not specify an IDEName (-builder.application_id=) therefore Visual Micro will use the NoIDE option (that you can see in the VsIDE).

In the VsIDE you have specified a Sketch Book folder location of "Public/Arduino/ArduinoGIT" for the "Arduino 1.6/1.8" application but have not set a Sketch Book folder location for the NoIDE application. Hence an unknown Sketch Book location will probably default to "myDocuments\Arduino" where your \libraries do not exist.

1 - NoIDE


Code (]vmbuild.exe  -builder.ide_path="D:\Arduino\arduino-1.8.1" -builder.upload=false -builder.build=true -builder.project_path="C:\Users\tl\Documents\Arduino\MyProject\MyProject.vcxproj"  -builder.verbose=true -builder.verbose_warnings=true -builder.board_id=Pico [/code):
2 - Arduino 1.6/1.8 IDE

[code]vmbuild.exe -builder.application_id=arduino16x -builder.upload=false -builder.build=true -builder.project_path="C:\Users\tl\Documents\Arduino\MyProject\MyProject.vcxproj"  -builder.verbose=true -builder.verbose_warnings=true -builder.board_id=Pico


Solution

Therefore the solution is to either add the optional Sketch Book Location to the NoIDE option in Visual Micro or use the 2nd command syntax example above.

I hope this makes sense?

Visual Studio Ide for Arduino » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2019. All Rights Reserved.