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) I get different results from the same compiler (Read 3494 times)
rick_duley
Junior Member
**
Offline


Posts: 49
Location: Western Australia
Joined: Jan 8th, 2017
I get different results from the same compiler
Mar 7th, 2017 at 8:02am
Print Post  
As an experiment I loaded these declarations into three IDEs all of which use the good old GCC compiler.
Code (C++)
Select All
byte slaveAddresses[6][6] =
{ "0Node", "1Node", "2Node", "3Node", "4Node", "5Node" };

const byte rAddress[] = "0Node" "1Node" "2Node" "3Node" "4Node" "5Node";

uint8_t SLAVE_0[] = { "0Node" };
uint8_t SLAVE_1[] = { "1Node" };
uint8_t SLAVE_2[] = { "2Node" };
uint8_t SLAVE_3[] = { "3Node" };
uint8_t SLAVE_4[] = { "4Node" };
uint8_t SLAVE_5[] = { "5Node" }; 



To my amazement: Shocked

Arduino IDE: builds and loads with no complaints.

VS-VM: throws a list of errors which state than none of the literals can be converted to the types nominated.

jGrasp: does not recognize either byte or unit8_t as C++ types, and goes no further.

Which do I believe? Undecided
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: I get different results from the same compiler
Reply #1 - Mar 7th, 2017 at 8:05am
Print Post  
Hi,

Can I see verbose output from arduino and from visual micro please.

This will show us which tool chains are being found, which hardware is being compiled and which files.

nb: If you have .ino code that is passing a user type created in an .ino then you will need to add a prototype between creation of the type and the use of it (might or might not apply to your code).

Thanks
« Last Edit: Mar 7th, 2017 at 8:07am by Tim@Visual Micro »  
Back to top
IP Logged
 
rick_duley
Junior Member
**
Offline


Posts: 49
Location: Western Australia
Joined: Jan 8th, 2017
Re: I get different results from the same compiler
Reply #2 - Mar 8th, 2017 at 5:22am
Print Post  
Herewith.

Had trouble trying to post then directly so they are attached as a text file.

Thanks
  

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: I get different results from the same compiler
Reply #3 - Mar 8th, 2017 at 10:52am
Print Post  
The Visual Micro result shows your code uses a couple of libraries

The Arduino result shows your code does not use any libraries.

You need to run this test using the same code or are the RF24-master and SPI libs not supposed to be found?
« Last Edit: Mar 8th, 2017 at 10:53am by Tim@Visual Micro »  
Back to top
IP Logged
 
rick_duley
Junior Member
**
Offline


Posts: 49
Location: Western Australia
Joined: Jan 8th, 2017
Re: I get different results from the same compiler
Reply #4 - Mar 9th, 2017 at 1:50am
Print Post  
Sorry 'bout that.  Sad
Does this make more sense?
  

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: I get different results from the same compiler
Reply #5 - Mar 9th, 2017 at 2:17am
Print Post  
The arduino ide outputs a program size of 444 bytes

The only way that can happen is if there isn't any code.

  
Back to top
IP Logged
 
rick_duley
Junior Member
**
Offline


Posts: 49
Location: Western Australia
Joined: Jan 8th, 2017
Re: I get different results from the same compiler
Reply #6 - Mar 10th, 2017 at 8:14am
Print Post  
Mea Culpa.

  

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: I get different results from the same compiler
Reply #7 - Mar 10th, 2017 at 5:30pm
Print Post  
I am having a problem seeing what problem you are reporting. You can see below extracts from the outputs you posted. Using identical tools and libraries resulting in identical output file and memory use size.

Is it possible your original report was confused by the fact you were comping an empty project in the Arduino IDE or am I missing the point?

Thanks

Arduino Uno

Visual Micro Output
Code
Select All
Program masterBackChat size: 10,490 bytes (used 33% of a 32,256 byte maximum) (1.30 secs)
Minimum Memory Usage: 1405 bytes (69% of a 2048 byte maximum)

Using library RF24-master version 1.2.0 in folder D:\Documents\Arduino\libraries\RF24-master
Using library SPI version 1.0 in folder C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI

Tools Path: C:\Program Files (x86)\Arduino\hardware\tools\avr/bin
 




