10 Replies Latest reply on Jun 29, 2017 7:24 AM by victor_2221421

    Linker creates incorrect order of commands to link library

    ray.parker_1412866

      I am using the Project/Build Settings dialog to try to add an additional library to my project.  Using the "Additional Libraries" and the "Additional Libraries Directories" tabs does add the items to the linker command but since the directories is added after the library is added it appears as though the library can't be found.  The linker command becomes:

         

      -mcpu=cortex-m0 -mthumb -g -ffunction-sections -O0 -l m -l ..\..\..\Documents\MotionDriver\Arm_Source\libmplmpu -L Generated_Source\PSoC4 -L ..\..\..\Documents\MotionDriver\MPL_Libraries -Wl,-Map,${OutputDir}/${ProjectShortName}.map -T Generated_Source\PSoC4\cm0gcc.ld -specs=nano.specs -Wl,--gc-sections

         

      But seemingly:  -l ..\..\..\Documents\MotionDriver\Arm_Source\libmplmpu

         

      isn't found because the directory to look in: -L Generated_Source\PSoC4 -L ..\..\..\Documents\MotionDriver\MPL_Libraries

         

      hasn't been added to the path yet.  That's speculation on my part and I'd welcome any feedback on how to accomplish this.  The error that is thrown looks like:

         

      arm-none-eabi-ar.exe: creating .\CortexM0\ARM_GCC_493\Debug\PSoC_4_BLE_MPU_9150.a

         

      arm-none-eabi-gcc.exe -Wl,--start-group -o .\CortexM0\ARM_GCC_493\Debug\PSoC_4_BLE_MPU_9150.elf .\CortexM0\ARM_GCC_493\Debug\data_builder.o .\CortexM0\ARM_GCC_493\Debug\eMPL_outputs.o .\CortexM0\ARM_GCC_493\Debug\hal_outputs.o .\CortexM0\ARM_GCC_493\Debug\inv_mpu.o .\CortexM0\ARM_GCC_493\Debug\inv_mpu_dmp_motion_driver.o .\CortexM0\ARM_GCC_493\Debug\log_stm32.o .\CortexM0\ARM_GCC_493\Debug\message_layer.o .\CortexM0\ARM_GCC_493\Debug\ml_math_func.o .\CortexM0\ARM_GCC_493\Debug\mlmath.o .\CortexM0\ARM_GCC_493\Debug\mpl.o .\CortexM0\ARM_GCC_493\Debug\results_holder.o .\CortexM0\ARM_GCC_493\Debug\start_manager.o .\CortexM0\ARM_GCC_493\Debug\storage_manager.o .\CortexM0\ARM_GCC_493\Debug\uart.o .\CortexM0\ARM_GCC_493\Debug\mpu9150.o .\CortexM0\ARM_GCC_493\Debug\BLEApplication.o .\CortexM0\ARM_GCC_493\Debug\main_original.o .\CortexM0\ARM_GCC_493\Debug\motion_driver_main.o .\CortexM0\ARM_GCC_493\Debug\cymetadata.o .\CortexM0\ARM_GCC_493\Debug\Cm0Start.o .\CortexM0\ARM_GCC_493\Debug\PSoC_4_BLE_MPU_9150.a "C:\Program Files (x86)\Cypress\PSoC Creator\3.3\PSoC Creator\psoc\content\cycomponentlibrary\CyComponentLibrary.cylib\BLE_v1_10\Library\gccCyBLEStack_BLE_SOC_PERIPHERAL.a" "C:\Program Files (x86)\Cypress\PSoC Creator\3.3\PSoC Creator\psoc\content\cycomponentlibrary\CyComponentLibrary.cylib\CortexM0\ARM_GCC_493\Debug\CyComponentLibrary.a" -mcpu=cortex-m0 -mthumb -g -ffunction-sections -O0 -l m -l C:\Users\raypa\Documents\MotionDriver\Arm_Source\liblibmplmpu.a -L Generated_Source\PSoC4 -Wl,-Map,.\CortexM0\ARM_GCC_493\Debug/PSoC_4_BLE_MPU_9150.map -T Generated_Source\PSoC4\cm0gcc.ld -specs=nano.specs -Wl,--gc-sections -Wl,--end-group

         

      ERROR: cannot find -lC:\Users\raypa\Documents\MotionDriver\Arm_Source\liblibmplmpu.a

         

      collect2.exe: error: ld returned 1 exit status

         

      The command 'arm-none-eabi-gcc.exe' failed with exit code '1'.