开发者

bjam runtime-link=static

I am trying to compile in a way such that the exec links to gcc statically. I presumed running bjam link=static runtime-link=static should do the trick ? When I tried that I get the following errors like :

...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

These don'开发者_JAVA百科t come when I run bjam link=static. Please advise ?


I belive that libstdc++ is intentionally not linked statically. Doing so is considered by many to be filled with peril (though I have not really heard a good reason). I do not think that there is a simple flag that you can add. For the gcc toolset you would add something like

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

to your cxxflags for your build variant.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