I need to use the static link library in S32DS v3.4.The compiler as shown below:
My operations are as follows:
1. First, create a project that can generate library files, and then compile to generate TestLib.a file,I use the default options during project creation;
2. Then create an application project and add the above library files to the new application project,I use the default options during project creation;;
3.I add the LibTestLib. a file to the application project, and the settings are shown in the following figure
4. The following error prompt appears when compiling the application project.
My questions are as follows:
In the previous S32DS software version, I could create and add my static link library files according to the above steps, but failed in S32DS v3.4. What are the differences between creating static link library files in S32DS v3.4 and previous software versions, and what should be paid attention to? Is there a description document for creating and using static link libraries in S32DS v3.4 that I can refer to?
解決済! 解決策の投稿を見る。
Hi,
it looks okay. Even with fresh library build you still aren't able link your library?
Your original library contains mylibrary.o file. If I extract it from library archive and run nm - it says that the platform is unknown:
If I build it again on my side - the content can be recognized normally:
For reference - here is HEX view - on the left is your library - the E-SafeNet is suspicious. Also there is no function name - ec_TestFunc at all. On the right side is library build on my machine from your project.
If I'm correct (I'm not familiar with it) - E-SafeNet is some kind of encryption - probably running on your machine.
Jiri
Hi,
can you please share full console output from your library build?
I just did quick test and with the same compiler version for lib and project - there is no issue on my side and library can be successfully linked.
Hello,
Thank you very much for your reply.
I pasted the complete console output below. Please help me analyze it. Thank you very much.
I also put the application project and generated library project I use on the attachment.
Project description:
1.S32K144_Lib. This is the project used to generate. a file.
2.S32K144_Lib_BuildTest. This is the application project.
The following is the full Console output information:
21:58:26 **** Build of configuration Debug_FLASH for project S32K144_Lib_BuildTest ****
make -j8 all
Building file: ../src/main.c
Building file: ../Project_Settings/Startup_Code/startup.c
Building file: ../Project_Settings/Startup_Code/startup_S32K144.S
Invoking: Standard S32DS C Compiler
Building file: ../Project_Settings/Startup_Code/system_S32K144.c
Invoking: Standard S32DS Assembler
arm-none-eabi-gcc "@src/main.args" -MMD -MP -MF"src/main.d" -MT"src/main.o" -o "src/main.o" "../src/main.c"
Invoking: Standard S32DS C Compiler
arm-none-eabi-gcc "@Project_Settings/Startup_Code/startup_S32K144.args" -o "Project_Settings/Startup_Code/startup_S32K144.o" "../Project_Settings/Startup_Code/startup_S32K144.S"
Invoking: Standard S32DS C Compiler
arm-none-eabi-gcc "@Project_Settings/Startup_Code/startup.args" -MMD -MP -MF"Project_Settings/Startup_Code/system_S32K144.d" -MT"Project_Settings/Startup_Code/system_S32K144.o" -o "Project_Settings/Startup_Code/system_S32K144.o" "../Project_Settings/Startup_Code/system_S32K144.c"
arm-none-eabi-gcc "@Project_Settings/Startup_Code/startup.args" -MMD -MP -MF"Project_Settings/Startup_Code/startup.d" -MT"Project_Settings/Startup_Code/startup.o" -o "Project_Settings/Startup_Code/startup.o" "../Project_Settings/Startup_Code/startup.c"
Finished building: ../Project_Settings/Startup_Code/startup_S32K144.S
Finished building: ../src/main.c
Finished building: ../Project_Settings/Startup_Code/startup.c
Finished building: ../Project_Settings/Startup_Code/system_S32K144.c
Building target: S32K144_Lib_BuildTest.elf
Invoking: Standard S32DS C Linker
arm-none-eabi-gcc -o "S32K144_Lib_BuildTest.elf" "@S32K144_Lib_BuildTest.args"
D:/NXP/workspaceS32DS.3.4VVV/S32K144_Lib_BuildTest/src\libS32K144_Lib.a: error adding symbols: Archive has no index; run ranlib to add one
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:36: S32K144_Lib_BuildTest.elf] Error 1
"make -j8 all" terminated with exit code 2. Build might be incomplete.
Hi,
at first glance - you library project is empty. There is no source code at all. That's why linker can't find any item inside.
Hello,
Thank you for your prompt response. According to your minder, I added a function to the library project, and then updated the library file to the application project. The compiled application project still reported error. If it is convenient, can you put the project you used in the test on the attachment? Let me compile it on my computer.
This is the full Console output information:
23:23:51 **** Incremental Build of configuration Debug_FLASH for project S32K144_Lib_BuildTest ****
make -j8 all
Building file: ../src/main.c
Building file: ../Project_Settings/Startup_Code/startup.c
Building file: ../Project_Settings/Startup_Code/startup_S32K144.S
Building file: ../Project_Settings/Startup_Code/system_S32K144.c
Invoking: Standard S32DS C Compiler
Invoking: Standard S32DS C Compiler
arm-none-eabi-gcc "@src/main.args" -MMD -MP -MF"src/main.d" -MT"src/main.o" -o "src/main.o" "../src/main.c"
Invoking: Standard S32DS C Compiler
arm-none-eabi-gcc "@Project_Settings/Startup_Code/startup.args" -MMD -MP -MF"Project_Settings/Startup_Code/startup.d" -MT"Project_Settings/Startup_Code/startup.o" -o "Project_Settings/Startup_Code/startup.o" "../Project_Settings/Startup_Code/startup.c"
Invoking: Standard S32DS Assembler
arm-none-eabi-gcc "@Project_Settings/Startup_Code/startup_S32K144.args" -o "Project_Settings/Startup_Code/startup_S32K144.o" "../Project_Settings/Startup_Code/startup_S32K144.S"
arm-none-eabi-gcc "@Project_Settings/Startup_Code/startup.args" -MMD -MP -MF"Project_Settings/Startup_Code/system_S32K144.d" -MT"Project_Settings/Startup_Code/system_S32K144.o" -o "Project_Settings/Startup_Code/system_S32K144.o" "../Project_Settings/Startup_Code/system_S32K144.c"
Finished building: ../Project_Settings/Startup_Code/startup_S32K144.S
Finished building: ../src/main.c
Finished building: ../Project_Settings/Startup_Code/startup.c
Finished building: ../Project_Settings/Startup_Code/system_S32K144.c
Building target: S32K144_Lib_BuildTest.elf
Invoking: Standard S32DS C Linker
arm-none-eabi-gcc -o "S32K144_Lib_BuildTest.elf" "@S32K144_Lib_BuildTest.args"
D:/NXP/workspaceS32DS.3.4VVV/S32K144_Lib_BuildTest/src\libS32K144_Lib.a: error adding symbols: Archive has no index; run ranlib to add one
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:36: S32K144_Lib_BuildTest.elf] Error 1
"make -j8 all" terminated with exit code 2. Build might be incomplete.
Can you share console output from building the library? On your side it is built in some strange way. I imported your library project, build (nothing changed) and it can be normally linked.
The library from your shared project is completely different in binary form for some reason. With the library archive from your .zip file I can reproduce the issue.
Hello,
Thank you.
This is the full Console output of library project:
07:39:56 **** Incremental Build of configuration Debug for project S32K144_Lib ****
make -j8 all
Building file: ../src/mylibrary.c
Invoking: Standard S32DS C Compiler
arm-none-eabi-gcc "@src/mylibrary.args" -MMD -MP -MF"src/mylibrary.d" -MT"src/mylibrary.o" -o "src/mylibrary.o" "../src/mylibrary.c"
Finished building: ../src/mylibrary.c
Building target: libS32K144_Lib.a
Invoking: Standard S32DS Archiver
arm-none-eabi-ar -r "libS32K144_Lib.a" ./src/mylibrary.o
D:\NXP\S32DS.3.4\S32DS\build_tools\gcc_v6.3\gcc-6.3-arm32-eabi\bin\arm-none-eabi-ar.exe: creating libS32K144_Lib.a
Finished building target: libS32K144_Lib.a
Hi,
it looks okay. Even with fresh library build you still aren't able link your library?
Your original library contains mylibrary.o file. If I extract it from library archive and run nm - it says that the platform is unknown:
If I build it again on my side - the content can be recognized normally:
For reference - here is HEX view - on the left is your library - the E-SafeNet is suspicious. Also there is no function name - ec_TestFunc at all. On the right side is library build on my machine from your project.
If I'm correct (I'm not familiar with it) - E-SafeNet is some kind of encryption - probably running on your machine.
Jiri
Hello,
It is really caused by file encryption software.This E-SafeNet is the encryption software. The problem of adding static libraries has been solved. Thank you very much for your analysis and guidance. Thank you very much.
Hello,
My computer has a file encryption system installed.I need to check if the problem is caused by this encryption system.Your guidance is really helpful. I really appreciate it.