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) Don't understand these compiler errors (Read 7758 times)
Jan Friberg
Junior Member
**
Offline


Posts: 72
Joined: Dec 13th, 2013
Don't understand these compiler errors
Sep 10th, 2016 at 9:40pm
Print Post  
Using Visual Studio I get this error messages

Compiling debug version of 'WeatherDisplay' for 'Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)'
 
Compiling 'WeatherDisplay' for 'Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)'
 
WeatherDisplay.ino: 11:18: fatal error: user.h: No such file or directory
   #include "user.h"
   compilation terminated

Makes no sense to me because the file user.h is checked to indeed be in the same folder as the sketch
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Don't understand these compiler errors
Reply #1 - Sep 10th, 2016 at 10:02pm
Print Post  
If the .h actually included in the Visual Studio project?
  
Back to top
WWW  
IP Logged
 
Jan Friberg
Junior Member
**
Offline


Posts: 72
Joined: Dec 13th, 2013
Re: Don't understand these compiler errors
Reply #2 - Sep 10th, 2016 at 11:39pm
Print Post  
Tim@Visual Micro wrote on Sep 10th, 2016 at 10:02pm:
If the .h actually included in the Visual Studio project?


Yes here is part of my code where it seen included in the last line

Code (C++)
Select All
//Weather station V1.4
#include <TimeLib.h>
#include <Time.h>
#include <EEPROM.h>
#include <string.h>
#include <memorysaver.h>
#include <Wire.h>
#include <SdVolume.h>
#include <SdStream.h>
#include <SdInfo.h>
#include <SdFile.h>
#include <SdFatUtil.h>
#include <SdFatStructs.h>
#include <SdFatmainpage.h>
#include <SdFatConfig.h>
#include <SdFat.h>
#include <SdBaseFile.h>
#include <Sd2Card.h>
#include <ostream.h>
#include <MinimumSerial.h>
#include <istream.h>
#include <iostream.h>
#include <ios.h>
#include <bufstream.h>
#include <ArduinoStream.h>
#include <OneWire.h>
#include <UTFT.h>
#include <UTouch.h>
#include <DS1307RTC.h>
#include "user.h"

 


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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Don't understand these compiler errors
Reply #3 - Sep 11th, 2016 at 12:22pm
Print Post  
I meant is the .h actually included in the visual studio project (right click solution explorer include/exclude)

To save us some time it might be easier if you zip and email your project folder so I can look at your setup.

Thanks

  
Back to top
WWW  
IP Logged
 
Jan Friberg
Junior Member
**
Offline


Posts: 72
Joined: Dec 13th, 2013
Re: Don't understand these compiler errors
Reply #4 - Sep 11th, 2016 at 2:24pm
Print Post  
Tim@Visual Micro wrote on Sep 11th, 2016 at 12:22pm:
I meant is the .h actually included in the visual studio project (right click solution explorer include/exclude)

To save us some time it might be easier if you zip and email your project folder so I can look at your setup.

Thanks



Not sure what you mean. Right clicking solution explorer does not show any include/exclude item. Do you mean the .h file should be listed under headers in the solution explorer. Tried adding it there and it didn't work. Other compiler errors.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Don't understand these compiler errors
Reply #5 - Sep 11th, 2016 at 4:08pm
Print Post  
Hi,

The Visual Studio Solution Explorer has two modes. One where it shows all files on disk and the physical structure of the folders. The other shows a filtered view of virtual folders such as "Source", "Headers" etc.

Click the "project" in the solution explorer then you should see a small icon above the explorer called "Show all files". The button is a checkbox button that can be on or off.

A screen shot of the solution explorer with you right clicking the file would be useful. 

email address is info[at]visualmicro.com
« Last Edit: Sep 11th, 2016 at 4:09pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Jan Friberg
Junior Member
**
Offline


Posts: 72
Joined: Dec 13th, 2013
Re: Don't understand these compiler errors
Reply #6 - Sep 11th, 2016 at 5:42pm
Print Post  
Tim@Visual Micro wrote on Sep 11th, 2016 at 4:08pm:
Hi,

