Блог пользователя deque

Автор deque, история, 3 года назад, По-английски

Hi,

I recently encountered some problems that require the use of gnu_pbds. I'm using MacOS, so I installed gcc separately using homebrew

brew install gcc

Then I compiled my code using g++-10 code.cpp -std=c++14 -o run

It works perfectly. But then I want to add address sanitizer, so I change to g++-10 code.cpp -fsanitize=address -std=c++14 -o run

But I keep getting this error ld: library not found for -lasan collect2: error: ld returned 1 exit status

I tried installing and running different versions of gcc, but every time it says the address sanitizer library not found. I googled online and can't find an answer. Does anyone know what's going on and what's causing the issue?

  • Проголосовать: нравится
  • +9
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

Try this

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится +3 Проголосовать: не нравится

    yea, I tried it doesn't work. -lasan gives the same result. I don't know, is there a way to manually install this ASan library? I thought it comes with gcc

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится +3 Проголосовать: не нравится

    Thank you tho

»
3 года назад, # |
  Проголосовать: нравится +11 Проголосовать: не нравится

Try upgrading to gcc-10.2.0_3 or newer.

I had been experiencing the same issue for a few weeks too, and it's finally fixed today when I ran brew upgrade.

»
2 года назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

nevermind, that doesn't work