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) "Add new Arduino Library Project" adds wrong path to ClInclude property in .vcxitems file (Read 2033 times)
stm
Junior Member
**
Offline


Posts: 27
Joined: Jul 5th, 2018
"Add new Arduino Library Project" adds wrong path to ClInclude property in .vcxitems file
Jun 24th, 2020 at 9:41am
Print Post  
It looks like Visual Studio 2019 is creating the wrong path for the header file (ClInclude property in .vcxitems file) when creating a library. Are we doing something wrong or is this a bug? Thank you.


Reproduce:

1) Create new simple library project

File -> New -> Project... -> Arduino Library Project

with header and cpp file both automatically in src\ folder.

2) .vcxitems file after creating library (note the commented line and the missing "src\" in the ClInclude Include path!) :

<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

...

<ItemGroup>
  <Text Include="$(MSBuildThisFileDirectory)readme.txt" />
  <Text Include="$(MSBuildThisFileDirectory)library.properties" />
  <Text Include="$(MSBuildThisFileDirectory)src\NewLibrary.h" />
</ItemGroup>
<ItemGroup>
  <!-- <ClInclude Include="$(MSBuildThisFileDirectory)NewLibrary.h" /> -->
</ItemGroup>
<ItemGroup>
  <ClCompile Include="$(MSBuildThisFileDirectory)src\NewLibrary.cpp" />
</ItemGroup>
</Project>
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: "Add new Arduino Library Project" adds wrong path to ClInclude property in .vcxitems file
Reply #1 - Jun 24th, 2020 at 12:09pm
Print Post  
Is the newLibrary.h in the \src folder?

Maybe that is a bug in our new library project template or a bug in VS. If you right click > exclude the NewLibrary.h and then re-include for the correct location does this fix the issue?

After you have a shared project created, there isn't any magic code behind the scenes. You have full control to ensure the correct paths. Obvioulsly keen to understand where the NewLibrary.h actually is and if you added it yourself (or not)?


  
Back to top
WWW  
IP Logged
 
stm
Junior Member
**
Offline


Posts: 27
Joined: Jul 5th, 2018
Re: "Add new Arduino Library Project" adds wrong path to ClInclude property in .vcxitems file
Reply #2 - Jun 25th, 2020 at 6:59am
Print Post  
We did not add NewLibrary.h ourselves. This was done using the template.

NewLibrary.h was in folder src\

after excluding and re-including the path was fixed and correct. So I think this is a bug then.
  
Back to top
 
IP Logged
 
stm
Junior Member
**
Offline


Posts: 27
Joined: Jul 5th, 2018
Re: "Add new Arduino Library Project" adds wrong path to ClInclude property in .vcxitems file
Reply #3 - Jun 25th, 2020 at 7:01am
Print Post  
By the way as written above we created NOT a "Shared Code Project" but a "Arduino Library Project"
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: "Add new Arduino Library Project" adds wrong path to ClInclude property in .vcxitems file
Reply #4 - Jun 25th, 2020 at 11:16am
Print Post  
Okay good to hear it's fixed. I am having problems replicating the issue. Creating a new Library project gives a LibName.cpp and LibName.h in the src folder. Closing and reopening the solution shows all okay.

If you manage to replicate then please let us know.

One thing to be aware of is that if windows explore is used to move a file then the project will be out of sync and you would have to exclude/include as you did to fix the issue.

Sorry can't be more help. Thanks again.
  
Back to top
WWW  
IP Logged
 
stm
Junior Member
**
Offline


Posts: 27
Joined: Jul 5th, 2018
Re: "Add new Arduino Library Project" adds wrong path to ClInclude property in .vcxitems file
Reply #5 - Jun 26th, 2020 at 9:09am
Print Post  
It is not fixed. I think there is a bug. I don't know about the implications though. Please read again the first post of this topic to understand how it can be reproduced. Your .vcxitems file of the project should show the wrong content.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: "Add new Arduino Library Project" adds wrong path to ClInclude property in .vcxitems file
Reply #6 - Jun 26th, 2020 at 10:07am
Print Post  
Hi

I meant that it is good to hear you fixed it by moving the file around in the solution explorer. That's easy to do.

I tried it and it created the this:-
"Creating a new Library project gives a LibName.cpp and LibName.h in the src folder. Closing and reopening the solution shows all okay"

Can you please create a new library and then close the solution, zip and attach the vcxitems.

Thanks
  
Back to top
WWW  
IP Logged
 
stm
Junior Member
**
Offline


Posts: 27
Joined: Jul 5th, 2018
Re: "Add new Arduino Library Project" adds wrong path to ClInclude property in .vcxitems file
Reply #7 - Jun 26th, 2020 at 12:14pm
Print Post  
Created using Visual Studio 2019 (16.6.2) and Visual Micro (20.6.18.1). Arduino is 1.8.3
  

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: "Add new Arduino Library Project" adds wrong path to ClInclude property in .vcxitems file
Reply #8 - Jun 27th, 2020 at 11:15pm
Print Post  
Thanks, I think it is a vs bug. You can see the new library project template and experiment with it as follows:-

Scroll to the bottom of vMicro>General>Global Options and see the "Assembly Path". Below that path is a folder called "ProjectTemplates". Below that folder is the "visualmicro_libraryproject" folder.

The .vcxitems and .vcxtemplate files use standard vs template syntax. Any changes you make should apply immediately but certainly after vs re-start. Notice that both the .cpp and the .h are specified with src folder in the same way.

Vs is responsible for running the new project template wizard and processing the results. Look forward to hearing what you uncover.

Thanks

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