The Visual Studio Solution Explorer has two modes. One where it shows all files on disk and the physical structure of the folders. The other shows a filtered view of virtual folders such as "Source", "Headers" etc.

Click the "project" in the solution explorer then you should see a small icon above the explorer called "Show all files". The button is a checkbox button that can be on or off.

A screen shot of the solution explorer with you right clicking the file would be useful. 

email address is info[at]visualmicro.com


Screenshot mailed
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Don't understand these compiler errors
Reply #7 - Sep 11th, 2016 at 9:17pm
Print Post  
thanks. please zip and email the project so I can try it.
  
Back to top
WWW  
IP Logged
 
Jan Friberg
Junior Member
**
Offline


Posts: 72
Joined: Dec 13th, 2013
Re: Don't understand these compiler errors
Reply #8 - Sep 11th, 2016 at 9:22pm
Print Post  
Tim@Visual Micro wrote on Sep 11th, 2016 at 9:17pm:
thanks. please zip and email the project so I can try it.


Have done so now.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Don't understand these compiler errors
Reply #9 - Sep 11th, 2016 at 10:08pm
Print Post  
Thanks. It did not have #include  "user.h" in the code but I added it and got compile errors related to the user.h so it was found okay.

I assume you are on the most recent version of visual micro 1609.9? 

Please switch on the "verbose" and "show build properties" then build and email the output as .txt

Thanks
« Last Edit: Sep 11th, 2016 at 10:09pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Jan Friberg
Junior Member
**
Offline


Posts: 72
Joined: Dec 13th, 2013
Re: Don't understand these compiler errors
Reply #10 - Sep 12th, 2016 at 7:09pm
Print Post  
Tim@Visual Micro wrote on Sep 11th, 2016 at 10:08pm:
Thanks. It did not have #include  "user.h" in the code but I added it and got compile errors related to the user.h so it was found okay.

I assume you are on the most recent version of visual micro 1609.9? 

Please switch on the "verbose" and "show build properties" then build and email the output as .txt

Thanks


I first tried removing include user.h and forgot to put it back
I also assume I use the latest visual micro since I don't get any notification about available update and have recently made an upgrade. But I don't see how I can see which version I have.
I have mailed the output as requested
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Don't understand these compiler errors
Reply #11 - Sep 12th, 2016 at 7:19pm
Print Post  
Okay well you reported the user.h wasn't being found. Maybe that was a cashing issues that was resolved after update or vm or restart of ide.

The compile errors in the output you sent show the user.h is being discovered correctly.

Code
Select All
WeatherDisplay.ino: 32:14: error: redefinition of 'tmElements_t tm
   tmElements_t tm

WeatherDisplay.ino:10: In file included from
user.h:10: note  tmElements_t tm previously declared here
   tmElements_t tm;        \\Declare tmElements object to store time & date from DS3231

WeatherDisplay.ino: 34:7: error: redefinition of 'float T_outmax
   float T_outmax, T_outmin, T_inmax, T_inmin

WeatherDisplay.ino:10: In file included from
user.h:12: note  float T_outmax previously declared here
   float T_outmax,T_outmin,T_inmax,T_inmin

WeatherDisplay.ino: 34:17: error: redefinition of 'float T_outmin
   float T_outmax, T_outmin, T_inmax, T_inmin

WeatherDisplay.ino:10: In file included from
user.h:12: note  float T_outmin previously declared here
   float T_outmax,T_outmin,T_inmax,T_inmin

WeatherDisplay.ino: 34:27: error: redefinition of 'float T_inmax
   float T_outmax, T_outmin, T_inmax, T_inmin

WeatherDisplay.ino:10: In file included from
user.h:12: note  float T_inmax previously declared here
   float T_outmax,T_outmin,T_inmax,T_inmin

WeatherDisplay.ino: 34:36: error: redefinition of 'float T_inmin
   float T_outmax, T_outmin, T_inmax, T_inmin

WeatherDisplay.ino:10: In file included from
user.h:12: note  float T_inmin previously declared here
   float T_outmax,T_outmin,T_inmax,T_inmin

