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) Nonsensical errors on new computer (Read 3854 times)
E-RAB
Newbies
*
Offline


Posts: 8
Joined: Mar 17th, 2019
Nonsensical errors on new computer
Mar 17th, 2019 at 10:48pm
Print Post  
I can compile with the Arduino IDE just fine, but when I compile with Visual Micro, it returns bizarre errors in weird locations. It said something even crazier before this, but now it's stuck on this error. I'm not even sure how to go about attempting to make this thing work in Visual Micro. I want to clean install visual micro, but that doesn't appear to be an option based on my uninstall/install efforts. On my old computer it just worked for the most part, never had any weird errors like this. It also still compiles my code just fine on that computer. I really think this is a weird Visual Micro bug of some sort.
¯\_(ツ)_/¯

Using (all updated today):
Latest Visual Studio 2017
Latest Visual Micro
Latest Arduino 1.8.9

Completely crazy nonsensical error below. We all know that fabs and ceil macros are definitely inside the scope. Especially since this compiles in the Arduino IDE.
Code
Select All
USBAPI.h:27: In file included from
arduino.h:233: from
FishLight2.ino: from

delay.h: In function void _delay_ms(double)

delay.h: 184:42: error: 'fabs' was not declared in this scope
   __ticks_dc = (uint32_t)(ceil(fabs(__tmp)))

delay.h: 184:43: error: 'ceil' was not declared in this scope
   __ticks_dc = (uint32_t)(ceil(fabs(__tmp))) 



To clarify, nothing is different from my other computer. Same libraries, same folder locations, same everything.
« Last Edit: Mar 18th, 2019 at 5:11am by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Nonsensical errors on new computer
Reply #1 - Mar 17th, 2019 at 11:01pm
Print Post  
Unfortunately there are a lot of factors at play when it comes to intellisense. 

For compilation visual micro handles things entirely but for intellisense we are reliant on visual studio and in some cases the tool chain you have installed such as local arduino avr or a board package installed via board manager. If via board manager there are different versions.

Unfortunately Visual Studio does not yet fully understand gcc so that can be an issue especially in some deeper core files. The Error List has settings that allow you to filter for Build Only or to filter on Open Documents so you don't see the errors.


As you can see there are quite a few factors at play and especially so because the delay.h will be specific to your hardware/core. Therefore when posting questions about errors it is always useful to post your verbose build output as a .txt file.

Verbose error reporting can be enabled by switching on two properties.
vMicro>Compiler>Verbose
vMicro>Compiler>Show build properties


Thanks
  
Back to top
WWW  
IP Logged
 
E-RAB
Newbies
*
Offline


Posts: 8
Joined: Mar 17th, 2019
Re: Nonsensical errors on new computer
Reply #2 - Mar 17th, 2019 at 11:06pm
Print Post  
Here's the verbose output: https://pastebin.com/hb6GkNxC

Edit: Intellisense is working just fine. This error is a pure compilation error on Visual Micro's part.

Edit: Also, I put this code online for any reference points https://github.com/Goodlookinguy/FishLight2 - It's compiled for a genuine Arudino Micro.
« Last Edit: Mar 17th, 2019 at 11:11pm by E-RAB »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Nonsensical errors on new computer
Reply #3 - Mar 17th, 2019 at 11:34pm
Print Post  
I see sorry I thought the snippet was from intellisense. makes more sense now I can see the compile/board source etc.

Can you try changing the tool bar from debug to release then try the build

Thanks
  
Back to top
WWW  
IP Logged
 
E-RAB
Newbies
*
Offline


Posts: 8
Joined: Mar 17th, 2019
Re: Nonsensical errors on new computer
Reply #4 - Mar 17th, 2019 at 11:59pm
Print Post  
I tried that and it still gives the same error.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Nonsensical errors on new computer
Reply #5 - Mar 18th, 2019 at 2:12am
Print Post  
Thanks for the info. Is there more to the error you are seeing?

I am not entirely sure which libs you have installed but think I have installed the correct ones

I see pretty much the same in arduino as I do in visual micro so maybe I have the wrong library 

Can you please post the verbose output from the arduino and ensure your visual micro error in the link you provided is the entire error. The file>preferences menu in the arduino ide allows verbose to be enabled.

The last part of the error I see is as follows. If you don't see the " DS3231' has no member named 'getTime" error then I must have the wrong DS3231 lib installed.


Code
Select All
_MenuEvents.cpp: In function void OnMainMenu_DateTimeEnter(FishLightProgram*, int8_t)

_MenuEvents.cpp: 34:40: error: 'class DS3231' has no member named 'getTime
   auto time = program->RealTimeClock()->getTime()

_MenuEvents.cpp: In function void OnDateTime_MonthOrYearChange(FishLightProgram*, int8_t)

