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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
4,124 次查看
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?

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
3,314 次查看
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

在原帖中查看解决方案

2 回复数
3,315 次查看
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
3,314 次查看
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