WeatherDisplay.ino: In function boolean Write2RTCAlarmMemory()

WeatherDisplay.ino: 465:24: error: 'DS1307_CTRL_ID' was not declared in this scope
   Wire.beginTransmission(DS1307_CTRL_ID)

WeatherDisplay.ino: In function boolean ReadRTCAlarmMemory()

WeatherDisplay.ino: 482:24: error: 'DS1307_CTRL_ID' was not declared in this scope
   Wire.beginTransmission(DS1307_CTRL_ID)
Error compiling project sources
 

  
Back to top
WWW  
IP Logged
 
Jan Friberg
Junior Member
**
Offline


Posts: 72
Joined: Dec 13th, 2013
Re: Don't understand these compiler errors
Reply #12 - Sep 12th, 2016 at 8:45pm
Print Post  
Now I don't understand why I get these compiler errors

Compiling debug version of 'WeatherDisplay' for 'Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)'
 
ccu2B6Ag.ltrans1.ltrans.o*: In function DisplayHeaders()
ccu2B6Ag.ltrans1.o*: (.text+0x540): undefined reference to SevenSegmentFull
ccu2B6Ag.ltrans1.o*: (.text+0x542): undefined reference to SevenSegmentFull
 
ccu2B6Ag.ltrans1.ltrans.o*: In function loop
ccu2B6Ag.ltrans1.o*: (.text+0xc3c): undefined reference to SevenSegmentFull
ccu2B6Ag.ltrans1.o*: (.text+0xc3e): undefined reference to SevenSegmentFull
ccu2B6Ag.ltrans1.o*: (.text+0xfd6): undefined reference to SevenSegmentFull
ccu2B6Ag.ltrans1.ltrans.o*: ccu2B6Ag.ltrans1.o:(.text+0xfd8): more undefined references to SevenSegmentFull follow
 
collect2.exe*: error: ld returned 1 exit status

Error compiling for board Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Don't understand these compiler errors
Reply #13 - Sep 12th, 2016 at 9:45pm
Print Post  
Do you get a problem in arduino ide?
  
Back to top
WWW  
IP Logged
 
Jan Friberg
Junior Member
**
Offline


Posts: 72
Joined: Dec 13th, 2013
Re: Don't understand these compiler errors
Reply #14 - Sep 13th, 2016 at 4:16pm
Print Post  
Tim@Visual Micro wrote on Sep 12th, 2016 at 9:45pm:
Do you get a problem in arduino ide?


Yes but not the same error messages but instead this

Arduino: 1.6.11 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino: In function 'void DisplayTime()':

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino:146:25: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

   myGLCD.print(":",64,19);

                         ^

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino: In function 'void DisplayTemp(char*, char)':

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino:194:39: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

    {blank=32;myGLCD.print(" ",LEFT,184);}

                                       ^

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino:199:34: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

    myGLCD.print(" ",LEFT+4*32,184);

                                  ^

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino:206:32: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

    myGLCD.print("  Max",146,169);

                                ^

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino:207:30: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

    myGLCD.print("   ",162,184);

                              ^

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino:212:34: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

    myGLCD.print("Max    ",144,169);

                                  ^

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino:213:55: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

    myGLCD.print("    ",172+(8*(strlen(tempstr))-1),184);

                                                       ^

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino:215:31: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

    myGLCD.print("    ",204,184);

                               ^

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino:222:35: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

    myGLCD.print(" Min    ",162,201);

                                   ^

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino:223:28: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

    myGLCD.print(" ",162,216);

                            ^

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino:228:33: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

    myGLCD.print("Min   ",144,201);

                                 ^

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino:229:55: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

    myGLCD.print("    ",172+(8*(strlen(tempstr))-1),216);

                                                       ^

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino:248:41: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

   myGLCD.print("Error header",CENTER,222);

                                         ^

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino: In function 'void DisplayHeaders()':

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino:256:31: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

  myGLCD.print("Klockan",LEFT,1);

                               ^

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino:257:40: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

  myGLCD.print("Termometrar (C)",LEFT,71);

                                        ^

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino:258:33: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

  myGLCD.print("Utomhus",LEFT,169);

                                 ^

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino:259:35: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

  myGLCD.print("Hygrometer",RIGHT,1);

                                   ^

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino:260:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

  myGLCD.print("%",RIGHT,51);

                           ^

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino:261:32: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

  myGLCD.print("Inomhus",LEFT,93);

                                ^

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino:262:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

  myGLCD.print("Max",144,95);

                           ^

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino:263:28: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

  myGLCD.print("Min",144,127);

                            ^

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino:264:31: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

  myGLCD.print("Baromet",206,95);

                               ^

