惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Vercel News
Vercel News
N
Netflix TechBlog - Medium
C
Check Point Blog
MyScale Blog
MyScale Blog
The GitHub Blog
The GitHub Blog
Blog — PlanetScale
Blog — PlanetScale
B
Blog RSS Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
WordPress大学
WordPress大学
博客园 - Franky
MongoDB | Blog
MongoDB | Blog
I
InfoQ
Hugging Face - Blog
Hugging Face - Blog
Recent Announcements
Recent Announcements
人人都是产品经理
人人都是产品经理
腾讯CDC
V
Visual Studio Blog
Engineering at Meta
Engineering at Meta
T
The Blog of Author Tim Ferriss
V
V2EX
云风的 BLOG
云风的 BLOG
Microsoft Azure Blog
Microsoft Azure Blog
U
Unit 42
B
Blog

博客园 - 步青云

comfyui一次成功的抽卡 在 MySQL 5.7 中实现每月手动创建分区 tp5设置log文件输出 微信小程序连接websocket随记 命令提示符 在win64上使用bypy进行百度网盘文件上传 phpqrcode生成任意尺寸的二维码 Visual Studio 2017 安装心得 用火车头采集器8.6免费版采集图片 为了android sdk下载,必须修改hosts win2003服务器网站和数据库的二周自动备份 ultraedit去空行 用Navicat for MySQL进行数据库的导入导出 尝试jquery插件的开发 移动硬盘数据惊魂恢复记 用C#的控制台程序监控apache网站是否正常 织梦内容管理系统 4_0_1 的rand()优化 FlashDevelop的第一个程序 RHEL6下编译Mplayer Linux下第一个C程序
用SciTE调试C++程序遇到的小问题
步青云 · 2011-04-15 · via 博客园 - 步青云

用SciTE写了一个简单的C++程序,也安装了MinGW。

#include <iostream>
int main()
{
std::cout
<< "Hello World!\n";
return 0;
}

按F5调试却出现错误:

Info: resolving std::cout  by linking to __imp___ZSt4cout

后来从网上找了一下原因,原来用参数可以解决,
g++ -Wl,--enable-auto-import helloworld.cc -o helloword

打开SciTE->选项->cpp.properties里找到

ccopts=-pedantic -Os

修改为

ccopts=-Wl,--enable-auto-import -pedantic -Os

呵呵,再按F5,警告错误不见了。

>g++ -Wl,--enable-auto-import -pedantic -Os  Motto.cpp -o Motto
>Exit code: 0
>./Motto
Hello World!
>Exit code: 0



注:-pedantic编译选项并不能保证被编译程序与ANSI/ISO C标准完全兼容