Coldfire C project converted to C++ compiles but doesn't link

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

Coldfire C project converted to C++ compiles but doesn't link

跳至解决方案
1,119 次查看
brainlilly
Contributor II

I'm trying to convert a project that was previously using only C code over to C++, have done all the necessary changes to remove all the errors and warnings from the compiler, only to be backhand slapped by linker errors.

pastedImage_1.png

Any ideas?

1 解答
985 次查看
brainlilly
Contributor II

Solved.

Had I remembered to include in all the previously used files, this would have been an non issue:


#ifdef __cplusplus
}
#endif

在原帖中查看解决方案

5 回复数
986 次查看
brainlilly
Contributor II

Solved.

Had I remembered to include in all the previously used files, this would have been an non issue:


#ifdef __cplusplus
}
#endif
985 次查看
BlackNight
NXP Employee
NXP Employee

From the error messages you are not linking with the correct set of libraries. For example _start() is defined in the ANSI C/C++ library. Can you check your library settings?

I hope this helps,

Erich

0 项奖励
回复
985 次查看
brainlilly
Contributor II

Thank you for your reply.

I'm trying to drag the project I'm working on from a CodeWarrior 7.1 project forward into at least CW 10.x, and to use C++, but there's nobody at the company I work for who has attempted this, so I'm on my own (and sorry for my ignorance on this). 

Maybe I'm missing what steps need taken to make this work.  Can you tell me what libraries I should be linking against?  Or is it some other library setting that I'm being dense to?

0 项奖励
回复
985 次查看
BlackNight
NXP Employee
NXP Employee

The easiest way is to create a new project for C++ in CW for MCU10.x and then add your application specifc source files.

pastedImage_1.png

I hope this helps,

Erich

0 项奖励
回复
985 次查看
brainlilly
Contributor II

Unfortunately, the option to enable C++ support isn't present for an MQX project, which, I know in hindsight that I didn't mention. ...

0 项奖励
回复