Skip to content

Support for mixed C/C++ environment#570

Merged
mvandervoord merged 1 commit intoThrowTheSwitch:masterfrom
DanieleNardi:ExternCedIncludes
Jul 15, 2021
Merged

Support for mixed C/C++ environment#570
mvandervoord merged 1 commit intoThrowTheSwitch:masterfrom
DanieleNardi:ExternCedIncludes

Conversation

@DanieleNardi
Copy link
Contributor

I'm working on a mixed C and C++ project, in particular I'm integrating a third party C-language library to our C++ base code. I wrote a couple of failing test cases, generated mocks with CMocks, generated runner with Unity and compiled: g++ for C++, gcc for C. Linking failed, whether I compile runner with gcc or g++.
The problem was on the runner generation process, which gets the headers included in my C++ file into the runner, so linker can't find proper associations.
I solved the issue adding a new option into generate runner script, "externcincludes", that allow to add the extern "C" { } around unity and cmock header files, then compile runner with g++.

@mvandervoord mvandervoord merged commit aeed24c into ThrowTheSwitch:master Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants