2012-09-02 105 views

回答

2

的克++開關應該是

-static 

參見 http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html

-static 
     On systems that support dynamic linking, this prevents linking with 
    the shared libraries. On other systems, this option has no effect. 

爲了獲得更多的幫助,如果這不適合你,你應該發佈命令行,以便編譯/鏈接。

+0

如果您只是鏈接.o文件以供重用,並且得到'main'丟失的錯誤,您可能還需要添加'-nostartfiles' – xorcus