静态链接库asan与gcc 4.8

问题描述 投票:0回答:1

我正在使用gcc 4.8.3以这种方式编译我的测试可执行文件:

gcc -o test -g -L/lib64 -fsanitize=address -static-libasan

结果:

/usr/bin/ld: cannot find -lasan
collect2: error: ld returned 1 exit status

Libasan已安装,如果我编译没有静态选项,它可以工作。如何静态编译库?

gcc linker linker-errors gcc4.8 address-sanitizer
1个回答
1
投票

您需要安装特殊包来获取静态GCC库。在Ubuntu你应该这样做

$ sudo apt-get install libgcc-4.8-dev
© www.soinside.com 2019 - 2024. All rights reserved.