MinGW中G++编译简单代码时--enable-auto-import问题

来源:互联网 发布:springmvc源码 编辑:程序博客网 时间:2024/06/03 03:49

今天下载了MinGW试用了一下

写了下个c++代码

helloworld.cc

 

stime.h的内容如下

 

用最简单的g++ helloword.cc,编译成功但得到这些提示

Info: resolving std::cout  by linking to __imp___ZSt4cout (auto-import)
c:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: warning: a
uto-importing has been activated without --enable-auto-import specified on the c
ommand line.
This should work unless it involves constant data structures referencing symbols
 from auto-imported DLLs.

后来从网上找了一下原来用参数可以解决,

 

g++ -Wl,--enable-auto-import helloworld.cc -o helloword

 

好了,没有那个auto-import的提示了

 

 -Wl,<options>            Pass comma-separated <options> on to the linker (传递逗号分隔的选项给链接器)

 

原创粉丝点击