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
Normal Topic VS or VM cannot find math.h (Read 4108 times)
chiMT
Junior Member
**
Offline


Posts: 14
Joined: Nov 9th, 2017
VS or VM cannot find math.h
Oct 8th, 2018 at 3:52am
Print Post  
Hello,

We have an interesting error happening. We have an identical setup on 3 machines. VS2017 and the latest visual micro. When opening the same arduino project on all 3 machines two of the machines have no problem with our include files and one machine gives an error on the standard include of math.h.

Code (C++)
Select All
#include <math.h> 



Does anyone have any idea on why one machine has a problem finding the math.h library?

The MV setup for the arduino IDE is the same on all three machines. (see attached screenshot)

The error is: Cannot open source file "math.h" (also, see attached screenshot)

Thank you.
« Last Edit: Oct 8th, 2018 at 2:18pm by Tim@Visual Micro »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VS or VM cannot find math.h
Reply #1 - Oct 8th, 2018 at 2:20pm
Print Post  
Switch on vmicro>compiler>verbose and vmicro>compiler>show build properties

Then post the output as a .txt file or email to info[at]visualmicro.com with link to this post.

  
Back to top
IP Logged
 
chiMT
Junior Member
**
Offline


Posts: 14
Joined: Nov 9th, 2017
Re: VS or VM cannot find math.h
Reply #2 - Oct 8th, 2018 at 5:39pm
Print Post  
Thanks for the reply.

It seems that at times Visual Studio has problems with the fact that we are using a custom board package. We have to use the dropdown for "Add library" and add the DynamixelSDK.h library and when you do the math.h include will start working. 

I'm not sure why just typing in this include doesn't work. We have to add it through the VM menu for it to work.
Code (C++)
Select All
#include <DynamixelSDK.h> 



Also, if they are both highlighted red, when doing a build VS finds the files and the errors goes away. 

I haven't been able to repeat it where it is just the math.h include with a red error today. So I can't produce a build report with an error.

Since we have figured out what is causing the problem and found out how to fix it we can close this thread issue.

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


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VS or VM cannot find math.h
Reply #3 - Oct 8th, 2018 at 7:09pm
Print Post  
It's correct that a build will re-establish or add new paths for #includes.

It's not possible ti investigate anything without seeing the requested compiler output. There are a lot of tool chains and libraries. All work differently so without knowing ide version, tool chain, board etc. there is nothing to be looked at. The build output as described previously removes the need for you to give any information.
  
Back to top
IP Logged
 
chiMT
Junior Member
**
Offline


Posts: 14
Joined: Nov 9th, 2017
Re: VS or VM cannot find math.h
Reply #4 - Oct 9th, 2018 at 1:28am
Print Post  
I'm attaching the build output.

What I still don't understand is that the build output doesn't show the math.h being included, but it works.

Also, when using a custom board, and having it used in the VM board type drop down, does that change all the places includes look and that is why it was having trouble finding the math.h file?

I do have it working now as stated above. But curious about learning how this works for future development.
« Last Edit: Oct 9th, 2018 at 1:36am by chiMT »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint