Link error undefined _exception_table_end__

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

Link error undefined _exception_table_end__

跳至解决方案
1,099 次查看
wcampbell
Contributor I

I'm looking to pull in some c++ code into a c project in Codewarrior 10.3. The project built and ran fine before I added the new code, but now when I build I get a vague link error that says:

 

>Undefined : "_exception_table_end__"

>Referenced from "Ex68K_FindExceptionRecord(char*,MWExceptionInfo*)" in

C:/Freescale/CW MCU v10.3/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Linker|Error

>Undefined : "_exception_table_start__"

>Referenced from "Ex68K_FindExceptionRecord(char*,MWExceptionInfo*)" in

C:/Freescale/CW MCU v10.3/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Linker|Error

>Link failed.

 

The issue seems to be related to my use of "new" in one of my wrapper functions.

 

I have -Cpp_Exceptions OFF, since I'm not using them anywhere in my c++ code (and turning then on didn't affect the error). Are there some settings I need to enable/disable? I'm fairly new to mixing c and c++, so I may be missing something obvious.

Thanks.

标签 (1)
0 项奖励
回复
1 解答
908 次查看
Carlos_Musich
NXP Employee
NXP Employee

Hi!

These are linker generated names used in conjunction with STATICINIT and EXCEPTION directives in the linker command file (LCF). Open up a C++ default project and you'll see how they're used MCU_ColdFire_Compiler.pdf also has information about it. You can find this document in
C:\Freescale\CW MCU v10.3\MCU\Help\PDF


Basically it means that you apparently took a C rather than C++ lcf and the output binary has no C++ exception handling or static initialization support in it, which is obviously wrong. However, if you are trying to compile with an LCF for RAM which does not contain those symbols, please change your target to Flash and the project will eventually be correctly linked .

Hope this helps.

Carlos

在原帖中查看解决方案

0 项奖励
回复
1 回复
909 次查看
Carlos_Musich
NXP Employee
NXP Employee

Hi!

These are linker generated names used in conjunction with STATICINIT and EXCEPTION directives in the linker command file (LCF). Open up a C++ default project and you'll see how they're used MCU_ColdFire_Compiler.pdf also has information about it. You can find this document in
C:\Freescale\CW MCU v10.3\MCU\Help\PDF


Basically it means that you apparently took a C rather than C++ lcf and the output binary has no C++ exception handling or static initialization support in it, which is obviously wrong. However, if you are trying to compile with an LCF for RAM which does not contain those symbols, please change your target to Flash and the project will eventually be correctly linked .

Hope this helps.

Carlos

0 项奖励
回复