Hi,
I want to link some other files into my project, where should I add the file path ?
I have add the path here ,but it does not work.
Best Regards
Qiao
Hi,
Include paths are intended for header files only.
If you have external library you can add the path into linker:
In case of any other file/object:
This is how the settings above influence the .arg file used by makefile:
"./Project_Settings/Startup_Code/system_S32K144.o"
"./Project_Settings/Startup_Code/startup_S32K144.o"
"./Project_Settings/Startup_Code/startup.o"
"./src/main.o"
-L:My_External_lib.a
-T
"C:/Users/r200040/workspaceS32DS.ARM_1.3/S32K144_Segger_test/Project_Settings/Linker_Files/S32K1xx_flash.ld"
-Wl,-Map,"S32K144_Segger_test.map"
-Xlinker
--gc-sections
-mcpu=cortex-m4
-mthumb
-specs=ewl_c9x_noio.specs
--sysroot="C:/NXP/S32DS_ARM_v1.3/S32DS/arm_ewl2"
"Any_other_file.bin"
-lc:\MyLib
Regarding the elf question please have a look here:
https://community.nxp.com/docs/DOC-332252
Hope it helps.
Stan
Hello @stanish
My Project does not have option such as C/C+Builder its an Matlab XML Impoerted Project.
Could you guide me the way to resolve it.
Regards
Gopal Rathi
Hello Qiao,
I am not definitely sure, but I think it is not possible to add path to file directly in S32DS. You have to edit the .args file in your project. But be careful, .args is automatically generated by S32DS when you compile the project.
So at first, compile the project and then edit the .args file. If you do it in opposite way, S32DS will delete your changes.
My colleague solved very similar problem in the following thread. Please look:
https://community.nxp.com/thread/445212
If you have any other questions, please feel free to write me back.
Regards,
Martin
Hello Martin
According to your reply" it is not possible to add path to file directly in S32DS". If there is a file OBCM.c in app folder and main.c in src folder, I can't inlcude the OBCM.c file in main.c such as writing #include "OBCM.c" in the top of main.c ?
Hi Michael,
Yes, you could be able to include OBCM.c file but you should add the include path in the project properties.
Nevertheless including ".c" files is not a good coding practice and could introduce some hard-to-find problems to your project.
Stan
hi Stanislav
I follow your suggestion and the error message" can't find out the .h" is disappeared when I add the path in the C complier Includessetting . It seems to be able to recognize the .h file. But it shows another error, " undefine reference to my_function() which I have defined in my h file, extern void my_function(void). Do you have any idea for this? Thank you!
Hi Martin,
Here is another question. I want to compile the code using some other compiler, and then import the elf file into S32 Studio to flash my MCU. Is it supported by S32 Design Studio? How should I do it.
Regards,
Qiao
Hello Qiao,
Yes this is possible. Please have a look here:
https://community.nxp.com/docs/DOC-332252
Note:
We've experienced some limitations with debugging elf built with GHS build tools + GDB .
Stan