C:\Users\Jan Work\Documents\Arduino\WeatherDisplay\WeatherDisplay.ino:265:31: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

  myGLCD.print("(mmHg)",214,111);

                               ^

C:\Users\JANWOR~1\AppData\Local\Temp\ccXy8rOY.ltrans1.ltrans.o: In function `DisplayHeaders()':

ccXy8rOY.ltrans1.o:(.text+0x540): undefined reference to `SevenSegmentFull'

ccXy8rOY.ltrans1.o:(.text+0x542): undefined reference to `SevenSegmentFull'

C:\Users\JANWOR~1\AppData\Local\Temp\ccXy8rOY.ltrans1.ltrans.o: In function `loop':

ccXy8rOY.ltrans1.o:(.text+0xc3c): undefined reference to `SevenSegmentFull'

ccXy8rOY.ltrans1.o:(.text+0xc3e): undefined reference to `SevenSegmentFull'

ccXy8rOY.ltrans1.o:(.text+0xfd6): undefined reference to `SevenSegmentFull'

o:(.text+0xfd8): more undefined references to `SevenSegmentFull' follow

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.
Library is already installed: Time version 1.5.0

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Don't understand these compiler errors
Reply #15 - Sep 13th, 2016 at 5:53pm
Print Post  
Same error

If you switch on the visual micro warnings you will also see the warnings you see in the arduino ide.

However the error is the same just spaced out more in arduino

Here is the error shown in the arduino ide report you have posted

Code
Select All
C:\Users\JANWOR~1\AppData\Local\Temp\ccXy8rOY.ltrans1.ltrans.o: In function `DisplayHeaders()':
ccXy8rOY.ltrans1.o:(.text+0x540): undefined reference to `SevenSegmentFull'
ccXy8rOY.ltrans1.o:(.text+0x542): undefined reference to `SevenSegmentFull'
C:\Users\JANWOR~1\AppData\Local\Temp\ccXy8rOY.ltrans1.ltrans.o: In function `loop':
ccXy8rOY.ltrans1.o:(.text+0xc3c): undefined reference to `SevenSegmentFull'
ccXy8rOY.ltrans1.o:(.text+0xc3e): undefined reference to `SevenSegmentFull'
ccXy8rOY.ltrans1.o:(.text+0xfd6): undefined reference to `SevenSegmentFull'

o:(.text+0xfd8): more undefined references to `SevenSegmentFull' follow

collect2.exe: error: ld returned 1 exit status 




and this is what you posted earlier from visual micro

Code
Select All
ccu2B6Ag.ltrans1.ltrans.o*: In function DisplayHeaders()
ccu2B6Ag.ltrans1.o*: (.text+0x540): undefined reference to SevenSegmentFull
ccu2B6Ag.ltrans1.o*: (.text+0x542): undefined reference to SevenSegmentFull
ccu2B6Ag.ltrans1.ltrans.o*: In function loop
ccu2B6Ag.ltrans1.o*: (.text+0xc3c): undefined reference to SevenSegmentFull
ccu2B6Ag.ltrans1.o*: (.text+0xc3e): undefined reference to SevenSegmentFull
ccu2B6Ag.ltrans1.o*: (.text+0xfd6): undefined reference to SevenSegmentFull
ccu2B6Ag.ltrans1.ltrans.o*: ccu2B6Ag.ltrans1.o:(.text+0xfd8): more undefined references to SevenSegmentFull follow

