google test and gmock on Aix #3559
Unanswered
istvangonczi
asked this question in
Community Help
Replies: 1 comment
-
how do we compile a gtest program on AIX? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Just a quick note, I was able to figure out how to get google test and google mock compiling on Aix using g++, and I give a quick summary here:
This was done on Aix 6.1, using the IBM freeware yum installable gcc 8.3 toolchain. The same should work on higher Aix versions as well. I have 7.1 and 7.2 available. will try it on 7.2 in a bit.
On Aix, the gcc 8.3 compiler has an unusual behavior, which is different from (e.g.) Linux:
Any include locations given with the -isystem compiler option will cause all includes found there to be silently wrapped in
extern "C" { .... }.
Some of the gtest/gmock include files do contain templates, which are not supported inside extern"C" sections. Templates must rely on decorations, which are turned off when C linkage rules are in effect. The large number of resulting errors are all stemming from these silent extern "C"-s not playing well with templates. Again, these gcc introduced extern "C" { -s are not visible, so you would not be able to see these using find/grep.
The solution: change all -isystem directives to -I (capital I) directives. Feel free to ask questions.
Hopefully this makes it easier for some folks to run gtest and gmock on Aix.
Cheers
Steve Gonczi
Beta Was this translation helpful? Give feedback.
All reactions