agrawal-d/cph

Giving error in gcd function

Prashant0664 opened this issue · 2 comments

I downloaded the extension just now, on running testcase, it is showing the error that gcd is undeclared. I tried using __gcd(), std::__gcd(), std::gcd(), gcd() but same problem is occurring, but code is running fine in Local Terminal.

image

Am i missing something in setup?

Extension Version: 6.1.0

VS Code Version: 1.86.2

Browser Version: Not using in browser, using in vs-code

Operating System: Apple Sonoma 64 Arch

check the clang --version in terminal. If the below is true, then you may try my settings which resolved the issue:

Apple clang version 15.0.0 (clang-1500.1.0.2.5)

Follow the below steps:

  1. Go to settings in VSCode.
  2. Type in the search @ext:DivyanshuAgrawal.competitive-programming-helper
  3. Under cpp: Args -std=c++17 -stdlib=libc++
  4. Under cpp:command: clang++
  5. cpp:submission complier: GNU G++20 11.2.0 (64 bit, winlibs)

It will work as expected and note that __gcd() still doesn't work. But gcd() is working as expected.

Thanks @imeanup , it worked perfectly. Closing this issue.