What is the proper way to link in a library with S32DS Power PC?

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

What is the proper way to link in a library with S32DS Power PC?

Jump to solution
2,779 Views
ronlewis
Contributor III

I keep getting the following error:

 

c:/freescale/s32_power_v1.1/cross_tools/powerpc-eabivle-4_9/bin/../lib/gcc/powerpc-eabivle/4.9.2/../../../../powerpc-eabivle/bin/real-ld.exe: cannot find -lMPC5644A_SDK_001.lib
collect2.exe: error: ld returned 1 exit status
elf32ppcsim
make: *** [TestApplication.elf] Error 1

 

I have added the path to the lib in the properties/c\C++ General\Paths and Symbols:

 

args file looks like this:

 

"./Project_Settings/Startup_Code/startup.o"
"./src/application.o"
-L"C:/DEV_AREA/myproject_sdk/S32DS/mpc5644a_sdk/Debug"
-v
-T
"C:/DEV_AREA/myproject_sdk/S32DS/TestApplication/Project_Settings/Linker_Files/56xx_flash.ld"
-Wl,-Map,"TestApplication.map"
-Xlinker
--print-gc-sections
-mcpu=e200z4
-specs=ewl_c9x.specs
-mhard-float
--sysroot="C:/Freescale/S32_Power_v1.1/S32DS/e200_ewl2"
-lMPC5644A_SDK_001.lib

 

Why is it not finding the lib?

Labels (1)
0 Kudos
1 Solution
1,969 Views
stanish
NXP Employee
NXP Employee

Hi Ron,

If you want to link a library without "lib" prefix/extenstion you can adjust the switch to:

-l:MPC5644A_SDK_001.a

Stan

View solution in original post

2 Replies
1,970 Views
stanish
NXP Employee
NXP Employee

Hi Ron,

If you want to link a library without "lib" prefix/extenstion you can adjust the switch to:

-l:MPC5644A_SDK_001.a

Stan
1,969 Views
BlackNight
NXP Employee
NXP Employee

Hello,

I have not used S32 with PowerPC, but if it is using the GNU linker (ld) way, then the following article applies:

Creating and using Libraries with ARM gcc and Eclipse | MCU on Eclipse 

I see that you already have specificed with the -L option where the library is located:

-L"C:/DEV_AREA/myproject_sdk/S32DS/mpc5644a_sdk/Debug"

With the -l option you specify the library name:

-lMPC5644A_SDK_001.lib

That means that the ld is looking for the following file:

C:/DEV_AREA/myproject_sdk/S32DS/mpc5644a_sdk/Debug/libMPC5644A_SDK_001.lib.a

I think that file does not exist?

I hope this helps,

Erich