Results 1 to 2 of 2

Thread: Setting up googletest in opensuse 42.1, problem with compiling

  1. #1

    Default Setting up googletest in opensuse 42.1, problem with compiling

    Greetings,

    So i tried to use the googletest library ( https://github.com/google/googletest ). First I compiled it with cmake:


    Code:
    marton@linux-clwa:~/documents/github/googletest/googletest/cmake> cmake ..
    -- The CXX compiler identification is GNU 4.8.5
    -- The C compiler identification is GNU 4.8.5
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Found PythonInterp: /usr/local/bin/python (found version "3.4.5")  
    -- Looking for include file pthread.h
    -- Looking for include file pthread.h - found
    -- Looking for pthread_create
    -- Looking for pthread_create - not found
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Found Threads: TRUE   
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/marton/documents/github/googletest/googletest/cmak
    e
    marton@linux-clwa:~/documents/github/googletest/googletest/cmake> make
    Scanning dependencies of target gtest
    [ 25%] Building CXX object CMakeFiles/gtest.dir/src/gtest-all.cc.o
    [ 50%] Linking CXX static library libgtest.a
    [ 50%] Built target gtest
    Scanning dependencies of target gtest_main
    [ 75%] Building CXX object CMakeFiles/gtest_main.dir/src/gtest_main.cc.o
    [100%] Linking CXX static library libgtest_main.a
    [100%] Built target gtest_main
    
    and I tried to use it in cpp file:
    Code:
    g++ 002.razd_razl.cpp -
    I/home/marton/documents/github/googletest/googletest/include -L/home/marton/documents/github/
    googletest/googletest/lib -lgtest -lpthread
    
    Error:
    Code:
    /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: cannot find -lgtes
    t
    
    installed some packages from preious threads :
    gcc-32bit gcc48-32bit glibc-devel-32bit libasan0-32bit libatomic1-32bit libgomp1-32bit
    libitm1-32bit
    but nothing helped.

    Any idea what is happening and how to fix it ?

  2. #2
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,823
    Blog Entries
    1

    Default Re: Setting up googletest in opensuse 42.1, problem with compiling

    From what you posted, it's almost certain that your test command uses incorrect syntax.

    More than likely you should be specifying something else or nothing at all instead of -lgtest and also -ipthread.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •