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 3  Send TopicPrint
Very Hot Topic (More than 25 Replies) Linker error on first build for visual micro (Read 18804 times)
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Linker error on first build for visual micro
Feb 2nd, 2020 at 9:41pm
Print Post  
Atmel studio 7

Code
Select All
Compiling 'vmicro_test_1' for 'Arduino M0 Pro (Programming Port)'
Build Folder: bg/Release"
Summary: Header=1 Prototypes=3 Imports=0
Additional Defines:
Architecture Tools: eabi-gcc/7-2017q4/bin/"
Api: 1.1911.23-0
Sketch Book: "file:///C:/Users/chris/OneDrive/Documents/Arduino"
Sketch Include Paths
Core Include Paths
Include Path .8.3/cores/arduino"
Include Path .8.3/variants/arduino_mzero"

Deep search for libraries ...
\7-2017q4\bin\arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC  -g -DVM_DEBUG_GDB   -DF_CPU=48000000L -DARDUINO=108011 -DARDUINO_SAM_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__ -mthumb -DUSB_VID=0x2a03 -DUSB_PID=0x804f -DUSBCON -DUSB_MANUFACTURER="\"Unknown\"" -DUSB_PRODUCT="\"Arduino M0 Pro\"" IS/Include/" .0/CMSIS/Device/ATMEL/" ores\arduino" ariants\arduino_mzero" se\vmicro_test_1.cpp" -o "nul"

Building variant ...

  Using previously compiled variant

Building core ...

Building project code ...
  Using previously compiled file: e\vmicro_test_1.cpp.o

Linking it all together ...
# Coping cached core 2a27b\core.a to e\core.a

\7-2017q4/bin/arm-none-eabi-g++" ease" -Os -Wl,--gc-sections -save-temps ariants\arduino_mzero/linker_scripts/gcc/flash_with_bootloader.ld" dbg\Release/vmicro_test_1.ino.map" --specs=nano.specs --specs=nosys.specs -mcpu=cortex-m0plus -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -o se/vmicro_test_1.ino.elf" "vmicro_test_1.cpp.o" 12a27b\variant\variant.cpp.o" -Wl,--start-group IS/Lib/GCC/" -larm_cortexM0l_math -lm se/core.a" -Wl,--end-group

core.a(Uart.cpp.o)*: In function HardwareSerial::HardwareSerial()
HardwareSerial.h:67: undefined reference to vtable for HardwareSerial

Error linking for board Arduino M0 Pro (Programming Port)
Build failed for project 'vmicro_test_1'
  

« Last Edit: Feb 2nd, 2020 at 10:17pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #1 - Feb 2nd, 2020 at 10:20pm
Print Post  
That's a cache output. Please follow the guide in yellow above and also click Rebuild not Build when you create the verbose output.

Please also confirm that you have not altered the optimization setting? It is on "default optimization"?
  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #2 - Feb 2nd, 2020 at 10:45pm
Print Post  
It is on default optimization
It only happens on M0 (programming)  not M0 or uno

« Last Edit: Feb 2nd, 2020 at 11:56pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #3 - Feb 2nd, 2020 at 11:57pm
Print Post  
Please click the reply button and attach the output as a text file or email as stated above. When you paste into a post the text is truncated after a short time so only the first part of the output can be viewed. You can't attach a file in the quick reply on this page, you have to click the Reply button. Email is also fine along with link to this post.

The only way I can reproduce the error is to switch off optimization. That's expected.  Therefore the output should shed more light on the issue.
« Last Edit: Feb 3rd, 2020 at 12:02am by Tim@Visual Micro »  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #4 - Feb 3rd, 2020 at 1:53am
Print Post  
Things seem to keep changing.
here is where i am now.
Ihave attached two files
first is compiler output when set as M0 board.
it compiles fine, but wont download.
the second is set as M0 (programming port), shich is howit is connected.  It fails for a Hardware Serial fault.
Thoughts?
  

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #5 - Feb 3rd, 2020 at 6:12pm
Print Post  
Thanks, it looks like you have switch off optimization in the project properties?

The attached image shows the defaults.
  

Please Register or Login to the Forum to see File Attachments
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #6 - Feb 3rd, 2020 at 8:51pm
Print Post  
my settings are the same. see attached
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #7 - Feb 3rd, 2020 at 9:00pm
Print Post  
now I get an uploading error
  

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #8 - Feb 3rd, 2020 at 9:14pm
Print Post  
This is because you have set the programmer to Atmel EDBG. Please unckeck vMicro>Upload>Always User programmer"

You are also in Debug mode, I suggest you set the tool bar to Release instead of Debug.

Another point is that the vMicro > Debugger and Optimization settings are set per configuration. Release is one configuration and Debug is another configuration. In this  last example core optimization is set to "No Project and Libraries". In your previous example optimization was set to "None or No Optimization". Optimization should always be On which is the default unless you are debugging. Most arduino boards do not allow "No Optimization" because of the HardwareSerial library.
  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #9 - Feb 4th, 2020 at 1:55pm
Print Post  
it compiles and downloads, but then i get backend agent is not running no tools message
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #10 - Feb 4th, 2020 at 1:57pm
Print Post  
yes i am in debug, because that is the reason I am using m0 board and atmel studio
« Last Edit: Feb 4th, 2020 at 2:09pm by Chris Molloy »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #11 - Feb 4th, 2020 at 4:27pm
Print Post  
Admin: Moved Bootloader disussion
« Last Edit: Feb 4th, 2020 at 4:32pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #12 - Feb 4th, 2020 at 4:39pm
Print Post  
Upload in Atmel Studo

If you do not want to use the default serial upload you can use Atmel device programming...

Atmel studio uses different usb drivers to the arduino ide. This means that most programmers fail therefore you wills ee that we recommend setting the "vMicro>Uploader>Progammer>Use Atmel Studio Device Programming"

Debugging in Amel Studio

Regardless of upload method, if you want to use the Atmel studio hardware debugger instead of Visual Micro serial debugger...

Check "vMicro>Debugger>Atmel Studio Debugging"



In Atmel studio, both options can apply only to atmel hardware which you have. I guess you have also set no optimization for project and libraries which is often preferred however some libraries have been written in a way that means they will not compile or link with librray optimization set. A future enhancement to visual micro will provide more granular control of which libraries remain optimized. To test things I suggest you leave optimization on which is the default.


  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #13 - Feb 4th, 2020 at 6:03pm
Print Post  
with settings as you suggested, stillo get no tools available   backend not running
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #14 - Feb 4th, 2020 at 7:33pm
Print Post  
Please post verbose output for the build so that we can see your settings now.

That message you see will only appear if you use one of the other programmers. You need to stay in release mode until you prove the upload tool you want to use. 

Out of interest what are you clicking in the arduino ide to upload? If you are not clicking the special "Upload using programmer" menu item in arduino then you are using the standard upload which will be serial/COM.

Let's get past the upload issues which is unrelated to debugging then look at debugging.
  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #15 - Feb 4th, 2020 at 10:27pm
Print Post  
i just ran in arduino ide "Upload using programmer" menu item.   

it failed to download, attached is output
  

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #16 - Feb 4th, 2020 at 11:31pm
Print Post  
Okay so that shows that you just need to use the standard serial upload in visual micro. The arduino ide has confused things for you because it always shows a programmer is selected but it is not used.

In Visual Micro please switch off the "use programmer" in the upload settings and confirm that the upload is then using your COM port.

Thanks
  
Back to top
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #17 - Feb 5th, 2020 at 3:32pm
Print Post  
I downgraded the boards manager file to 1.6.21 based on some googling.
now the arduino ide works fine, downloads and runs sketch as expected.
also able to download and run in atmel studio.
however debugging not working.    backend agent not running  no tools available
cant get output file as it dissapears when closing backend not running dialog.

backend agent output is as follows
10:22:32: [WARNING] The back end process exited with code -1073741819
  
Back to top
 
IP Logged
 
Chris Molloy
Junior Member
**
Offline


Posts: 54
Location: Ontario, Canada
Joined: Dec 13th, 2012
Re: Linker error on first build for visual micro
Reply #18 - Feb 5th, 2020 at 3:35pm
Print Post  
found output in micro build output

  

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Linker error on first build for visual micro
Reply #19 - Feb 5th, 2020 at 3:55pm
Print Post  
Good, pleased to hear your uplod is working.

Is vMicro>Debugger>Atmel Studio Debugger enabled?
What happens when you click "Debug>Attach to Target"?
What board is shown in the atmel studio project properties? (right click proj name)

Thanks
  
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 2 3 
Send TopicPrint