collect2.exe*: error: ld returned 1 exit status 



Looks like the error is

Code
Select All
 undefined reference to SevenSegmentFul 



« Last Edit: Sep 13th, 2016 at 5:54pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Jan Friberg
Junior Member
**
Offline


Posts: 72
Joined: Dec 13th, 2013
Re: Don't understand these compiler errors
Reply #16 - Sep 13th, 2016 at 6:23pm
Print Post  
Tim@Visual Micro wrote on Sep 13th, 2016 at 5:53pm:
Looks like the error is

Code:

undefined reference to SevenSegmentFul 




And I certainly don't understand why this is an error. In my user.h I have
Code (C++)
Select All
extern			uint8_t SevenSegmentFull[];
 



So why should this be undefined ? Also this code has compiled and worked before
(in my error list I see SevenSegmentFull and not SevenSegmentFul as cited above)
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Don't understand these compiler errors
Reply #17 - Sep 13th, 2016 at 6:37pm
Print Post  
Hi,

Sorry but I don't know your code or what has happened to it since it worked.

It's a standard arduino compiler error so should find solution or help in code forum.

Thanks
  
Back to top
WWW  
IP Logged
 
Jan Friberg
Junior Member
**
Offline


Posts: 72
Joined: Dec 13th, 2013
Re: Don't understand these compiler errors
Reply #18 - Sep 14th, 2016 at 5:53pm
Print Post  
Tim@Visual Micro wrote on Sep 11th, 2016 at 12:22pm:
I meant is the .h actually included in the visual studio project (right click solution explorer include/exclude)

To save us some time it might be easier if you zip and email your project folder so I can look at your setup.

Thanks



Problem with user.h not found is back in another project. I see user.h listed in the solution explorer. I have zipped and mailed it.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Don't understand these compiler errors
Reply #19 - Sep 14th, 2016 at 6:17pm
Print Post  
Hi,

There wasn't an attachment with the email you sent.

Can you confirm the issue exists if you restart the ide?

Also please confirm the visual micro version from tools>extensions and updates

Thanks
  
Back to top
WWW  
IP Logged
 
Jan Friberg
Junior Member
**
Offline


Posts: 72
Joined: Dec 13th, 2013
Re: Don't understand these compiler errors
Reply #20 - Sep 14th, 2016 at 6:31pm
Print Post  
Tim@Visual Micro wrote on Sep 14th, 2016 at 6:17pm:
Hi,

There wasn't an attachment with the email you sent.

Can you confirm the issue exists if you restart the ide?

Also please confirm the visual micro version from tools>extensions and updates

Thanks


Mistake of me but now the attachment is mailed

same issue after I restarted the ide

have version 1609.10.0
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Don't understand these compiler errors
Reply #21 - Sep 14th, 2016 at 7:11pm
Print Post  
Hi,

The user.h is not include in the project.

1)
I previously explained about the show all files button above the solution explorer and that it shows two different views. 1) the files on disk and 2) a filtered view of the project that shows only the files that have been included.

The word "included" has nothing to do with #include statements in the code. It relates to the standard visual studio features that allows some sources to be "included" in the build and some to be "excluded" from builds.

Right clicking files should show a standard visual micro menu with option to either "Include in project" or "exclude from project"

You didn't comment previously when I mentioned this so can we please be sure you understand what I have said and understand how to Include and Exclude files from a Visual Studio C++ project.

2)
Although it is important for your own piece of mind to clearly understand point 1) there are some safeguards for less experienced VS users that should be helping you. One would automatically include all files in the project folder into a project each time it opens. That obviously isn't working for you so please confirm the following two tools>options>visual micro settings are set to True (the default)

  • Compatibility>Compile ALL Project Folder Sources
  • Compatibility>Compile Files In Project


Thanks
« Last Edit: Sep 14th, 2016 at 7:12pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Jan Friberg
Junior Member
**
Offline


Posts: 72
Joined: Dec 13th, 2013
Re: Don't understand these compiler errors
Reply #22 - Sep 14th, 2016 at 7:53pm
Print Post  
Tim@Visual Micro wrote on Sep 14th, 2016 at 7:11pm:
Hi,

