2012-09-02 80 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