MinGW中G++编译简单代码时--enable-auto-import问题
2010-09-29 16:27
501 查看
今天下载了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 (传递逗号分隔的选项给链接器)
写了下个c++代码
helloworld.cc
#include <iostream> #include "stime.h" int main(){ Time t; PTime pt=&t; pt->hour=1; pt->minute=3; pt->second=6; std::cout<<"Hello World"<<std::endl; std::cout<<pt->hour<<pt->minute<<pt->second; return 0; }
stime.h的内容如下
//stime.h typedef int HOUR; typedef int MINUTE; typedef int SECOND; typedef struct STime{ HOUR hour; MINUTE minute; SECOND second; }Time,*PTime;
用最简单的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 (传递逗号分隔的选项给链接器)
相关文章推荐
- g++编译C++11遇到的问题:Enable multithreading to use std::thread: Operation not permitted
- sublime text 3+mingw编译代码时错误提示:g++:error:No Such FIle or directory(已解决)
- 在mingw/GNU上编译opengl代码问题
- 请求高人帮我看下代码,编译没有错,运行出问题 关于简单文本编辑器的
- 关于cmake+mingw+yasm+vs 生成工程 编译代码问题总结
- 使用EditPlus工具进行简单的C#代码编译和测试
- 《directx游戏开发终极指南》光盘中代码编译失败的三个问题
- qt编译代码时出现C4819 警告的问题解决
- 最简单的0-1背包问题c++代码实例及运行结果
- 转载部分代码,窗口点击问题,顺序,初始化数组,简单结构体
- MinGW编译的EXE需要DLL的问题
- 新路程------编译海思代码遇到的问题
- 《unix环境高级编程》书中源代码编译问题解决
- 在Linux平台上搭建EasyDarwin,编译代码并简单部署
- 关于svn上传的代码每个java文件上都出现class问件暨代码编译路径的若干问题
- 【问题一】notepad++编辑器写Java代码,无法编译出现错误:编码GBK的不可映射字符
- 关于一个asp的简单聊天室的代码问题
- 使用命令行方式编译java代码时主类无法加载的问题
- 编译《Pedestrian detection at 100 frames per second 》代码遇到的问题与解决方法
- 问题1:java中没有实现这种“byte a = 0xB2 --> String b = “B2””转换的简单实现需要自己实现。 答:自己编写的转换函数,思路将byte的高低4位分开,分别转换为对应的字符然后合成返回的字符串。 java 代码 1.