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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

ソリューションへジャンプ
1,118件の閲覧回数
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 解決策
984件の閲覧回数
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 返答(返信)
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
984件の閲覧回数
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 件の賞賛
返信
984件の閲覧回数
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 件の賞賛
返信
984件の閲覧回数
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 件の賞賛
返信
984件の閲覧回数
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 件の賞賛
返信