I am trying to run some simple gtest tests on an AIX machine:
#include <gtest/gtest.h>
int add(int a, int b) {
return a + b;
}
// Test case to check addition function
TEST(AdditionTest, PositiveNumbers) {
EXPECT_EQ(add(2, 3), 5);
EXPECT_EQ(add(-2, 3), 1);
EXPECT_EQ(add(-2, -3), -5);
}
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
$path looks like:
/usr/bin /etc /usr/sbin /usr/ucb /usr/bin/X11 /sbin /usr/java5/jre/bin /usr/java5/bin /usr/local/bin /mei_commands /wcsbin/com /wcsbin /opt/freeware/bin /usr/local/bin /bin /usr/bin /etc /usr/etc /rgti/test/bin /rgti/test/com /opt/freeware/include/gtest/ /opt/freeware/include
swarnagowri.bs > which cc
/usr/bin/cc
swarnago @ wcsdev:/home/mouser.lan/ganesh.shinde/wcs/libproj
swarnagowri.bs > uname -a
AIX wcsdev 2 7 00C995884C00
Here is the command we are running to get it compiled:
cc hello_world.cpp /usr/lib/libC.a /opt/freeware/lib/libgtest.a /opt/freeware/lib/libgtestmain.a
But I keep getting:
"hello_world.cpp", line 2.10: 1540-0836 (S) The #include file <gtest/gtest.h> is not found.
Could you please help – thanks!