Adding MinGW/GCC C++ build configurations to projects with HCS08 build configurations

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

Adding MinGW/GCC C++ build configurations to projects with HCS08 build configurations

1,261 Views
gregbreen
Contributor I

I'm a long time Eclipse user, but a CW noob.

 

I have 3 existing Barebone HCS08 C projects (1 static library, 2 applications that each link the library). I want to add a second build configuration to each project. I want these second build configurations to build GCC/MinGW static libraries for each of the projects.

 

These libraries will then be linked into a new 4th MinGW/GCC project to make CppUTest executables for on-host unit testing. This 4th project is C++ because of the test harness.

 

Ideally I'd like to add the new build configurations such that they compile the C code using g++ not gcc. This prevents mangled names from appearing in gcov coverage reports. It also means I can do a bit of C++ template magic for mocking hardware registers.

 

So anyway, long story short is that CW is only letting me add MinGW C configurations, not MinGW C++ configurations. I can create a new MinGW C++ project in the workspace no problem, but not add a MinGW C++ build configuration to an existing HCS08 Barebone project. I don't understand why, and can't figure out a way around it. Any ideas?

Labels (1)
Tags (2)
0 Kudos
2 Replies

739 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

you mentioned, "I can create a new MinGW C++ project in the workspace no problem". how to?

and can you upload this project to this thread? thanks!

0 Kudos

739 Views
gregbreen
Contributor I

At the time I wrote that, I was just doing New Project->Makefile Project With Existing Code, and selecting MinGW as the toolchain.

I progressed a long way since then. You can de-nobble CodeWarrior, and restore MinGW/x86 capabilities as follows:

Window->Preferences->General->Capabilities->Advanced->Development and select "Generic C/C++ GNU Development".

Now you'll be able to create MinGW/x86 C++ Projects when you create a new project. And run GDB to debug x86 executables.

For my initial question, I ended up sticking with building the libraries as MinGW C (not C++) libs, and building my unit test x86 executables as C++, linking the C libraries. I had to stub hardware registers in C, not using C++ template magic - this was unfortunate, but tolerable.

So I can now build my code as target applications, or build it for on-host unit testing. I have CppUTest, GCov, pmccabe, Doxygen, (and soon FlexeLint) all integrated into my build configurations within Code Warrior. Also got Git and Atlassian Connector in my CodeWarrior.

0 Kudos