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) ESP8266 Compile Problem (Read 13999 times)
n
Junior Member
**
Offline


Posts: 52
Joined: Mar 29th, 2016
ESP8266 Compile Problem
Mar 29th, 2016 at 9:28pm
Print Post  
I am using Arduino 1.6.5 with ESP8266 Core 2.1.0 installed.

When I start VS2015 with VM plugin installed and create a new empty project it compiles OK using the Generic ESP8266 board. 

However, the Board Manager is apparently using the ESP8266 Core2.0 and I require 2.1 for my future project. When I use the Board Manager to update ESP8266 to 2.1.0 then empty basic project no longer compiles. The output is as follows:

Compiling 'test' for 'Generic ESP8266 Module'
Build folder: file:///C:/Users/Neil/AppData/Local/Temp/VMicroBuilds/test/esp8266_generic
Summary: Header=1 Prototypes=3 Imports=0
Additional Defines: 
Architecture Tools: c\1.20.0-26-gb404fb9-2/bin/
Sketchbook: file:\\\D:\My%20Documents\Arduino
Sketch Include Paths
Include Path 'D:\My Documents\Arduino\test'
Core Include Paths
Include Path ores\esp8266'
Include Path ariants\generic'
Build Core Paths: res\esp8266
cc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-gcc" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ /tools/sdk/include" -c -g -x assembler-with-cpp -MMD -DF_CPU=80000000L -DARDUINO=10605 -DARDUINO_ESP8266_ESP01 -DARDUINO_ARCH_ESP8266 -DESP8266 \cores\esp8266" \variants\generic" ores\esp8266\cont.S" -o o"  
The system cannot find the file specified
     Process: cc\1.20.0-26-gb404fb9-2\bin\xtensa-lx106-elf-gcc" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ /tools/sdk/include" -c -g -x assembler-with-cpp -MMD -DF_CPU=80000000L -DARDUINO=10605 -DARDUINO_ESP8266_ESP01 -DARDUINO_ARCH_ESP8266 -DESP8266 \cores\esp8266" \variants\generic" ores\esp8266\cont.S" -o o"  
Error compiling core


It seems that the upgrade from core 2.0.0 to 2.1.0 lost some files along the way. Can you please let me know how to find them again?

Thanks

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


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ESP8266 Compile Problem
Reply #1 - Mar 29th, 2016 at 10:36pm
Print Post  
Hi,

Some diagnostics to show where the issue is...

Please delete or rename this folder C:\Users\Neil\AppData\Local\arduino15\package

Then use the Arduino Ide board manager to install your prefered esp8266 core

Then test the compile in the arduino ide to ensure it works before testing in visual micro.
  
Back to top
IP Logged
 
n
Junior Member
**
Offline


Posts: 52
Joined: Mar 29th, 2016
Re: ESP8266 Compile Problem
Reply #2 - Mar 30th, 2016 at 3:00am
Print Post  
Hi,

Thanks for the quick reply.

I deleted the folder C:\Users\Neil\AppData\Local\arduino15\packages (note the s on packages) as requested.

I started the Arduino IDE and found that the ESP8266 Core 2.1.0 was still installed and that my old project still compiled - I did not have to change anything.

I then started VS2015, opened a new blank project consisting simply of an empty setup and loop and found that the Generic ESP8266 board was no longer available. I then installed V2.1.0 of Generic ESP8266 using the 'Manage Boards' tab of VM Explorer and rescanned. I then selected Generic ESP8266 and tried to compile this empty project - this is what I got:

Compiling 'MyTest' for 'Generic ESP8266 Module'
Build folder: file:///C:/Users/Neil/AppData/Local/Temp/VMicroBuilds/MyTest/esp8266_generic
Summary: Header=1 Prototypes=3 Imports=0
Additional Defines: 
Architecture Tools: c\1.20.0-26-gb404fb9-2/bin/
Sketchbook: file:\\\D:\My%20Documents\Arduino
Sketch Include Paths
Include Path 'D:\My Documents\Arduino\MyTest'
Core Include Paths
Include Path ores\esp8266'
Include Path ariants\generic'
Build Core Paths: res\esp8266
cc\1.20.0-26-gb404fb9-2/bin/xtensa-lx106-elf-gcc" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ /tools/sdk/include" -c -g -x assembler-with-cpp -MMD -mlongcalls -DF_CPU=80000000L -DARDUINO=10605 -DARDUINO_ESP8266_ESP01 -DARDUINO_ARCH_ESP8266 -DESP8266 \cores\esp8266" \variants\generic" ores\esp8266\cont.S" -o S.o"  
The system cannot find the file specified
     Process: cc\1.20.0-26-gb404fb9-2\bin\xtensa-lx106-elf-gcc" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ /tools/sdk/include" -c -g -x assembler-with-cpp -MMD -mlongcalls -DF_CPU=80000000L -DARDUINO=10605 -DARDUINO_ESP8266_ESP01 -DARDUINO_ARCH_ESP8266 -DESP8266 \cores\esp8266" \variants\generic" ores\esp8266\cont.S" -o S.o"  
