How to creat a lib file and add it to another project with S32DS

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

How to creat a lib file and add it to another project with S32DS

Jump to solution
4,079 Views
suomichen
Contributor I

Hi 

I creat a lib file with S32DS in this way: file->new->new s32ds project->library project ,and in this file , I creat a simple function to test that if it is ok .

Then I creat a elf project file,and add the lib file "libdiceng.a" into the elf project's workspace ,like below.

pastedImage_1.png

but it Prompt compilation error 

pastedImage_2.png

I don't konw how to do this exactly ,thankyou.

Suomi

Labels (1)
0 Kudos
1 Solution
3,025 Views
BlackNight
NXP Employee
NXP Employee

Hi Suomi,

the library name needs to be lib<name>.a, but in the linker you only specify the name (without lib and .a).

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

or How to use Custom Library Names with GNU Linker and Eclipse | MCU on Eclipse 

I hope this helps,

Erich

View solution in original post

7 Replies
3,025 Views
jeffqin
Contributor I

BlackNight‌ Thanks, I have checked it, it does not have this beginning.

0 Kudos
3,025 Views
BlackNight
NXP Employee
NXP Employee

Hi Jeff,

in that case, it is not a library.

Erich

0 Kudos
3,025 Views
jeffqin
Contributor I

BlackNight, Thanks, I have another question, could you give me some help too? I got a library file from NXP, and add it to my project, but when I make the project, it has an error: "E:/Temp/Sources\TDF8534-CC.LIBRARY: file not recognized: File format not recognized." Does it mean that file can`t be used in S32 design studio? Or I need other setting? 

0 Kudos
3,025 Views
BlackNight
NXP Employee
NXP Employee

Check your archive if it has this at the beginning of the file:

pastedImage_1.png

Erich

0 Kudos
3,026 Views
BlackNight
NXP Employee
NXP Employee

Hi Suomi,

the library name needs to be lib<name>.a, but in the linker you only specify the name (without lib and .a).

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

or How to use Custom Library Names with GNU Linker and Eclipse | MCU on Eclipse 

I hope this helps,

Erich

249 Views
NXP2
Contributor I
Hello, I follow the normal methods of generating and adding static libraries. When I added static libraries, the following error appeared. May I ask what caused it?

Building target: BMS_2_2.elf
Invoking: Standard S32DS C Linker
arm-none-eabi-gcc -o "BMS_2_2.elf" "@BMS_2_2.args"
arm-none-eabi-gcc.exe: error: : No such file or directory
make: *** [makefile:86: BMS_2_2.elf] Error 1
"make -j16 all" terminated with exit code 2. Build might be incomplete.
0 Kudos
3,025 Views
suomichen
Contributor I

 Hi Erich,

Thankyou so much !!

the last words help me a lot 

pastedImage_1.png

best regards

sumi

0 Kudos