_MenuEvents.cpp: 125:91: error: no matching function for call to 'DS3231::setDate(int16_t, int16_t, int16_t)
   program->RealTimeClock()->setDate(dayItem->Value(), monthItem->Value(), yearItem->Value())

FishLightProgram.h:14: In file included from
_MenuEvents.h:12: from
_MenuEvents.cpp:5: from
DS3231.h:94: note  candidate  void DS3231  setDate(byte)
   void setDate(byte Date)
DS3231.h:94: note    candidate expects 1 argument, 3 provided

_MenuEvents.cpp: 126:28: error: 'class DS3231' has no member named 'setTime
   program->RealTimeClock()->setTime(hourItem->Value() + 12 * isPM, minItem->Value(), 0)
Debug build failed for project 'FishLight2' 




NB: If your errors are not in order it might be you have switched on high speed parrale builds. This does make it more difficult to read errors.
« Last Edit: Mar 18th, 2019 at 2:13am by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
E-RAB
Newbies
*
Offline


Posts: 8
Joined: Mar 17th, 2019
Re: Nonsensical errors on new computer
Reply #6 - Mar 18th, 2019 at 2:46am
Print Post  
I was using an older DS3231 library. I updated the code to the new one that you have. It still compiles with the aforementioned error only in Visual Micro.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Nonsensical errors on new computer
Reply #7 - Mar 18th, 2019 at 2:53am
Print Post  
Please give that verbose output from the arduino ide. It will show which libraries is finds and from where.
  
Back to top
WWW  
IP Logged
 
E-RAB
Newbies
*
Offline


Posts: 8
Joined: Mar 17th, 2019
Re: Nonsensical errors on new computer
Reply #8 - Mar 18th, 2019 at 3:34am
Print Post  
« Last Edit: Mar 18th, 2019 at 3:36am by E-RAB »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
error: 'class DS3231' has no member named 'setTime
Reply #9 - Mar 18th, 2019 at 4:13am
Print Post  
Please say where you found your version of the DS3231 library. This is the code from the one in library manager and it does not contain the setTime method used in your _MenuEvents.cpp. (      program->RealTimeClock()->setTime(hourItem->Value() + 12 * isPM, minItem->Value(), 0); )

//DS3231.h
Code (C++)
Select All
class DS3231 {
	public:

		//Constructor
		DS3231();

		// Time-retrieval functions
   
		// the get*() functions retrieve current values of the registers.
		byte getSecond();
		byte getMinute();
		byte getHour(bool& h12, bool& PM);
			// In addition to returning the hour register, this function
			// returns the values of the 12/24-hour flag and the AM/PM flag.
		byte getDoW();
		byte getDate();
		byte getMonth(bool& Century);
			// Also sets the flag indicating century roll-over.
		byte getYear();
			// Last 2 digits only

		// Time-setting functions
		// Note that none of these check for sensibility: You can set the
		// date to July 42nd and strange things will probably result.

		void setSecond(byte Second);
			// In addition to setting the seconds, this clears the
			// "Oscillator Stop Flag".
		void setMinute(byte Minute);
			// Sets the minute
		void setHour(byte Hour);
			// Sets the hour
		void setDoW(byte DoW);
			// Sets the Day of the Week (1-7);
		void setDate(byte Date);
			// Sets the Date of the Month
		void setMonth(byte Month);
			// Sets the Month of the year
		void setYear(byte Year);
			// Last two digits of the year
		void setClockMode(bool h12);
			// Set 12/24h mode. True is 12-h, false is 24-hour.

		// Temperature function

		float getTemperature();

		// Alarm functions

