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 [2]  Send TopicPrint
Hot Topic (More than 8 Replies) Don't understand these compiler errors (Read 7803 times)
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 [2] 
Send TopicPrint