linker error:multiple definition of `_start'

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

linker error:multiple definition of `_start'

4,013 Views
bowen_gu
Contributor I

I want to create a new project,but there is an error about multiple definition.

my steps as below:

1. S32DS--->file--->new---> S32DS Application project --->family S32k3xx and choose S32K344--->next--->done

2. copy static code from RTD1.0/plugins to my project, here I also copy plugins/platformxx/startup files.

3. define preprocessor macro "S32K344" and S32K3XX

4. declare header files

5.build project

It seems that the system doesn't get the right link file.

 

 

 

0 Kudos
Reply
4 Replies

3,981 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@bowen_gu

Please try to delete Startup_Code,Linker_Files & include before copy plugins/platformxx/startup files.

Senlent_0-1639384869877.png

BR!

     Jim,

0 Kudos
Reply

4,012 Views
bowen_gu
Contributor I

log:

arm-none-eabi-gcc -o "LVIU_MCAL_PROJECT.elf" "@LVIU_MCAL_PROJECT.args"
c:/nxp/s32ds.3.4/s32ds/build_tools/gcc_v9.2/gcc-9.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/9.2.0/../../../../arm-none-eabi/bin/real-ld.exe: ./src/mcal/RTDCode/startup/src/m7/gcc/startup_cm7.o: in function `_start':
D:\lviu_code\livu\source\mcal\lviu_mcal_project\Debug_FLASH/../src/mcal/RTDCode/startup/src/m7/gcc/startup_cm7.s:154: multiple definition of `_start'; C:/NXP/S32DS.3.4/S32DS/build_tools/gcc_v9.2/gcc-9.2-arm32-eabi/arm-none-eabi/newlib/lib/thumb/v7e-m/nofp/crt0.o:(.text+0x8): first defined here
collect2.exe: error: ld returned 1 exit status

why does system try to link "__start" twice? 

0 Kudos
Reply

3,536 Views
prabhat_
Contributor III

Any update over this one ? As I am facing the same issue while creating a project in Release Mode in S32 DS 3.4 for the S32G274A device

0 Kudos
Reply

3,225 Views
try_wumbo
Contributor I

For people that may run into this in the future.

This issue may be resolved by checking the "Do not use standard start files (-nostartfiles)" box under: Properties > C/C++ Build > Settings > Standard S32DS C(++) Linker > General