bjam 运行时链接=静态
我正在尝试以一种方式进行编译,以便 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
时,这些错误不会出现。 请指教 ?
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't come when I run bjam link=static
.
Please advise ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信 libstdc++ 是故意不静态链接的。许多人认为这样做充满危险(尽管我还没有真正听到一个好的理由)。我不认为您可以添加一个简单的标志。对于 gcc 工具集,您可以
为您的构建变体添加类似于 cxxflags 的内容。
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
to your cxxflags for your build variant.