So i decided to use CMake as that is recommended by Google tests...
Hey experts,
Am trying to setup and run Google Tests.
I did the following on my Mac
b) Unzip and build google test
$ unzip gtest-1.6.0.zip
$ cd gtest-1.6.0
$ ./configure
$ make
c) "Install" the headers and libs on your system
$ sudo cp -a include/gtest /usr/include
$ sudo cp -a lib/.libs/* /usr/lib/d) "Install" the headers and libs.
I see a libs/.libs folder with the libraries = libgtest.dylib and other files.e) Start compile
The compiling goes ok. But am facing crazy Linker issues. Here is the output
mac-kmallick-01:mtxtests bmctiac$ make -f Makefile.newWay
echo linking /AC/H/tools/mtxtests/build/unix/macosx/debug/mtxtests for unix/macosx/debug ; \
sh -c ' gcc -o /AC/H/tools/mtxtests/build/unix/macosx/debug/mtxtests /AC/H/tools/mtxtests/build/unix/macosx/debug/ACBaseTest.o /AC/H/tools/mtxtests/build/unix/macosx/debug/XmlLibTest.o /AC/H/tools/mtxtests/build/unix/macosx/debug/TestCase1.o /AC/H/tools/mtxtests/build/unix/macosx/debug/main.o /AC/H/library/src/MtxLib/build/unix/macosx/debug/libMtx.so -execute -execute -m32 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -fPIC -fvisibility=hidden -g -lpthread -ldl -lstdc++ -lpam /AC/H/tools/googletests/lib/.libs/libgtest_main.0.dylib' ; \
linking /AC/H/tools/mtxtests/build/unix/macosx/debug/mtxtests for unix/macosx/debug
ld: warning: ignoring file /AC/H/tools/googletests/lib/.libs/libgtest_main.0.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /AC/H/tools/googletests/lib/.libs/libgtest_main.0.dylib
Undefined symbols for architecture i386:
"testing::InitGoogleTest(int*, char**)", referenced from:
_main in main.o
"testing::AssertionResult::AssertionResult(testing::AssertionResult const&)", referenced from:
...
...
...
I get a whole bunch of Linker errors.
Can anyone help?
Id appreciate a response.