Help using pbds!!

Revision en4, by deque, 2021-01-19 08:46:31

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?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English deque 2021-01-19 08:46:31 6 Tiny change: 'r -lasan\ncollect2' -> 'r -lasan\n`\n`\ncollect2'
en3 English deque 2021-01-19 08:46:11 4
en2 English deque 2021-01-19 08:45:27 54
en1 English deque 2021-01-19 08:44:46 793 Initial revision (published)