		void getA1Time(byte& A1Day, byte& A1Hour, byte& A1Minute, byte& A1Second, byte& AlarmBits, bool& A1Dy, bool& A1h12, bool& A1PM);
/* Retrieves everything you could want to know about alarm
 * one.
 * A1Dy true makes the alarm go on A1Day = Day of Week,
 * A1Dy false makes the alarm go on A1Day = Date of month.
 *
 * byte AlarmBits sets the behavior of the alarms:
 *	Dy	A1M4	A1M3	A1M2	A1M1	Rate
 *	X	1		1		1		1		Once per second
 *	X	1		1		1		0		Alarm when seconds match
 *	X	1		1		0		0		Alarm when min, sec match
 *	X	1		0		0		0		Alarm when hour, min, sec match
 *	0	0		0		0		0		Alarm when date, h, m, s match
 *	1	0		0		0		0		Alarm when DoW, h, m, s match
 *
 *	Dy	A2M4	A2M3	A2M2	Rate
 *	X	1		1		1		Once per minute (at seconds = 00)
 *	X	1		1		0		Alarm when minutes match
 *	X	1		0		0		Alarm when hours and minutes match
 *	0	0		0		0		Alarm when date, hour, min match
 *	1	0		0		0		Alarm when DoW, hour, min match
 */
		void getA2Time(byte& A2Day, byte& A2Hour, byte& A2Minute, byte& AlarmBits, bool& A2Dy, bool& A2h12, bool& A2PM);
			// Same as getA1Time();, but A2 only goes on seconds == 00.
		void setA1Time(byte A1Day, byte A1Hour, byte A1Minute, byte A1Second, byte AlarmBits, bool A1Dy, bool A1h12, bool A1PM);
			// Set the details for Alarm 1
		void setA2Time(byte A2Day, byte A2Hour, byte A2Minute, byte AlarmBits, bool A2Dy, bool A2h12, bool A2PM);
			// Set the details for Alarm 2
		void turnOnAlarm(byte Alarm);
			// Enables alarm 1 or 2 and the external interrupt pin.
			// If Alarm != 1, it assumes Alarm == 2.
		void turnOffAlarm(byte Alarm);
			// Disables alarm 1 or 2 (default is 2 if Alarm != 1);
			// and leaves the interrupt pin alone.
		bool checkAlarmEnabled(byte Alarm);
			// Returns T/F to indicate whether the requested alarm is
			// enabled. Defaults to 2 if Alarm != 1.
		bool checkIfAlarm(byte Alarm);
			// Checks whether the indicated alarm (1 or 2, 2 default);
			// has been activated.

		// Oscillator functions

		void enableOscillator(bool TF, bool battery, byte frequency);
			// turns oscillator on or off. True is on, false is off.
			// if battery is true, turns on even for battery-only operation,
			// otherwise turns off if Vcc is off.
			// frequency must be 0, 1, 2, or 3.
			// 0 = 1 Hz
			// 1 = 1.024 kHz
			// 2 = 4.096 kHz
			// 3 = 8.192 kHz (Default if frequency byte is out of range);
		void enable32kHz(bool TF);
			// Turns the 32kHz output pin on (true); or off (false).
		bool oscillatorCheck();;
			// Checks the status of the OSF (Oscillator Stop Flag);.
			// If this returns false, then the clock is probably not
			// giving you the correct time.
			// The OSF is cleared by function setSecond();.

	private:

		byte decToBcd(byte val);
			// Convert normal decimal numbers to binary coded decimal
		byte bcdToDec(byte val);
			// Convert binary coded decimal to normal decimal numbers
		byte readControlByte(bool which);
			// Read selected control byte: (0); reads 0x0e, (1) reads 0x0f
		void writeControlByte(byte control, bool which);
			// Write the selected control byte.
			// which == false -> 0x0e, true->0x0f.

}; 

« Last Edit: Mar 18th, 2019 at 4:15am by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
E-RAB
Newbies
*
Offline


Posts: 8
Joined: Mar 17th, 2019
Re: error: 'class DS3231' has no member named 'setTime
Reply #10 - Mar 18th, 2019 at 4:29am
Print Post  
I updated the code on the repository a few hours ago to deal with your issue. Just update it.

https://github.com/Goodlookinguy/FishLight2
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Nonsensical errors on new computer
Reply #11 - Mar 18th, 2019 at 5:10am
Print Post  
Oh I see. sorry i thought you had updated the library version. 

I have replicated the problem and will investigate over the next day or so.

You are right, it doesn't make sense.
« Last Edit: Mar 18th, 2019 at 5:10am by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Nonsensical errors on new computer
Reply #12 - Mar 23rd, 2019 at 7:15pm
Print Post  
Sorry for the delay with this. The issue is related to order of include paths which should be resolved in the next release.

You can easily resolve yourself by renaming your Math.h, for example rename it to Math2.h and change your #include "Math.h" to #include "Math2.h"

The problem is that the delay() function in the core uses math.h but the wrong one is found due to you having file of same name in the project.

Thanks for the useful report.

« Last Edit: Mar 23rd, 2019 at 7:20pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
E-RAB
Newbies
*
Offline


Posts: 8
Joined: Mar 17th, 2019
Re: Nonsensical errors on new computer
Reply #13 - Mar 23rd, 2019 at 9:29pm
Print Post  
Ah! That makes sense. Math.h was a bad file name to be honest. I knew there might be conflicts, but since it compiled, in the Arduino IDE, I left it alone. Good job on figuring it out.
« Last Edit: Mar 23rd, 2019 at 9:30pm by E-RAB »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Nonsensical errors on new computer
Reply #14 - Mar 23rd, 2019 at 9:41pm
Print Post  
Great thanks.

This issue is also resolved if you switch OFF "Tools>Options>Compiler>Project Folder -I"

The default for Visual Micro is to provide access to the project folder during compile of the project code(s). It's not required by preferred by quite a few users. Maybe the default should be changed to OFF.

We will add the option to the vMicro menu so that it is more obvious in the next release.

« Last Edit: Mar 23rd, 2019 at 9:45pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint