
调试
oguro
无
展开
-
g++编译报错原因分析expected type-specifier before
原因:因为没有引入相应的头文件,加入相应的.h可以解决原创 2016-09-26 22:57:48 · 54667 阅读 · 7 评论 -
g++编译报错原因分析 makefile : *** commands commence before first target. stop.
在编译linux C++代码时出现了makefile :70: *** commands commence before first target. stop.经过检查发现,原因是修改makefile的include头文件时,在第70行的‘\’后多输入了空格我们知道, 在C/C++语言中, 可以用\来换行, 此时要注意, 在一行的最后面加上\, 而这个\后面不能再有任何字符, 哪原创 2016-11-22 13:13:21 · 5506 阅读 · 0 评论 -
g++报错原因分析error: unterminated #ifndef
error: unterminated #ifndef检查发现是因为文件开头使用了#ifndef而后面缺少了#endif原创 2016-11-29 13:39:26 · 24802 阅读 · 1 评论 -
g++报错原因分析:expected class-name before ‘{’ token
今天写程序的时候, 遇到这样一个错误expected class-name before ‘{’ token 最后发现原来是我的头文件声明没有加.继承时不要忘记加基类的头文件错误: class Foo: public Bar // Foo is a subclass of Bar { // stuff };正确: #include "Bar原创 2016-11-29 13:36:37 · 28255 阅读 · 1 评论 -
g++编译警告原因分析..is used uninitialized in this function
主要是因为指针没有指向可用的内存地址或没有分配地址原创 2016-11-01 13:26:15 · 51105 阅读 · 0 评论 -
g++编译警告原因分析Wunused-but-set-variable
当我们在函数中定义一个变量,我们给这个变量赋初值,但是在我们的函数结束之前,这个值并没有用于使用,换句话说,这个变量是没有实际意义的,完全可以去掉不用。原创 2016-10-29 10:13:20 · 8029 阅读 · 0 评论 -
g++编译报错原因分析 expected unqualified-id before string constant
在代码编写完成之后,编译时发现如下错误: expected unqualified-id before string constant错误查找:很奇怪的错误,难道系统提供的头文件也会出错?后来发现,在定义完函数之后,没有加" ; "错误纠正:在函数定义之后加上" ; "即可...原创 2016-11-08 15:47:06 · 32964 阅读 · 0 评论 -
GDB调试命令
用GDB调试程序GDB概述————GDB是GNU开源组织发布的一个强大的UNIX下的程序调试工具。或许,各位比较喜欢那种图形界面方式的,像VC、BCB等IDE的调试,但如果你是在UNIX平台下做软件,你会发现GDB这个调试工具有比VC、BCB的图形化调试器更强大的功能。所谓“寸有所长,尺有所短”就是这个道理。一般来说,GDB主要帮忙你完成下面四个方面的功能: 1、启动你的原创 2016-11-07 16:43:01 · 334 阅读 · 0 评论 -
g++编译报错原因分析 format ?.d?.expects argument of type ?.nt?. but argument 3 has type ?.
这是我工作时在linux环境下C++编译出现过的警告:warning: format ?.d?.expects argument of type ?.nt?. but argument 3 has type ?.int64 {aka long long unsigned int}?.[-Wformat=] (void)query.create_sql("SELECT * FRO原创 2016-09-28 20:59:42 · 6211 阅读 · 0 评论 -
g++编译报错原因分析“was not declared in this scope"
在编译程序的时候,提示:“was not declared in this scope"。经过分析后发现原因如下:1.变量、函数、或者类未声明或者定义。这是最简单的情况~却是我经常犯的错误(基本也是这几个原因中可能性最大的)另外,网上有人指出以下原因也会导致该提示错误:2.头文件相互#include时,导致了依赖关系错误。比如,头文件形成了一个环形依赖,/***fi原创 2016-09-28 20:57:18 · 128625 阅读 · 0 评论 -
g++编译报错原因分析cannot allocate an object of abstract type“XXX ”
原因分析:通过查看代码发现C++程序在创建一个类的对象时报错了错误类型是Cannot allocate an object of abstract type“XXX”原因是我的类继承自一个基类,该基类中的函数存在纯虚函数,而我的类中没有重载全部纯虚函数。解决方法:在基类中申明的虚函数,在派生类中必须继承并实现。这样在new一个派生类时才不会报该错误。将基类中所有虚函数,原创 2016-09-26 23:03:59 · 15359 阅读 · 0 评论 -
g++报错原因分析error: no......member function declared in class 'XXX‘
error: no 'Uint32 CMdrDb::queryMdr(char*, Uint64, Uint32, tMdr**)' member function declared in class 'CMdrDb' Uint32 CMdrDb::queryMdr(IN char* pUriName, IN Uint64 nSyncKey, IN Uint32 nCount, INOUT t原创 2016-11-22 13:18:09 · 13900 阅读 · 0 评论