In Eclipse, you will find it under the project properties > C/C++ Build > Settings > MinGW C++ Linker > Misc
You must add it to the "linker flags" at the top; nowhere else. Then just rebuild.

I have found that linking those statically explodes the size up to 1,400kb even with optimizations. It's 277kb larger compared to just copying over the shared DLLs. It's 388kb larger as well after UPXing everything. Very lose/lose here. Just include the DLLs as the end-user can decide to delete them or not if they have them installed elsewhere.
本文介绍了如何在 Eclipse 中为 C/C++ 项目设置静态链接,并讨论了静态链接对项目大小的影响。建议仅在必要时使用静态链接,以避免文件体积过大。
2万+

被折叠的 条评论
为什么被折叠?



