Cannot find C/C++ Compiler

Aiko
Aiko Altair Community Member
edited December 2020 in Community Q&A

Hello,

 

a couple days ago i got the error message 'Simulation Error: Cannot find C/C++ Compiler'.

I downloaded the visual studio installer and installed all compilers needed. After that my simulation worked again.

 

Today i got the same error message again.

When i try to get the compiler path with 'vssGetCompilerPath' in the oml command box i just get the error message 'Cannot find the C/C++ compiler in call to function...'

 

How can i setup Activate so it finds the installed compiler?

 

Greetings,

Aiko

Welcome!

It looks like you're new here. Sign in or register to get started.

Answers

  • Fady Nassif_21652
    Fady Nassif_21652
    Altair Employee
    edited July 2020

    Hello ,

    Activate detects automatically the installed compiler  by accessing the windows registry. 

    Above error means that there is an issue while detecting the compiler, if you don't have any compiler, the function will return tcc; the compiler distributed with Activate.

    Before digging to understand the issue, I will do the following tests:

    1. I will verify the COMSPEC environment variable to make sure that it points to the cmd command. To do so, you can do the following in the OML command window: getenv('COMSPEC')
    2. I will check that c++ compiler is correctly installed.
      1. Open a cmd, 
      2. Execute the vcvarsall.bat  with the argument amd64.
      3. cl --version.

    Thanks

    Fady

     

  • Aiko
    Aiko Altair Community Member
    edited July 2020

    Hello,

     

    1. i get ans = C:\WINDOWS\system32\cmd.exe

     

    so i think this is right?

     

    2. i get the message 'The command 'vcvarsall.bat' is typed wrong or could not be found' and 'The command 'cl' is typed wrong or could not be found'

     

    Thanks

    Aiko

     

    <?xml version="1.0" encoding="UTF-8"?>cmd.PNG

    <?xml version="1.0" encoding="UTF-8"?>comspec.PNG

  • RoKet
    RoKet
    Altair Employee
    edited July 2020

    I get the same messages, but my compiler is working in Activate.

  • Aiko
    Aiko Altair Community Member
    edited July 2020

    I tried reinstalling visual studio but it still doesnt work.

     

    Maybe there is some other issue with my Activate?

    When execute the 'vssGetCompilerName' i get the error message in the screenshot below, and not the 'tcc' line as it is stated in the 'Compiler Installation Guide'

     

    Greetings,

    Aiko

    <?xml version="1.0" encoding="UTF-8"?>compiler.PNG

    <?xml version="1.0" encoding="UTF-8"?>Unbenannt.PNG

  • Aiko
    Aiko Altair Community Member
    edited July 2020

    I tried reinstalling visual studio once again and for whatever reason my simulation works again.

     

    Thanks.

    Aiko

  • Fady Nassif_21652
    Fady Nassif_21652
    Altair Employee
    edited July 2020

    Hello Aiko,

     

    Sorry when I mentionned that you need to execute the vcvarsall.bat I had to mention where you can find this file it is distribute with visual studio.

    Which version of the compiler are you using?

    Did you at some point change the sdk version of the compiler or intalled another sdk version?

    Do you have multiple visual compilers installed?

     

    Thanks

    Fady

     

  • Aiko
    Aiko Altair Community Member
    edited July 2020

    Hello Fady,

     

    because i'm not that experienced with in depth compiler issues, i just followed the installation guide from this pdf.

    I did not change the sdk version, i just downloaded and installed the visual studio buildtools as mentioned in the guide.

     

    After reinstallation my Activate worked again. But today (i changed nothing related to the compiler) i get the same 'Cannot find C/C++ Compiler' error message.

    It's really confusing for me, because i did not change any settings.

    Is there a way to set the Compiler path directly in activate?

     

    Greetings,

    Aiko

    Unable to find an attachment - read this blog

  • Patrick Goulding_21563
    Patrick Goulding_21563 New Altair Community Member
    edited December 2020

    Hello Aiko,

     

    Are you still experiencing this issue?  I've created a Tip and Trick (attached) which I believe gives the simplest steps for installing a C/C++ compiler that will be automatically recognized by Activate.  Please let me know if this helps, or if you are still experiencing recognition failure please provide me the version of Activate you are running.

     

    Take care,

    Patrick

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.