Error compiling core

I have no idea what is going on here!?

Thanks

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


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ESP8266 Compile Problem
Reply #3 - Mar 30th, 2016 at 10:55am
Print Post  
I think your visual micro install is out of date so worth updating via tools>extensions and updates

Please also switch on verbose in the arduino ide file>preferences. Then build and post the output.

Also delete the entire C:\Users\Neil\AppData\Local\arduino15 folder then restart vsiaul micro. I suspect that you installed an updated arduino ide then uninstalled and reverted to 1.6.5. If I recall 1.6.5 uses C:\Users\Neil\AppData\Roaming and not C:\Users\Neil\AppData\Local however Visual Micro will use Local if it exists and fallback to the older Roaming if it does not exist. This would probably explain why arduino was still happy after you deleted the local package folder.


Thanks
  
Back to top
IP Logged
 
n
Junior Member
**
Offline


Posts: 52
Joined: Mar 29th, 2016
Re: ESP8266 Compile Problem
Reply #4 - Mar 30th, 2016 at 10:27pm
Print Post  
Hi,

Thanks for the reply - you are quite right. I updated to Arduino 1.6.8 a few months ago but was beaten back to 1.6.5 by an avalanche of compile errors. Deleting C:\Users\Neil\AppData\Local\arduino15 in its entirety solved the problem.

Thanks

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


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ESP8266 Compile Problem
Reply #5 - Mar 30th, 2016 at 11:20pm
Print Post  
Thanks for the update.

I think this also means your visual micro is out of date because more recent versions look at the configured arduino ide version and use the correct location accordingly. It avoids the issue  Smiley
  
Back to top
IP Logged
 
n
Junior Member
**
Offline


Posts: 52
Joined: Mar 29th, 2016
Re: ESP8266 Compile Problem
Reply #6 - Mar 31st, 2016 at 4:21am
Print Post  
Hi Tim,

The VM version I have been playing with is 1.1603.20. I checked with your site this morning and I believe that is still the version offered. Is there a more recent one hidden somewhere?

Thanks

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


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ESP8266 Compile Problem
Reply #7 - Mar 31st, 2016 at 2:20pm
Print Post  
Thanks for the update. I wouldn't have expected the ussye in 1603.20 and will investigate.

Unimportant but where are you looking at version numbers? There have been two releases since the 20th March version you mention, but the change I referred to was made in January.
  
Back to top
IP Logged
 
n
Junior Member
**
Offline


Posts: 52
Joined: Mar 29th, 2016
Re: ESP8266 Compile Problem
Reply #8 - Mar 31st, 2016 at 7:41pm
Print Post  
I am looking in VS2015 Tools/Options/Visual Micro/General where it says Version 1.1603.20 Version Minor 0.

I downloaded that .vsix file just yesterday from your website - shouldn't that be the latest version?

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


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ESP8266 Compile Problem
Reply #9 - Mar 31st, 2016 at 7:51pm
Print Post  
Thanks. That's just an internal version. Tools,extensions and updates shows the release.

But any recent version should have got that right
  
Back to top
IP Logged
 
n
Junior Member
**
Offline


Posts: 52
Joined: Mar 29th, 2016
Re: ESP8266 Compile Problem
Reply #10 - Mar 31st, 2016 at 8:36pm
Print Post  
In Tools/extensions and updates I get a version number of 1603.28.0. A bit confusing?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ESP8266 Compile Problem
Reply #11 - Mar 31st, 2016 at 10:58pm
Print Post  
Yes the older tools>options system was used before the conversion from the Visual studio 2010 "add-in" to the current "extension" version. The tools>extensions &  updates system has it's own version number which is uses to notify new releases so the old system is being phased out.
  
Back to top
IP Logged
 
n
Junior Member
**
Offline


Posts: 52
Joined: Mar 29th, 2016
Re: ESP8266 Compile Problem
Reply #12 - Apr 1st, 2016 at 2:42am
Print Post  
Hi Tim,

Thanks - every thing is working well now. One little question.

The Arduino IDE gives a series of dots during upload to tell you that something is actually happening - can VM do something similar? It's a bit disconcerting waiting for 3 minutes or more not knowing if the upload is ongoing or not.

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


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ESP8266 Compile Problem
Reply #13 - Apr 1st, 2016 at 12:25pm
Print Post  
Hi,

Yes I noticed the dots missing last week. I will look into that. 

However if you see the uploading output then you can be sure that you will be notified if there is a problem.
  
Back to top
IP Logged
 
n
Junior Member
**
Offline


Posts: 52
Joined: Mar 29th, 2016
Re: ESP8266 Compile Problem
Reply #14 - Apr 6th, 2016 at 10:50pm
Print Post  
Hi Tim,

I am enjoying VM very much  - a big improvement over Arduino IDE. However I have another small query.

There are many cases in my project where VM underlines an error in red and yet the project still compiles and runs. 

As an example (Generic ESP8266 Module):

#include <ESP8266WiFi.h>
WiFiClient client;
client.print(........);

VM says that class "WiFiClient" has no member "print". Looking in ESP8266WiFi.h I think that VM is actually correct ( I can't see "print" either!) and yet Arduino still manages to compile it. 

Can you explain what is going on here please?

Thanks

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


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ESP8266 Compile Problem
Reply #15 - Apr 7th, 2016 at 4:32pm
Print Post  
The intellisense is provided via the Visual Studio C++ system. All we have to do (in theory) is point it to the source code locations.

If you press F12 or "Goto definition" on the print() statement I think you will be taken to the source code which proves Visual studio knows where to look.

So I am currently investigating why Visual studio objects to some of the inherited class design of the esp8266 core.
  
Back to top
IP Logged
 
n
Junior Member
**
Offline


Posts: 52
Joined: Mar 29th, 2016
Re: ESP8266 Compile Problem
Reply #16 - Apr 15th, 2016 at 9:45am
Print Post  
Hi Tim,

Hi Tim,

Related to my previous post about mixed messages from intellisense, I have another problem which I really don’t understand. 

I have a large, historical Arduino sketch built with .ino files. I am now trying to make this more modular and am trying to add a .cpp/.h file to the sketch. Is it possible to work with ino and cpp files in one sketch – I am certainly having problems!

A number of global structures are declared and defined in the master.ino file and I wish to access these structures from a function in my .cpp.

I have reduced the problem to the simplest sketch I can make. In my master.ino I have something like this:

Code (C++)
Select All

#include "Addon.h"
Struct aaSStruct
{
int aa1;
int aa2;
} aaInstance;

void setup()
{
	DoAddon();

  /* add setup code here */

}

void loop()
{

  /* add main program code here */

}
 



I have an Addon.cpp file containing the following

Code (C++)
Select All

#include "Addon.h"

void DoAddon()
{
	aaInstance.aa1 = 1;
}
 



And Addon.h containing the following:

Code (C++)
Select All

void DoAddon();						//Forward declaration - OK

struct aaStruct;                                          //Incomplete declaration - Works IN VS C++ project
extern aaStruct aaInstance;			//Forward declaration aaInstance
 



I have played with this for a couple of hours and the only way I can make it compile is to have a partial declaration of aaStruct in Addon.h and then a full declaration at the beginning of Addon.cpp. But then intellisense isn't happy at all. 

Can you give me some words of wisdom on how to get this tiny sketch compiled without the screen being full of red lines?

Do you have any guidelines on how to make ino files and cpp files play nicely together?

Thanks

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


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ESP8266 Compile Problem
Reply #17 - Apr 16th, 2016 at 2:54am
Print Post  
Yes is a problem for Arduino I see that fails in both vm and arduino ide.

These might be two different issues intellisense and compile problem.

You certainly have a valid compile error and that might prevent intellisense from refreshing so lets get the project compiling first...

I am not a c++ expert maybe stackoverflow or arduino.cc forum will produce a better answer.

The following did allow it to compile for me:-

I created a new header for the .ino and moved the struct(s) into it:-

Code
Select All
#pragma once

typedef struct
{
	int aa1;
	int aa2;
}aaSStruct;

static aaSStruct aaInstance;
 



Then added an #include for the new header in both the master.ino and addon.h/cpp.

Finally, removed the following code from addon.h :-

Code
Select All
struct aaStruct;                                          //Incomplete declaration - Works IN VS C++ project
extern aaStruct aaInstance;			//Forward declaration aaInstance
 



Then it compiled okay
« Last Edit: Apr 16th, 2016 at 4:50am by Tim@Visual Micro »  
Back to top
IP Logged
 
n
Junior Member
**
Offline


Posts: 52
Joined: Mar 29th, 2016
Re: ESP8266 Compile Problem
Reply #18 - Apr 16th, 2016 at 7:14am
Print Post  
Hi Tim,

Thank you for your help - that fixed it! The clue was declaring the structure as static!

I was originally hoping not to have to move the structs from the master.ino because I simply wanted to add some additional functionality rather than heave the whole thing around but this is easy enough to do.

To generalize all the above I think I now understand that: 

1) If you are using only .ino files in your sketch then all global variables/structs should be declared and defined in the master.ino.

2) If you want to include some .cpp files into the mix then all the global variables/structs should be declared and then defined static in an .h file which is included in the master.ino and the .cpp file"

That seems like a simple rule to follow. 

Thanks

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


Posts: 12138
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ESP8266 Compile Problem
Reply #19 - Apr 16th, 2016 at 12:25pm
Print Post  
Great thanks for the update.

How about intellisense errors?
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint