Ubuntu 18.04: No CMAKE_C_COMPILER could be found












0















I am trying to install gtest from Google but even though I have gcc and g++ installed, I get this error for some reason. I am on Ubuntu 18.04 64 bit. And I don't have anything to do with Visual Studio stuff.



-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:47 (project):
No CMAKE_C_COMPILER could be found.

Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!
See also "/usr/src/googletest/googletest/CMakeFiles/CMakeOutput.log".
See also "/usr/src/googletest/googletest/CMakeFiles/CMakeError.log".


This is there:



$ gcc --version
gcc (GCC) 6.4.0

$ g++ --version
g++ (GCC) 6.4.0


and this:



user@user:/usr/src/gtest$ whereis g++
g++: /usr/bin/g++ /usr/share/man/man1/g++.1.gz
user@user:/usr/src/gtest$ whereis gcc
gcc: /usr/bin/gcc /usr/lib/gcc /usr/local/cuda-9.0/bin/gcc /usr/share/man/man1/gcc.1.gz


also:



user@user:/usr/src/gtest$ ls -la /usr/bin | grep gcc-6.4
lrwxrwxrwx 1 root root 16 Nov 12 14:47 gcc -> /usr/bin/gcc-6.4


user@user:/usr/src/gtest$ ls -la /usr/bin | grep g++-6
lrwxrwxrwx 1 root root 14 Nov 12 14:51 g++ -> /usr/bin/g++-6
lrwxrwxrwx 1 root root 22 Apr 24 2018 g++-6 -> x86_64-linux-gnu-g++-6
-rwxr-xr-x 1 root root 953176 Apr 24 2018 x86_64-linux-gnu-g++-6


Given all this, does anyone have a clue?



Thanks in advance.



UPDATE: This seems to have worked:



Okay, this seems to be working:



cmake -D CMAKE_C_COMPILER="/usr/local/cuda-9.0/bin/gcc " -D CMAKE_CXX_COMPILER="/usr/bin/g++" /usr/src/gtest/CMakeLists.txt


which apparently points to the gcc used cuda. Is there a way of setting the one under /usr/bin/ as the default one?










