Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
Support requests without the output above may be impossible to answer, so please help us to help you
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Names conflict causes linking crash (Read 275 times)
Kabron
Junior Member
**
Offline



Posts: 95
Names conflict causes linking crash
Jun 9th, 2019 at 9:02am
 
Attached sample project. When name of .ino file(MAX30100.ino) matches with included MAX30100.cpp linking stage outputs the following errors:
Code:
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.
Back to top
 

MAX30100.ZIP (40 KB | 5 )
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10529
United Kingdom
Re: Names conflict causes linking crash
Reply #1 - Jun 9th, 2019 at 11:43am
 
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
Junior Member
**
Offline



Posts: 95
Re: Names conflict causes linking crash
Reply #2 - Jun 9th, 2019 at 12:17pm
 
Thanks, Tim
It took a time to find WTF.
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10529
United Kingdom
Re: Names conflict causes linking crash
Reply #3 - Jun 9th, 2019 at 12:28pm
 
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.
Back to top
« Last Edit: Jun 9th, 2019 at 12:30pm by Visual Micro »  
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print