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
Normal Topic espurna compiles in Arduino IDE, but doesn't in Visual Micro (Read 2967 times)
azeth
Newbies
*
Offline


Posts: 3
Joined: Aug 29th, 2018
espurna compiles in Arduino IDE, but doesn't in Visual Micro
Aug 29th, 2018 at 12:40am
Print Post  
Hello. I have an issue compiling espurna project (https://github.com/xoseperez/espurna) with Visual Micro 1808.25 on generic esp8285, the compilation stops with:
Code
Select All
espurna.ino: 66:37: error: 'T' has not been declared
espurna.ino: 67:37: error: 'T' has not been declared
[... several messages like this follow ...]
 


The project consists of multiple .ino files which Visual Micro joins together into one file relying on generated function prototypes. I tracked down the issue to not supplying the right function prototypes with templates as in (settings.ino):
Code
Select All
template<typename T> bool setSetting(const String& key, T value); 


but instead in espurna.cpp generated by extension the code reads:
Code
Select All
bool setSetting(const String& key, T value); 


thereby causing many similar errors. Can you look into this issue and provide any solution?
« Last Edit: Aug 29th, 2018 at 12:49am by azeth »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: espurna compiles in Arduino IDE, but doesn't in Visual Micro
Reply #1 - Aug 29th, 2018 at 11:46am
Print Post  
Hi,

Yes prototypes are a discussion at the moment and will be implemented soon.

I don't know why vm is assuming bool. It uses simple regex so there must be a bool version in the code somehere

Normally you can just add the prototypes yourself somewhere before they are defined and before the code that uses them.

template<typename T> bool setSetting(const String& key, T value); 

Does this help?
  
Back to top
IP Logged
 
azeth
Newbies
*
Offline


Posts: 3
Joined: Aug 29th, 2018
Re: espurna compiles in Arduino IDE, but doesn't in Visual Micro
Reply #2 - Aug 29th, 2018 at 1:25pm
Print Post  
As I can see the project includes also all prototypes in one file called 'config/prototypes.h', so generating prototypes shouldn't be necessary for this project. But with the new version of the extension I can't see project properties anymore, which would help me disable prototype generating procedure in vm. Do you know how can I force VM to stop generating prototypes for me?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: espurna compiles in Arduino IDE, but doesn't in Visual Micro
Reply #3 - Aug 29th, 2018 at 1:51pm
Print Post  
I see. I will look into the properties issue later today

« Last Edit: Aug 29th, 2018 at 1:54pm by Tim@Visual Micro »  
Back to top
IP Logged
 
azeth
Newbies
*
Offline


Posts: 3
Joined: Aug 29th, 2018
Re: espurna compiles in Arduino IDE, but doesn't in Visual Micro
Reply #4 - Aug 29th, 2018 at 8:19pm
Print Post  
Thanks, I hope properties issue will be an easy fix Smiley
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: espurna compiles in Arduino IDE, but doesn't in Visual Micro
Reply #5 - Aug 29th, 2018 at 11:35pm
Print Post  
There is a new build in the gallery which I hope resolves the missing property tool window.

Thanks for the report.

  
Back to top
IP Logged
 
azeth
Newbies
*
Offline


Posts: 3
Joined: Aug 29th, 2018
Re: espurna compiles in Arduino IDE, but doesn't in Visual Micro
Reply #6 - Oct 30th, 2018 at 11:03pm
Print Post  
Hello, I am still experiencing this issue of not providing correct prototypes of functions, for example .cpp file generated from multiple .ino files reads:
bool setSetting(const String& key, T value); 
instead of:
template<typename T> bool setSetting(const String& key, T value); 

Arduino IDE compiles just fine, because it follows templates correctly. I believe the problem is that regex matching function prototypes into main.cpp file omits "template<typename T>" part completely.

Will templates in prototypes generation be supported anywhere close in the future? I really like Visual Micro, it's miles above Platformio Smiley
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: espurna compiles in Arduino IDE, but doesn't in Visual Micro
Reply #7 - Oct 31st, 2018 at 12:59pm
Print Post  
put templates in .h or .cpp files
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint