1

execがgcc静的にリンクするような方法でコンパイルしようとしています。私は走るbjam link=static runtime-link=staticことがトリックをするべきだと思いましたか?これを試してみると、次のようなエラーが発生します。

...failed gcc.link TGT/bin/gcc-4.5.1/debug/link-static/runtime-link-static/datagen...
gcc.compile.c++ TGT/bin/gcc-4.5.1/release/link-static/runtime-link-static/base_data_gen.o
gcc.link TGT/bin/gcc-4.5.1/release/link-static/runtime-link-static/datagen
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status

私が走ったとき、これらは来ませんbjam link=static。お知らせ下さい ?

4

1 に答える 1

0

私は、libstdc++が意図的に静的にリンクされていないことを信じています。そうすることは多くの人に危険に満ちていると考えられています(私は本当に正当な理由を聞いたことがありませんが)。追加できる簡単なフラグはないと思います。gccツールセットの場合、次のようなものを追加します

-static-libgcc  -Wl,-Bstatic -lstdc++

ビルドバリアントのcxxflagsに。

于 2011-03-23T02:11:31.893 に答える