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 Names conflict causes linking crash (Read 1655 times)
Kabron
Full Member
***
Offline


Posts: 170
Joined: Nov 1st, 2015
Names conflict causes linking crash
Jun 9th, 2019 at 8:02am
Print Post  
Attached sample project. When name of .ino file(MAX30100.ino) matches with included MAX30100.cpp linking stage outputs the following errors:
Code
Select All
core.a(main.cpp.o)*: (.literal._Z8loopTaskPv+0x4): undefined reference to setup()
core.a(main.cpp.o)*: (.literal._Z8loopTaskPv+0x8): undefined reference to loop()

Error linking for board M5Stack-Core-ESP32

core.a(main.cpp.o)*: In function loopTask(void*)
main.cpp:20: undefined reference to setup()
Debug build failed for project 'MAX30100'
main.cpp:23: undefined reference to loop()

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



Arduino IDE does not output any errors. 
Renaming .ino file to any different solves the problem.
But it is a definite BUG.
  

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Names conflict causes linking crash
Reply #1 - Jun 9th, 2019 at 10:43am
Print Post  
Hi,

In the Arduino IDE the override file name is sketch_name.ino.cpp and in Visual Micro is is project_name.cpp. The override cancels the .ino files. We are looking at changing to same as arduino.
  
Back to top
WWW  
IP Logged
 
Kabron
Full Member
***
Offline


Posts: 170
Joined: Nov 1st, 2015
Re: Names conflict causes linking crash
Reply #2 - Jun 9th, 2019 at 11:17am
Print Post  
Thanks, Tim
It took a time to find WTF.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Names conflict causes linking crash
Reply #3 - Jun 9th, 2019 at 11:28am
Print Post  
Thanks for the report, it's a tricky one. If you look towards the end of the verbose compiler output you will see that the file that is compiled, is temp folder/project_name.cpp. It's not possible to compile .ino files so they are combined into a .cpp in the temp folder. It is this process that causes conflict with using the project_name.cpp.

If you hit a problem in future feel free to post early but include the output requested at the top of the forum. It shows how we can see what is happening and solve any issues so it's useful.
« Last Edit: Jun 9th, 2019 at 11:30am by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint