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

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

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

Jump to solution
1,314 Views
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 Solution
1,180 Views
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

View solution in original post

5 Replies
1,181 Views
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
1,180 Views
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 Kudos
Reply
1,180 Views
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 Kudos
Reply
1,180 Views
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 Kudos
Reply
1,180 Views
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 Kudos
Reply