share|improve this question





























    0















    I am trying to install gtest from Google but even though I have gcc and g++ installed, I get this error for some reason. I am on Ubuntu 18.04 64 bit. And I don't have anything to do with Visual Studio stuff.



    -- The C compiler identification is unknown
    CMake Error at CMakeLists.txt:47 (project):
    No CMAKE_C_COMPILER could be found.

    Tell CMake where to find the compiler by setting either the environment
    variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
    the compiler, or to the compiler name if it is in the PATH.


    -- Configuring incomplete, errors occurred!
    See also "/usr/src/googletest/googletest/CMakeFiles/CMakeOutput.log".
    See also "/usr/src/googletest/googletest/CMakeFiles/CMakeError.log".


    This is there:



    $ gcc --version
    gcc (GCC) 6.4.0

    $ g++ --version
    g++ (GCC) 6.4.0


    and this:



    user@user:/usr/src/gtest$ whereis g++
    g++: /usr/bin/g++ /usr/share/man/man1/g++.1.gz
    user@user:/usr/src/gtest$ whereis gcc
    gcc: /usr/bin/gcc /usr/lib/gcc /usr/local/cuda-9.0/bin/gcc /usr/share/man/man1/gcc.1.gz


    also:



    user@user:/usr/src/gtest$ ls -la /usr/bin | grep gcc-6.4
    lrwxrwxrwx 1 root root 16 Nov 12 14:47 gcc -> /usr/bin/gcc-6.4


    user@user:/usr/src/gtest$ ls -la /usr/bin | grep g++-6
    lrwxrwxrwx 1 root root 14 Nov 12 14:51 g++ -> /usr/bin/g++-6
    lrwxrwxrwx 1 root root 22 Apr 24 2018 g++-6 -> x86_64-linux-gnu-g++-6
    -rwxr-xr-x 1 root root 953176 Apr 24 2018 x86_64-linux-gnu-g++-6


    Given all this, does anyone have a clue?



    Thanks in advance.



    UPDATE: This seems to have worked:



    Okay, this seems to be working:



    cmake -D CMAKE_C_COMPILER="/usr/local/cuda-9.0/bin/gcc " -D CMAKE_CXX_COMPILER="/usr/bin/g++" /usr/src/gtest/CMakeLists.txt


    which apparently points to the gcc used cuda. Is there a way of setting the one under /usr/bin/ as the default one?










    share|improve this question



























      0












      0








      0








      I am trying to install gtest from Google but even though I have gcc and g++ installed, I get this error for some reason. I am on Ubuntu 18.04 64 bit. And I don't have anything to do with Visual Studio stuff.



      -- The C compiler identification is unknown
      CMake Error at CMakeLists.txt:47 (project):
      No CMAKE_C_COMPILER could be found.

      Tell CMake where to find the compiler by setting either the environment
      variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
      the compiler, or to the compiler name if it is in the PATH.


      -- Configuring incomplete, errors occurred!
      See also "/usr/src/googletest/googletest/CMakeFiles/CMakeOutput.log".
      See also "/usr/src/googletest/googletest/CMakeFiles/CMakeError.log".


      This is there:



      $ gcc --version
      gcc (GCC) 6.4.0

      $ g++ --version
      g++ (GCC) 6.4.0


      and this:



      user@user:/usr/src/gtest$ whereis g++
      g++: /usr/bin/g++ /usr/share/man/man1/g++.1.gz
      user@user:/usr/src/gtest$ whereis gcc
      gcc: /usr/bin/gcc /usr/lib/gcc /usr/local/cuda-9.0/bin/gcc /usr/share/man/man1/gcc.1.gz


      also:



      user@user:/usr/src/gtest$ ls -la /usr/bin | grep gcc-6.4
      lrwxrwxrwx 1 root root 16 Nov 12 14:47 gcc -> /usr/bin/gcc-6.4


      user@user:/usr/src/gtest$ ls -la /usr/bin | grep g++-6
      lrwxrwxrwx 1 root root 14 Nov 12 14:51 g++ -> /usr/bin/g++-6
      lrwxrwxrwx 1 root root 22 Apr 24 2018 g++-6 -> x86_64-linux-gnu-g++-6
      -rwxr-xr-x 1 root root 953176 Apr 24 2018 x86_64-linux-gnu-g++-6


      Given all this, does anyone have a clue?



      Thanks in advance.



      UPDATE: This seems to have worked:



      Okay, this seems to be working:



      cmake -D CMAKE_C_COMPILER="/usr/local/cuda-9.0/bin/gcc " -D CMAKE_CXX_COMPILER="/usr/bin/g++" /usr/src/gtest/CMakeLists.txt


      which apparently points to the gcc used cuda. Is there a way of setting the one under /usr/bin/ as the default one?










      share|improve this question
















      I am trying to install gtest from Google but even though I have gcc and g++ installed, I get this error for some reason. I am on Ubuntu 18.04 64 bit. And I don't have anything to do with Visual Studio stuff.



      -- The C compiler identification is unknown
      CMake Error at CMakeLists.txt:47 (project):
      No CMAKE_C_COMPILER could be found.

      Tell CMake where to find the compiler by setting either the environment
      variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
      the compiler, or to the compiler name if it is in the PATH.


      -- Configuring incomplete, errors occurred!
      See also "/usr/src/googletest/googletest/CMakeFiles/CMakeOutput.log".
      See also "/usr/src/googletest/googletest/CMakeFiles/CMakeError.log".


      This is there:



      $ gcc --version
      gcc (GCC) 6.4.0

      $ g++ --version
      g++ (GCC) 6.4.0


      and this:



      user@user:/usr/src/gtest$ whereis g++
      g++: /usr/bin/g++ /usr/share/man/man1/g++.1.gz
      user@user:/usr/src/gtest$ whereis gcc
      gcc: /usr/bin/gcc /usr/lib/gcc /usr/local/cuda-9.0/bin/gcc /usr/share/man/man1/gcc.1.gz


      also:



      user@user:/usr/src/gtest$ ls -la /usr/bin | grep gcc-6.4
      lrwxrwxrwx 1 root root 16 Nov 12 14:47 gcc -> /usr/bin/gcc-6.4


      user@user:/usr/src/gtest$ ls -la /usr/bin | grep g++-6
      lrwxrwxrwx 1 root root 14 Nov 12 14:51 g++ -> /usr/bin/g++-6
      lrwxrwxrwx 1 root root 22 Apr 24 2018 g++-6 -> x86_64-linux-gnu-g++-6
      -rwxr-xr-x 1 root root 953176 Apr 24 2018 x86_64-linux-gnu-g++-6


      Given all this, does anyone have a clue?



      Thanks in advance.



      UPDATE: This seems to have worked:



      Okay, this seems to be working:



      cmake -D CMAKE_C_COMPILER="/usr/local/cuda-9.0/bin/gcc " -D CMAKE_CXX_COMPILER="/usr/bin/g++" /usr/src/gtest/CMakeLists.txt


      which apparently points to the gcc used cuda. Is there a way of setting the one under /usr/bin/ as the default one?







      gcc g++ ubuntu-18.04






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 13 '18 at 11:52







      Schütze

















      asked Nov 13 '18 at 10:13









      SchützeSchütze

      126525




      126525
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53278637%2fubuntu-18-04-no-cmake-c-compiler-could-be-found%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53278637%2fubuntu-18-04-no-cmake-c-compiler-could-be-found%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Florida Star v. B. J. F.

          Error while running script in elastic search , gateway timeout

          Adding quotations to stringified JSON object values