linker error with no build helpful build output

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Has anyone seen this before?

Build output:

------ Build started: Project: Herb, Configuration: Debug ARM ------
    Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
    C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe all --jobs 12 --output-sync 
collect2.exe(0,0): error: ld returned 1 exit status
Done building project "Herb.cproj" -- FAILED.

Build FAILED.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

No complilation errors or warnings....

Any way to get more detail?

This topic has a solution.

Engineering is the truest form of art

Last Edited: Wed. Oct 21, 2020 - 10:12 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Rebuild, and check that Tool/Options/Projects/Build and Run/MSBuild verbosity is set to Diagnostic

:: Morten

 

(yes, I work for Microchip, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Awesome! I knew there must be a way!! Thank you!

Now I get this....so much better

------ Build started: Project: Herb, Configuration: Debug ARM ------
Build started.
Project "Herb.cproj" (default targets):
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Herb.cproj" (target "Build" depends on it):
    Task "RunCompilerTask"
        Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
        C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe all --jobs 12 --output-sync 
        Building file: .././main.c
        Invoking: ARM/GNU C Compiler : 6.3.1
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-gcc.exe"  -x c -mthumb -D__SAMD21J18A__ -DDEBUG  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\ARM\CMSIS\4.1.0\CMSIS\Include" -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.3.395\samd21a\include" -I"../Config" -I".." -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/adc" -I"../hpl/core" -I"../hpl/dac" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/i2c" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/sysctrl" -I"../hpl/systick" -I"../hpl/tcc" -I"../hpl/wdt" -I"../hri" -I"../include"  -O1 -ffunction-sections -mlong-calls -g3 -Wall -mcpu=cortex-m0plus -c -std=gnu99 -MD -MP -MF "main.d" -MT"main.d" -MT"main.o"   -o "main.o" ".././main.c" 
        Finished building: .././main.c
        Building file: .././Levitation.c
        Invoking: ARM/GNU C Compiler : 6.3.1
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-gcc.exe"  -x c -mthumb -D__SAMD21J18A__ -DDEBUG  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\ARM\CMSIS\4.1.0\CMSIS\Include" -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\SAMD21_DFP\1.3.395\samd21a\include" -I"../Config" -I".." -I"../examples" -I"../hal/include" -I"../hal/utils/include" -I"../hpl/adc" -I"../hpl/core" -I"../hpl/dac" -I"../hpl/dmac" -I"../hpl/gclk" -I"../hpl/i2c" -I"../hpl/pm" -I"../hpl/port" -I"../hpl/sysctrl" -I"../hpl/systick" -I"../hpl/tcc" -I"../hpl/wdt" -I"../hri" -I"../include"  -O1 -ffunction-sections -mlong-calls -g3 -Wall -mcpu=cortex-m0plus -c -std=gnu99 -MD -MP -MF "Levitation.d" -MT"Levitation.d" -MT"Levitation.o"   -o "Levitation.o" ".././Levitation.c" 
        Finished building: .././Levitation.c
        Building target: Herb.elf
        Invoking: ARM/GNU Linker : 6.3.1
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\main.o(1,1): error: multiple definition of `message_requested'
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\Levitation.o(1,1): error: first defined here
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\main.o(1,1): error: multiple definition of `stringtransmission'
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\Levitation.o(1,1): error: first defined here
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\main.o(1,1): error: multiple definition of `is_rotor_stable'
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\Levitation.o(1,1): error: first defined here
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\main.o(1,1): error: multiple definition of `Levitate_Command'
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\Levitation.o(1,1): error: first defined here
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\main.o(1,1): error: multiple definition of `state'
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\Levitation.o(1,1): error: first defined here
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\main.o(1,1): error: multiple definition of `Low_Scale'
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\Levitation.o(1,1): error: first defined here
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\main.o(1,1): error: multiple definition of `High_Scale'
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\Levitation.o(1,1): error: first defined here
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\main.o(1,1): error: multiple definition of `Hall_index'
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\Levitation.o(1,1): error: first defined here
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\main.o(1,1): error: multiple definition of `Hall_data'
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\Levitation.o(1,1): error: first defined here
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\main.o(1,1): error: multiple definition of `Zero_Current_Reference'
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\Levitation.o(1,1): error: first defined here
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\main.o(1,1): error: multiple definition of `positionError'
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\Levitation.o(1,1): error: first defined here
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\main.o(1,1): error: multiple definition of `Hall_Reset'
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\Levitation.o(1,1): error: first defined here
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\main.o(1,1): error: multiple definition of `ERROR'
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\Levitation.o(1,1): error: first defined here
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\main.o(1,1): error: multiple definition of `Current'
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\Levitation.o(1,1): error: first defined here
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\main.o(1,1): error: multiple definition of `Plant'
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\Levitation.o(1,1): error: first defined here
collect2.exe(0,0): error: ld returned 1 exit status
        make: *** [Herb.elf] Error 1
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\arm\arm-gnu-toolchain\bin\arm-none-eabi-gcc.exe" -o Herb.elf  atmel_start.o Device_Startup/startup_samd21.o Device_Startup/system_samd21.o driver_init.o examples/driver_examples.o hal/src/hal_adc_async.o hal/src/hal_atomic.o hal/src/hal_dac_async.o hal/src/hal_delay.o hal/src/hal_gpio.o hal/src/hal_init.o hal/src/hal_io.o hal/src/hal_sleep.o hal/src/hal_wdt.o hal/utils/src/utils_assert.o hal/utils/src/utils_event.o hal/utils/src/utils_list.o hal/utils/src/utils_ringbuffer.o hal/utils/src/utils_syscalls.o hpl/adc/hpl_adc.o hpl/core/hpl_core_m0plus_base.o hpl/core/hpl_init.o hpl/dac/hpl_dac.o hpl/dmac/hpl_dmac.o hpl/gclk/hpl_gclk.o hpl/i2c/i2c_lite.o hpl/pm/hpl_pm.o hpl/sysctrl/hpl_sysctrl.o hpl/systick/hpl_systick.o hpl/tcc/tcc_lite.o hpl/wdt/hpl_wdt.o Levitation.o main.o   -mthumb -Wl,-Map="Herb.map" --specs=nano.specs -Wl,--start-group -lm  -Wl,--end-group -L"..\\Device_Startup"  -Wl,--gc-sections -ffast-math -mcpu=cortex-m0plus -Tsamd21j18a_flash.ld  
C:\Project_Vault\PCA300\Cold_Board\Firmware\SAMD21\Trunk\Herb\Debug\Makefile(517,1): error: recipe for target 'Herb.elf' failed
        The command exited with code 2.
    Done executing task "RunCompilerTask" -- FAILED.
Done building target "CoreBuild" in project "Herb.cproj" -- FAILED.
Done building project "Herb.cproj" -- FAILED.

Build FAILED.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

Engineering is the truest form of art

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No idea why but I now have something to work with, Thank you!

Engineering is the truest form of art

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Vazaha wrote:
No idea why

Very often, "multiple definition" errors are caused by having definitions in header files - you should have only declarations in headers.

 

http://c-faq.com/decl/decldef.html

 

EDIT

 

Recent example: https://www.avrfreaks.net/commen...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Wed. Oct 21, 2020 - 10:34 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Yep, that definitely was the problem. Thanks!

Engineering is the truest form of art