Built MQX libraries not being found by linker

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Built MQX libraries not being found by linker

376 Views
reagan_revisore
NXP Employee
NXP Employee

Using the linker command:

arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -g3 -T "MK64FN1M0xxx12_flash.ld" -Xlinker --gc-sections -L"C:/Users/B52864/workspace.kds/New_MQX_Project/Project_Settings/Linker_Files" -L"C:\Freescale\KSDK_1.1.0/lib/ksdk_mqx_lib/kds/K64F12/Debug" -L"C:\Freescale\KSDK_1.1.0/rtos/mqx/lib/frdmk64.kds/debug/mqx" -L"C:\Freescale\KSDK_1.1.0/rtos/mqx/lib/frdmk64.kds/debug/mqx_stdlib" -Wl,-Map,"New_MQX_Project.map" -nanolibc -o "New_MQX_Project.elf" ./Sources/Utilities/fsl_debug_console.o ./Sources/Board/gpio_pins.o ./Sources/Board/hardware_init.o ./Sources/Board/pin_mux.o ./Sources/BSP_Files/init_bsp.o ./Sources/BSP_Files/mqx_main.o ./Sources/main.o ./Project_Settings/Startup_Code/startup.o ./Project_Settings/Startup_Code/startup_MK64F12.o ./Project_Settings/Startup_Code/system_MK64F12.o C:/Freescale/KSDK_1.1.0/lib/ksdk_mqx_lib/kds/K64F12/Debug/libksdk_platform_mqx.a C:/Freescale/KSDK_1.1.0/rtos/mqx/lib/frdmk64f.kds/debug/mqx/lib_mqx.a C:/Freescale/KSDK_1.1.0/rtos/mqx/lib/frdmk64f.kds/debug/mqx_stdlib/lib_mqx_stdlib.a -lksdk_platform_mqx -l_mqx -l_mqx_stdlib

I get the errors below:

c:/freescale/kds_2.0.0/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.0/../../../../arm-none-eabi/bin/ld.exe: cannot find -l_mqx

c:/freescale/kds_2.0.0/toolchain/bin/../lib/gcc/arm-none-eabi/4.8.0/../../../../arm-none-eabi/bin/ld.exe: cannot find -l_mqx_stdlib

collect2.exe: error: ld returned 1 exit status

I've verified that I can go to the paths at the end of the linker command to find the lib_mqx.a and lib_mqx_stdlib.a files that are being used. It's interesting because the convention is similar to what's used for libksdk_platform_mqx.a, and the linker is able to find that.

Any ideas as to what can be done here?

0 Kudos
1 Reply

218 Views
RadekS
NXP Employee
NXP Employee

For now I suppose that you use KDS2.0 and you build application from here. If not, please add some details about your environment.

I guess that there could be conflict because you try loading the same library twice:

-l_mqx_stdlib and C:/Freescale/KSDK_1.1.0/rtos/mqx/lib/frdmk64f.kds/debug/mqx_stdlib/lib_mqx_stdlib.a

-l_mqx and C:/Freescale/KSDK_1.1.0/rtos/mqx/lib/frdmk64f.kds/debug/mqx/lib_mqx.a

-lksdk_platform_mqx and C:/Freescale/KSDK_1.1.0/lib/ksdk_mqx_lib/kds/K64F12/Debug/libksdk_platform_mqx.a

I would like to recommend keep just one instance of these libraries.

So, if you look at project properties - C/C++ build settings - Linker option you should add library as either Library or Other objects:

Lib.png

Misc.png

I see that you use C++ linker. Is your project compiled be C++ compiler?

If it is possible, could you please attach here your project, that we can test it?

I hope it helps you.

Have a great day,
RadekS

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos