L1823 linker error

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

L1823 linker error

跳至解决方案
1,996 次查看
NeilVP
Contributor II

I have successfully written a number of projects using CodeWarrior now and my latest project was working but now I am getting multiple L1823 errors. I understand what the error is and what it means but am at a loss to explain why I am getting the error. For example it looks as though the linker cannot see the mc9s08qe4.h file but it is in the file list, it is in the link order list and it is where the path says it should be. It also seems that the linker cannot see any of my .h files. Given that this project was compiling successfully my suspicion is that I have inadvertently managed to mess up a project setting.

Any suggestions as to how to fix would be gratefully received.

 

Many thanks

 

Neil

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,035 次查看
NeilVP
Contributor II

The solution was to rebuild the project from scratch.

New directory, new project but not using the option to "include these files" just copy and paste the .c and .h files from their original locations and the project compiled first go. Clearly the original project settings had been corrupted whether by me or gremlins I do not know.

 

Hope this helps someone.

 

Cheers

 

Neil

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,036 次查看
NeilVP
Contributor II

The solution was to rebuild the project from scratch.

New directory, new project but not using the option to "include these files" just copy and paste the .c and .h files from their original locations and the project compiled first go. Clearly the original project settings had been corrupted whether by me or gremlins I do not know.

 

Hope this helps someone.

 

Cheers

 

Neil

0 项奖励
回复
1,035 次查看
CrasyCat
Specialist III

Hello

 

Message  "L1823: External object <Symbol Name> in <File Name> created by default" notify that you only have external declaration for the specified object but no formal definition.

 

You need to place the variable definition (without extern modifier) in a .c source file.

 

Also note that per default L1823 is a warning. So this should not prevent you from linking your application.

 

CrasyCat

0 项奖励
回复
1,035 次查看
CompilerGuru
NXP Employee
NXP Employee

Header files as mc9s08qe4.h typically only contain declarations, so I guess the issue here is that the corresponding *.c file (mc9s08qe4.c) is not added to the project.

 

Daniel

0 项奖励
回复