小编Eri*_*ski的帖子

在 64 位 Ubuntu 上编译 x32 位 LD_PRELOAD

我正在尝试在 x64 平台(Ubuntu)上编译 x32 LD_PRELOAD,我的命令:

g++ -fPIC -m32  -shared -Wl,-soname,test.so -ldl -o test.so test.cpp
Run Code Online (Sandbox Code Playgroud)

但我收到错误:

/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)

我该如何解决?谢谢!

c++ 64-bit compilation ld-preload

1
推荐指数
1
解决办法
956
查看次数

标签 统计

64-bit ×1

c++ ×1

compilation ×1

ld-preload ×1