Arduino IDE Output
Code
Select All
Sketch uses 10,490 bytes (32%) of program storage space. Maximum is 32,256 bytes.
Global variables use 1,405 bytes (68%) of dynamic memory, leaving 643 bytes for local variables. Maximum is 2,048 bytes.

Using library RF24-master at version 1.2.0 in folder: D:\Documents\Arduino\libraries\RF24-master
Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI

Tools Path: C:\Program Files (x86)\Arduino\hardware\tools\avr/bin 

« Last Edit: Mar 10th, 2017 at 5:31pm by Tim@Visual Micro »  
Back to top
IP Logged
 
rick_duley
Junior Member
**
Offline


Posts: 49
Location: Western Australia
Joined: Jan 8th, 2017
Re: I get different results from the same compiler
Reply #8 - Mar 11th, 2017 at 2:47am
Print Post  
Tim@Visual Micro wrote on Mar 10th, 2017 at 5:30pm:

Is it possible your original report was confused by the fact you were comping an empty project in the Arduino IDE or am I missing the point?


I do not know what the files I (finally) got to you tell you.  I am not that much a savant.  I refer to the original posting:
To my amazement: 
Arduino IDE: builds and loads with no complaints.

VS-VM: throws a list of errors which state than none of the literals can be converted to the types nominated.

jGrasp: does not recognize either byte or unit8_t as C++ types, and goes no further.

Which do I believe?


The errors VS/VM threw were specific to this code:
Code (C++)
Select All
byte slaveAddresses[6][6] =
{ "0Node", "1Node", "2Node", "3Node", "4Node", "5Node" };

const byte rAddress[] = "0Node" "1Node" "2Node" "3Node" "4Node" "5Node";

uint8_t SLAVE_0[] = { "0Node" };
uint8_t SLAVE_1[] = { "1Node" };
uint8_t SLAVE_2[] = { "2Node" };
uint8_t SLAVE_3[] = { "3Node" };
uint8_t SLAVE_4[] = { "4Node" };
uint8_t SLAVE_5[] = { "5Node" };  



The Arduino IDE did not raise errors.  That was the original puzzle.  Undecided

How can it be that the Arduino IDE was happy with the types and the VS/VM IDE was not?  Huh


  
Back to top
 
IP Logged
 
rick_duley
Junior Member
**
Offline


Posts: 49
Location: Western Australia
Joined: Jan 8th, 2017
Re: I get different results from the same compiler
Reply #9 - Mar 11th, 2017 at 3:56am
Print Post  
You're not going to believe this one!  Shocked

The program I am working on at the moment (in VS/VM) has the function call
setWorking(nodeAddresses[1]);

It builds and uploads to the Arduino PCB with no problem.  My problem is that there is no function setWorking()  either forward declared or implemented in the program.

To make matters worse, all was functioning apparently normally with this code
Code (C++)
Select All
	if (debug)
	{
		Serial.print("Handshake message starts as ");
		Serial.println(handshakeData);
		Serial.println();
	}  // end if 


without the booloan variable debug  being declared.

The build outputs are too big to include so I have attached them.
  

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: I get different results from the same compiler
Reply #10 - Mar 11th, 2017 at 9:16pm
Print Post  
I assume you are saying that your first report now appears to be resolved and the project now compiles correctly?
  
Back to top
IP Logged
 
rick_duley
Junior Member
**
Offline


Posts: 49
Location: Western Australia
Joined: Jan 8th, 2017
Re: I get different results from the same compiler
Reply #11 - Mar 11th, 2017 at 10:47pm
Print Post  
Quite the contrary!

Nothing compiles correctly!

How can an IDE build and upload  a function that hasn't yet been written?  Shocked
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: I get different results from the same compiler
Reply #12 - Mar 17th, 2017 at 5:18pm
Print Post  
Okay did you click Solution>Clean to ensure nothing is remaining from previously deleted source code? Maybe that is the issue.

Otherwise it can only be that Visual Micro is finding additional source code to the Arduino IDE. The only way that can happen is if the source code has been tagged/included into the Visual Studio project. This is the area that can differ between Visual Micro and Arduino because it is under user control.

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