The user.h is not include in the project.

1)
I previously explained about the show all files button above the solution explorer and that it shows two different views. 1) the files on disk and 2) a filtered view of the project that shows only the files that have been included.

The word "included" has nothing to do with #include statements in the code. It relates to the standard visual studio features that allows some sources to be "included" in the build and some to be "excluded" from builds.

Right clicking files should show a standard visual micro menu with option to either "Include in project" or "exclude from project"

You didn't comment previously when I mentioned this so can we please be sure you understand what I have said and understand how to Include and Exclude files from a Visual Studio C++ project.

2)
Although it is important for your own piece of mind to clearly understand point 1) there are some safeguards for less experienced VS users that should be helping you. One would automatically include all files in the project folder into a project each time it opens. That obviously isn't working for you so please confirm the following two tools>options>visual micro settings are set to True (the default)

  • Compatibility>Compile ALL Project Folder Sources
  • Compatibility>Compile Files In Project


Thanks


No I'm not sure this is clear to me. Why is not the #include statement sufficient like it seem to be for all the other #include statements. According to the standard C/C++ I think it should. The two settings you mention is set to true.
After right clicking user.h and selecting include in project there are indeed no error message about user.h not existing. But instead I get this output

Compiling debug version of 'TestPrecRTCClock' for 'Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)'
 
ccTTlKCM.ltrans0.ltrans.o*: In function main
ccTTlKCM.ltrans0.o*: (.text.startup+0x2fce): undefined reference to SevenSegmentFull
ccTTlKCM.ltrans0.o*: (.text.startup+0x2fd0): undefined reference to SevenSegmentFull
ccTTlKCM.ltrans0.o*: (.text.startup+0x3242): undefined reference to SevenSegmentFull
ccTTlKCM.ltrans0.o*: (.text.startup+0x3244): undefined reference to SevenSegmentFull
 
collect2.exe*: error: ld returned 1 exit status

Error compiling for board Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Don't understand these compiler errors
Reply #23 - Sep 14th, 2016 at 8:21pm
Print Post  
Quote:
Why is not the #include statement sufficient like it seem to be for all the other #include statements. According to the standard C/C++ I think it should.


It's a good question.

Normally an, such as Eclipse and Visual Studio, ide will compile only what is included in the project.

Normally for .h files this doesn't matter so much because they don't need to be compiled, simply available as #includes.

Normally we can #include headers from anywhere such as "..\..\foo\foo.h"

BUT

For Arduino all the .ino files have to be combined into a .cpp and some extra code added. So for Arduino the build always happens in a temp folder, can't happen where the sources are actually located. This is foreign for most ide's so we are in new territory.

Consider now that if we copy the sources to a temp folder and attempt to find "..\..\foo\foo.h" it becomes a problem.

I think Visual Micro could help by automatically copying all files from the project folder to the temp folder. However things would become less consistent because if users see one file that is not "Included" in the project being found they will wonder why others can't be found.

So currently the rule is, include files in the project and they will be found and copied to the temp build folder. 

I am trying to give options to move away from this constraint. You see in the last release that a project_name.cpp is supported instead of .ino files. In that case Visual Micro will use the local project folder sources in the build and the header would have been found regardless of it's inclusion in the project.

However don't rush to use a .cpp only system without understanding the following rules:-

1) A project_name.ino must still be included in the project but it can be empty and is ignored except to show which headers should be included after clicking "add library"
2) You are responsible for adding #include "arduino.h" to the project_name.cpp 
3) You are responsible for creating function prototypes in the project_name.cpp or a header file.

tip: The build folder will provide a ready-made .cpp with your .ino files, prototypes etc. as an example to get going with.

As you can imagine. By removing ourselves from the .ino files and temp build folder we can start to work like a normal .cpp project however the new facility can not impact support. It is up to users to understand what is happening and to decide this is how they want to work.

Hope that helps.

Finally the error you publish is exactly the same as the error we discussed previously in this thread and the same error you get in the arduino ide. So it is a code problem.
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: [1] 
Send TopicPrint