- 浏览: 84391 次
- 性别:
- 来自: 北京
文章分类
最新评论
一个简单的vector 的c++ 程序, 编译错误
#include <vector>
int main()
{
std::vector<int> vet;
}
错误原因:使用的gcc 命令(应该使用g++命令)
gcc :
“GCC” is a common shorthand term for the GNU Compiler Collection. This is both the most general name for the compiler, and the name used when the emphasis is on compiling C programs (as the abbreviation formerly stood for “GNU C Compiler”).
使用gcc 编译c++程序,虽然gcc也能识别出c++,但gcc并不会加载c++ library
g++:
而使用g++ 编译c++程序,会调用gcc而且会自动加载c++ library
please refer:
* http://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/G_002b_002b-and-GCC.html
* man g++
#include <vector>
int main()
{
std::vector<int> vet;
}
错误原因:使用的gcc 命令(应该使用g++命令)
gcc :
“GCC” is a common shorthand term for the GNU Compiler Collection. This is both the most general name for the compiler, and the name used when the emphasis is on compiling C programs (as the abbreviation formerly stood for “GNU C Compiler”).
使用gcc 编译c++程序,虽然gcc也能识别出c++,但gcc并不会加载c++ library
g++:
而使用g++ 编译c++程序,会调用gcc而且会自动加载c++ library
please refer:
* http://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/G_002b_002b-and-GCC.html
* man g++
发表评论
-
undefined reference to `wxColour::IsOk() const'
2009-11-20 16:51 874CXXFLAGS多了一个参数-fvisibility-inli ... -
unsigned signed cast
2009-07-27 18:03 740unsigned 和 signed 一起运算时, signed ... -
negative mod
2009-07-27 17:59 765(-10) % 3 = ? (-10) - (3* -4) ... -
全局静态变量 global static variable
2009-04-25 20:49 1514全局静态变量与 全局变量的区别在于全局静态变量只能在被本源文件 ... -
return value of GTK callback function
2009-04-25 20:47 670False: 如果你想在你的Callback 之后继续把si ... -
函数的声明 (Too Much Default Visibility)
2009-04-25 20:47 674函数的使用范围应该得到最大程度的限制,而不是default 的 ... -
Error: No rule to make target XXX
2009-04-25 20:44 3027在Src 目录下new 几个新的目录和文件,Make 就出现上 ... -
about malloc
2009-04-25 20:33 439做了一个调用malloc 分配memory 的小程序. 执行 ... -
when string passing as parameter(const)
2009-04-25 20:28 619It means when you hold the poin ... -
多维pointer 如何free
2009-04-25 20:26 662free 的方法与之前如何 alloc的相关。 * ... -
关于 #include 的位置
2009-04-25 20:26 698是放在*.h or *.c 里面? * 如果是*.h ... -
关于二维指针的初始化
2009-04-25 20:23 1363一个初级的问题: char *a; char **arr, ... -
errir: request for member 'XXX' in 'YYY'. which is
2009-04-25 20:23 1027错误的原因好像有两种 1. http://groups.g ... -
inline 声明
2009-04-25 15:54 768inline only 是对complier一种请求,comp ... -
函数参数的 Default value
2009-04-25 15:53 767与 ANSI C 不同,C++的函数参数可以有Default ... -
build-in 变量的初始化
2009-04-25 15:52 657如果是 file scope的build-in 变量会被初始化 ... -
pointer 使用时注意事项
2009-04-25 15:51 693使用pointer前一定要先确认其值是否为0 if (!p) ... -
Pass by reference
2009-04-25 15:50 682C++ 中 函数的参数传递时,如果数据量比较大,即使是没有打算 ... -
伪随机数 pseudo random number
2009-04-25 15:48 833C 语言中的 srand 和 rand * Why ...
相关推荐
C++编译选项 /GX /ZI /O2这些编译连接命令的意义一网打尽。 C++编译选项说明
C++编译原理 C++类对象内存结构 面向对象的编程总结 C++语言参考
高级C C++编译技术_[美]斯特瓦诺维奇著_201504 花钱买的,高清扫描版,祝你了解库的加载,打包机制
Visual C++ 编译链接信息手册,从看雪上面下载的,先共享下吧,比较适合C++编译出问题的解决。
清理c++ 编译中间文件 清理c++ 编译中间文件清理c++ 编译中间文件清理c++ 编译中间文件清理c++ 编译中间文件
C,C++编译环境搭建 windows下建立编译环境
C++反编译工具,用来显示与一个可执行文件(exe或者dll)相关的依赖项(dll),以及该exe或dll引用了这些dll中的哪些接口。
c++编译过程
C++程序编译C++程序编译全部下载C++程序编译全部下载
C++编译的通讯录,实现了添加、删除、修改、查看等等功能
本上传pdf文件主要讲解C/C++编译技术,适合入门者阅读。
用C++编译的象棋游戏,还没有实现人机对战
C++编译预处理,关于C++学习的课件,可以帮助C++的学习
C++开发语言源代码反编译工具
C++ 编译环境中解决LINK2005问题汇总
适合新手用的C++编译工具,小巧又好用。
使用C++编译的贪吃蛇小游戏,可以为其他同类游戏的设计提供一个参考。里面有贪吃蛇的EXE文件,也有源程序代码~仅供参考~~
C++编译初步ubuntu C++编译初步
C#调用C++编译的DLL详解
语义分析 C++ 编译原理 运行环境:Visual Studio 2005