An error occurred after the library file was imported

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

An error occurred after the library file was imported

Jump to solution
1,807 Views
zenging
Contributor I

I am using S32K311, I added the library file to the project through new, after compiling, there will be an error. May I ask if there is any solution

viewfile.png

2.png3.png

0 Kudos
Reply
1 Solution
1,656 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

the app_callbacks.h is not visible for the Release configuration. Please check the Include paths. 

 

View solution in original post

0 Kudos
Reply
3 Replies
1,756 Views
stanish
NXP Employee
NXP Employee

Hi,

This linking error indicates the data sections do not fit into internal SRAM memory.

If this happen after you add a library to the project - it may indicate that the linker does not dead-strip the unused library functions.

Could you check if the linker option is enabled: 

--gc-sections

stanish_0-1724683088057.png

enable the option and rebuild the project.

If it does not help, please check your code/data may not fit into the memory.

 

Hope it helps.

Stan

 

0 Kudos
Reply
1,735 Views
zenging
Contributor I

HI,@stanish 

As you suggested, I enabled --gc-sections and recompiled the project. When I use Debug_Flash, I can enter the debug phase normally.

97bbb590e7ba5823994d23466ee8cc5.png

However, I find that I still get an error when I use release_Flash. I want to ask how to solve it.

8f0cce10766b2e1adaaac59052742dd.png

0 Kudos
Reply
1,657 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

the app_callbacks.h is not visible for the Release configuration. Please check the Include paths. 

 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1939176%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EAn%20error%20occurred%20after%20the%20library%20file%20was%20imported%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1939176%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20am%20using%20S32K311%2C%20I%20added%20the%20library%20file%20to%20the%20project%20through%20new%2C%20after%20compiling%2C%20there%20will%20be%20an%20error.%20May%20I%20ask%20if%20there%20is%20any%20solution%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22viewfile.png%22%20style%3D%22width%3A%20944px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22viewfile.png%22%20style%3D%22width%3A%20944px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F294998i27D654B3CD0028E3%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22viewfile.png%22%20alt%3D%22viewfile.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%222.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F294999i650DDAC342E19B28%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%222.png%22%20alt%3D%222.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%223.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%223.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F295000i8EA6D9855EB5ED4B%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%223.png%22%20alt%3D%223.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1945546%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EHiRe%3A%20An%20error%20occurred%20after%20the%20library%20file%20was%20imported%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1945546%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%26nbsp%3B%3C%2FP%3E%0A%3CP%3Ethe%20app_callbacks.h%20is%20not%20visible%20for%20the%20Release%20configuration.%20Please%20check%20the%20Include%20paths.%26nbsp%3B%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1940816%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20An%20error%20occurred%20after%20the%20library%20file%20was%20imported%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1940816%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHI%2C%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F23056%22%20target%3D%22_blank%22%3E%40stanish%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20you%20suggested%2C%20I%20enabled%20--gc-sections%20and%20recompiled%20the%20project.%20When%20I%20use%20Debug_Flash%2C%20I%20can%20enter%20the%20debug%20phase%20normally.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2297bbb590e7ba5823994d23466ee8cc5.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%2297bbb590e7ba5823994d23466ee8cc5.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F295425i6B91C23B3C63825F%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2297bbb590e7ba5823994d23466ee8cc5.png%22%20alt%3D%2297bbb590e7ba5823994d23466ee8cc5.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22arial%20black%2Cavant%20garde%22%20size%3D%224%22%3E%3CSTRONG%3EHowever%2C%20I%20find%20that%20I%20still%20get%20an%20error%20when%20I%20use%20release_Flash.%20I%20want%20to%20ask%20how%20to%20solve%20it.%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%228f0cce10766b2e1adaaac59052742dd.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%228f0cce10766b2e1adaaac59052742dd.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F295426i79D8F4E6DE7BBC04%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%228f0cce10766b2e1adaaac59052742dd.png%22%20alt%3D%228f0cce10766b2e1adaaac59052742dd.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1940514%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20An%20error%20occurred%20after%20the%20library%20file%20was%20imported%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1940514%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3EThis%20linking%20error%20indicates%20the%20data%20sections%20do%20not%20fit%20into%20internal%20SRAM%20memory.%3C%2FP%3E%0A%3CP%3EIf%20this%20happen%20after%20you%20add%20a%20library%20to%20the%20project%20-%20it%20may%20indicate%20that%20the%20linker%20does%20not%20dead-strip%20the%20unused%20library%20functions.%3C%2FP%3E%0A%3CP%3ECould%20you%20check%20if%20the%20linker%20option%20is%20enabled%3A%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3E--gc-sections%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22stanish_0-1724683088057.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22stanish_0-1724683088057.png%22%20style%3D%22width%3A%20374px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F295342i893616182C94438C%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22stanish_0-1724683088057.png%22%20alt%3D%22stanish_0-1724683088057.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3Eenable%20the%20option%20and%20rebuild%20the%20project.%3C%2FP%3E%0A%3CP%3EIf%20it%20does%20not%20help%2C%20please%20check%20your%20code%2Fdata%20may%20not%20fit%20into%20the%20memory.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EHope%20it%20helps.%3C%2FP%3E%0A%3CP%3EStan%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E