使用vs2015 各种报错 vs自己的东西都说未定义标识符

最近在用cocos2dx + vs2015 , 可是一打开项目就2000+个错误 不过编译能过
想配合这Spine做骨骼动画 从官网上下的代码 导进来之后 也是一堆未定义标识符 根本没法用 有没有知道怎么解决的大神? ![![图片说明](https://img-ask.csdn.net/upload/201709/21/1505962079_589435.png)图片说明](https://img-ask.csdn.net/upload/201709/21/1505962068_146549.png)图片说明

5个回答

关键字inline 必须与函数定义体放在一起才能使函数成为内联,仅将inline 放在函数声明前面不起任何作用。
如下风格的函数Foo 不能成为内联函数:
inline void Foo(int x, int y); // inline 仅与函数声明放在一起
void Foo(int x, int y)
{
}
而如下风格的函数Foo 则成为内联函数:
void Foo(int x, int y);
inline void Foo(int x, int y) // inline 与函数定义体放在一起
{
}
楼主的错误可能是由于没有包含实现和定义memory__order模块的头文件导致,
一般来说,如果从官网下载的项目编译有问题,多半是头文件包含错误或者你有
一些库没有导入,注意看一下VS2015中的项目设置,看一下这个项目的相关文档,
看一下编译需要哪些设置。

qq_41600756
qq_41600756 回复baidu_35157510: 怎么解决的啊
一年多之前 回复
baidu_35157510
小柒07 好吧 自己解决了 是因为vs里的一个报错选项
2 年多之前 回复

先检查变量在使用之前是否被声明。有些变量在头文件中声明的,检查头文件是否正确包含,自定义的头文件应该用#include"##.h"。有时头文件的目录分隔符“\”要改为“/”才能被识别

有可能是1个或两个错误引起的,从错误列表的最后一个开始排查

很明显, 你应该找找__STD_BEGIN这个有没有定义

j_s_3721
j_s_3721 说错了, 是memory_order没定义
2 年多之前 回复

好吧 自己解决了 是因为vs里的一个报错选项

weixin_39026142
weixin_39026142 请问是什么报错选项出问题了了
9 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
opencv3.0 error C2065: SurfFeatureDetector未定义标识符
编程环境:win7旗舰版+opencv3.0(含opencv_contrib-master)+vs2013 我在opencv3.0下使用SURF算法提取特征时出现了以下错误:error C2065: “SurfFeatureDetector”未定义标识符 我在nonfree.hpp文件下查看了SurfFeatureDetector的定义,在路径“opencv2/xfeatures2d/nonfree.hpp”下可以找到nonfree.hpp(这个路径是用CMAKE 编译 opencv_contrib-master下 源代码后下的相应路径)。 在nonfree.hpp中明明可以看到SURF类的定义和SurfFeatureDetector的类型定义,nonfree.hpp下的一段代码如下 class CV_EXPORTS_W SURF : public Feature2D { public: /** @param hessianThreshold Threshold for hessian keypoint detector used in SURF. @param nOctaves Number of pyramid octaves the keypoint detector will use. @param nOctaveLayers Number of octave layers within each octave. @param extended Extended descriptor flag (true - use extended 128-element descriptors; false - use 64-element descriptors). @param upright Up-right or rotated features flag (true - do not compute orientation of features; false - compute orientation). */ CV_WRAP static Ptr<SURF> create(double hessianThreshold=100, int nOctaves = 4, int nOctaveLayers = 3, bool extended = false, bool upright = false); CV_WRAP virtual void setHessianThreshold(double hessianThreshold) = 0; CV_WRAP virtual double getHessianThreshold() const = 0; CV_WRAP virtual void setNOctaves(int nOctaves) = 0; CV_WRAP virtual int getNOctaves() const = 0; CV_WRAP virtual void setNOctaveLayers(int nOctaveLayers) = 0; CV_WRAP virtual int getNOctaveLayers() const = 0; CV_WRAP virtual void setExtended(bool extended) = 0; CV_WRAP virtual bool getExtended() const = 0; CV_WRAP virtual void setUpright(bool upright) = 0; CV_WRAP virtual bool getUpright() const = 0; }; typedef SURF SurfFeatureDetector; typedef SURF SurfDescriptorExtractor; ``` 我已经在VC++包含目录中添加了include, opencv 和 opencv2三个文件夹下的路径。也在连接器中添加了相应的*.lib文件。#include "opencv2/xfeatures2d/nonfree.hpp"时也没有报错,为什么还是提示SurfFeatureDetector是未定义的标识符呢?
为什么VS中 int gd = VGA; int gm = VGAHI;会报错未定义标识符?
void path(void) { int i, j, k, row, col, next_rol, next_col, dir, found = FALSE; int gd = VGA; int gm = VGAHI;
opencv3.2中一直报错 SurfFeatureDetector 未定义的标识符。
配置了opencv3.2.0但是 SurfFeatureDetector类无法使用啊, 我也加上了opencv_contrib了![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/76.gif)![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/76.gif)
vs2010 配置GDAL, 但是无法运行,报错GDALALLRegister是未定义标识符
![图片说明](https://img-ask.csdn.net/upload/201611/30/1480471789_788519.png)
C++连接数据库 ADOBE未定义标识符
#pragma warning(default:4146) #import "C:\\Program Files\\Common Files\\System\\ado\\msado15.dll" no_namespace rename ("EOF","adoEOF") #pragma warning(default:4146) using namespace ADODB; _ConnectionPtr m_pConnection; _RecordsetPtr m_pRecordset; _CommandPtr m_pCommand; m_pConnection.CreateInstance(ADODB.Connection); m_pRecordset.CreateInstance(ADODB.Recordset); C++连接数据库总是报错
在头文件里定义一个string name; 变量,编译报错
//Parent.h class Parent { public: Parent(void); ~Parent(void); private: string name; }; //main.cpp #include <iostream> #include <string> #include "Parent.h" using namespace std; void main() { system("pause"); } //Parent.cpp #include "Parent.h" Parent::Parent(void) { } Parent::~Parent(void) { } //编译器报错 错误 1 error C2146: 语法错误: 缺少“;”(在标识符“name”的前面) d:\用户目录\我的文档\visual studio 2012\projects\string\string\parent.h 8 错误 2 error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int d:\用户目录\我的文档\visual studio 2012\projects\string\string\parent.h 8 错误 3 error C2146: 语法错误: 缺少“;”(在标识符“name”的前面) d:\用户目录\我的文档\visual studio 2012\projects\string\string\parent.h 8 错误 4 error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int d:\用户目录\我的文档\visual studio 2012\projects\string\string\parent.h 8 5 IntelliSense: 未定义标识符 "string" d:\用户目录\我的文档\Visual Studio 2012\Projects\string\string\Parent.h 8
C++ Windows.h下的Sleep()方法报错
错误为: 未定义标识符 "Sleep" 无法打开 源 文件 "winapifamily.h" 无法打开包括文件: “winapifamily.h”: No such file or directory
c++位图像素读取ofstream outfile();
ofstream outfile("图像像素.txt", ios::in | ios::trunc);报错,说ofstream 是未定义的标识符
在VC6.0上是可以完整运行的但是在vs2012各种报错,求大神进来帮忙修改一下
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<ctype.h> #define MAXWORD 30 /*单词最多字符数*/ #define MAXARRAY 2000 /*文件最多单词总数*/ #define MAXLINE 80 /*每次最多读取MAXLINE-1个字符*/ struct node { char word [MAXWORD]; int count; }; /*函数声明*/ void GetWord(char *p, struct node *wArry); void AddArray(char *w, struct node *p); void PritArray(struct node *p); /*主程序*/ int main (int argc, char argv[]) { int i; FILE *fp; struct node arrayWord[MAXARRAY]; char line[MAXLINE]; /*数组初始化*/ for(i = 0; i < MAXARRAY ;i++ ) { arrayWord[i].count = 0; arrayWord[i].word = '\0'; /*检查命令行参数个数*/ if(argc != 2) { printf("Usage :countWords Filename\n"); exit(1); } /*打开文件*/ if (fp = fopen(argv[1], "r")) { printf("countword:can't open %s\n",argv[1]); exit(1); } /*统计单词*/ while (fgets(line,MAXLINE, fp) != NULL) { GetWord(line, arrayWord); } /*显示统计结果*/ PritArray(arrayWord); } /*提取单词*/ void GetWord(char *p, struct node *wArry); { int n; char word[MAXWORD]; char *q, *w; while (isspace(*p)) { p++; } while (*p != '\0') { n = 0;/*单词字符个数,初始化为0*/ if (isspace(*p) && isspace (*(p-1)))/*单词的首个字母*/ { q = p; /*记录单词的开始位置*/ while (isspace(*p) && n < MAXWORD) { p++; n++; } /*单词以空白字符结尾*/ if(isspace(*p) || *p == '\0') { w = word; while (q < p) { /*复制单词到word[]*/ *w++ = *p++ ; } *w = '\0'; /*将单词添加到arryWord[MAXARRAY]*/ AddArray(word, wArray); } } if (*p != '\0') { p++; } } } /*统计单词*/ void AddArray(char *w, struct node *p); { int i; for (int i = 0; i < MAXARRAY; i++, p++) { if (strcmp(p ->count, w) == 0) { /*单词已经存在*/ p ->count++; break; }else if (p ->count ==0) { /*单词不存在*/ strcpy(p -> word, w); p ->count = 1; break; } } } /*显示统计结果*/ void PritArray(struct node *p); { while (p ->count > 0) { printf("%4d %s\n",p ->count,p->word); p++; } } 首先是定义数组那里 arrayWord[i].word = '\0';提示表达式必须是可修改的左值 /*打开文件*/哪里 error C2664: “fopen”: 不能将参数 1 从“char”转换为“const char *” 最后是定义函数括号里的形参,在函数里面会报错举个例子: void AddArray(char *w, struct node *p);这个自定义函数 如果我下面这样写 if (strcmp(p ->count, w) == 0),这里面的w就会报错,提示未定义标识符,次啊面的函数也是这么个情况,请问昨晚那么晚改???
stdio.h,stdlib.h,wchar.h报错
VS2010 创建空项目后编译报错如下,望各位大虾给予帮助,谢谢 错误 109 error C1003: 错误计数超过 100;正在停止编译 c:\program files\microsoft visual studio 10.0\vc\include\wchar.h 112 1 fineError 错误 9 error C2059: 语法错误:“)” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 245 1 fineError 错误 19 error C2059: 语法错误:“)” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 247 1 fineError 错误 21 error C2059: 语法错误:“)” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 317 1 fineError 错误 30 error C2059: 语法错误:“)” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 318 1 fineError 错误 37 error C2059: 语法错误:“)” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 321 1 fineError 错误 43 error C2059: 语法错误:“)” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 333 1 fineError 错误 49 error C2059: 语法错误:“)” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 334 1 fineError 错误 55 error C2059: 语法错误:“)” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 335 1 fineError 错误 61 error C2059: 语法错误:“)” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 336 1 fineError 错误 68 error C2059: 语法错误:“)” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 404 1 fineError 错误 87 error C2059: 语法错误:“)” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 680 1 fineError 错误 97 error C2059: 语法错误:“)” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 681 1 fineError 错误 104 error C2059: 语法错误:“)” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 686 1 fineError 错误 20 error C2061: 语法错误: 标识符“_Inout_opt_z_charcap_” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 317 1 fineError 错误 29 error C2062: 意外的类型“char” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 318 1 fineError 错误 36 error C2062: 意外的类型“char” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 321 1 fineError 错误 67 error C2062: 意外的类型“char” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 404 1 fineError 错误 2 error C2065: “_Count”: 未声明的标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 245 1 fineError 错误 11 error C2065: “_Count”: 未声明的标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 247 1 fineError 错误 80 error C2065: “_Count”: 未声明的标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 680 1 fineError 错误 89 error C2065: “_Count”: 未声明的标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 681 1 fineError 错误 99 error C2065: “_Count”: 未声明的标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 686 1 fineError 错误 62 error C2065: “_DstSize”: 未声明的标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 404 1 fineError 错误 1 error C2065: “_ElementSize”: 未声明的标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 245 1 fineError 错误 10 error C2065: “_ElementSize”: 未声明的标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 247 1 fineError 错误 79 error C2065: “_ElementSize”: 未声明的标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 680 1 fineError 错误 88 error C2065: “_ElementSize”: 未声明的标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 681 1 fineError 错误 38 error C2065: “_MaxCount”: 未声明的标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 333 1 fineError 错误 44 error C2065: “_MaxCount”: 未声明的标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 334 1 fineError 错误 50 error C2065: “_MaxCount”: 未声明的标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 335 1 fineError 错误 56 error C2065: “_MaxCount”: 未声明的标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 336 1 fineError 错误 98 error C2065: “_Size”: 未声明的标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 686 1 fineError 错误 23 error C2065: “_SizeInchars”: 未声明的标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 318 1 fineError 错误 31 error C2065: “_SizeInchars”: 未声明的标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 321 1 fineError 错误 22 error C2143: 语法错误 : 缺少“)”(在“;”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 317 1 fineError 错误 40 error C2143: 语法错误 : 缺少“)”(在“const”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 333 1 fineError 错误 46 error C2143: 语法错误 : 缺少“)”(在“const”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 334 1 fineError 错误 52 error C2143: 语法错误 : 缺少“)”(在“const”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 335 1 fineError 错误 58 error C2143: 语法错误 : 缺少“)”(在“const”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 336 1 fineError 错误 101 error C2143: 语法错误 : 缺少“)”(在“const”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 686 1 fineError 错误 8 error C2143: 语法错误 : 缺少“;”(在“*”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 245 1 fineError 错误 18 error C2143: 语法错误 : 缺少“;”(在“*”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 247 1 fineError 错误 86 error C2143: 语法错误 : 缺少“;”(在“*”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 680 1 fineError 错误 96 error C2143: 语法错误 : 缺少“;”(在“*”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 681 1 fineError 错误 25 error C2144: 语法错误:“char”的前面应有“)” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 318 1 fineError 错误 33 error C2144: 语法错误:“char”的前面应有“)” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 321 1 fineError 错误 64 error C2144: 语法错误:“char”的前面应有“)” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 404 1 fineError 错误 4 error C2144: 语法错误:“void”的前面应有“)” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 245 1 fineError 错误 13 error C2144: 语法错误:“void”的前面应有“)” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 247 1 fineError 错误 82 error C2144: 语法错误:“void”的前面应有“)” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 680 1 fineError 错误 91 error C2144: 语法错误:“void”的前面应有“)” c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 681 1 fineError 错误 7 error C2146: 语法错误: 缺少“;”(在标识符“_Count”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 245 1 fineError 错误 17 error C2146: 语法错误: 缺少“;”(在标识符“_Count”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 247 1 fineError 错误 85 error C2146: 语法错误: 缺少“;”(在标识符“_Count”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 680 1 fineError 错误 95 error C2146: 语法错误: 缺少“;”(在标识符“_Count”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 681 1 fineError 错误 15 error C2146: 语法错误: 缺少“;”(在标识符“_DstSize”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 247 1 fineError 错误 66 error C2146: 语法错误: 缺少“;”(在标识符“_DstSize”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 404 1 fineError 错误 93 error C2146: 语法错误: 缺少“;”(在标识符“_DstSize”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 681 1 fineError 错误 6 error C2146: 语法错误: 缺少“;”(在标识符“_ElementSize”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 245 1 fineError 错误 16 error C2146: 语法错误: 缺少“;”(在标识符“_ElementSize”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 247 1 fineError 错误 84 error C2146: 语法错误: 缺少“;”(在标识符“_ElementSize”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 680 1 fineError 错误 94 error C2146: 语法错误: 缺少“;”(在标识符“_ElementSize”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 681 1 fineError 错误 28 error C2146: 语法错误: 缺少“;”(在标识符“_MaxCount”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 318 1 fineError 错误 27 error C2146: 语法错误: 缺少“;”(在标识符“_SizeInchars”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 318 1 fineError 错误 35 error C2146: 语法错误: 缺少“;”(在标识符“_SizeInchars”的前面) c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 321 1 fineError 错误 105 error C2146: 语法错误: 缺少“;”(在标识符“size”的前面) c:\program files\microsoft visual studio 10.0\vc\include\wchar.h 94 1 fineError 错误 108 error C2146: 语法错误: 缺少“;”(在标识符“size”的前面) c:\program files\microsoft visual studio 10.0\vc\include\wchar.h 112 1 fineError 错误 92 error C2448: “_fread_nolock_s”: 函数样式初始值设定项类似函数定义 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 681 1 fineError 错误 83 error C2448: “_fread_nolock”: 函数样式初始值设定项类似函数定义 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 680 1 fineError 错误 26 error C2448: “_snprintf_s”: 函数样式初始值设定项类似函数定义 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 318 1 fineError 错误 65 error C2448: “_sprintf_s_l”: 函数样式初始值设定项类似函数定义 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 404 1 fineError 错误 14 error C2448: “fread_s”: 函数样式初始值设定项类似函数定义 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 247 1 fineError 错误 5 error C2448: “fread”: 函数样式初始值设定项类似函数定义 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 245 1 fineError 错误 34 error C2448: “sprintf_s”: 函数样式初始值设定项类似函数定义 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 321 1 fineError 错误 103 error C2491: “_fwrite_nolock”: 不允许 dllimport 数据 的定义 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 686 1 fineError 错误 48 error C2491: “_snscanf_l”: 不允许 dllimport 数据 的定义 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 334 1 fineError 错误 60 error C2491: “_snscanf_s_l”: 不允许 dllimport 数据 的定义 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 336 1 fineError 错误 54 error C2491: “_snscanf_s”: 不允许 dllimport 数据 的定义 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 335 1 fineError 错误 42 error C2491: “_snscanf”: 不允许 dllimport 数据 的定义 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 333 1 fineError 错误 75 error C3861: “__vswprintf_l”: 找不到标识符 c:\program files\microsoft visual studio 10.0\vc\include\swprintf.inl 109 1 fineError 错误 76 error C3861: “__vswprintf_l”: 找不到标识符 c:\program files\microsoft visual studio 10.0\vc\include\swprintf.inl 119 1 fineError 错误 39 error C3861: “_In_charcount_”: 找不到标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 333 1 fineError 错误 45 error C3861: “_In_charcount_”: 找不到标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 334 1 fineError 错误 51 error C3861: “_In_charcount_”: 找不到标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 335 1 fineError 错误 57 error C3861: “_In_charcount_”: 找不到标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 336 1 fineError 错误 100 error C3861: “_In_charcount_x_”: 找不到标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 686 1 fineError 错误 3 error C3861: “_Out_charcap_x_”: 找不到标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 245 1 fineError 错误 12 error C3861: “_Out_charcap_x_”: 找不到标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 247 1 fineError 错误 81 error C3861: “_Out_charcap_x_”: 找不到标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 680 1 fineError 错误 90 error C3861: “_Out_charcap_x_”: 找不到标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 681 1 fineError 错误 24 error C3861: “_Out_z_charcap_”: 找不到标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 318 1 fineError 错误 32 error C3861: “_Out_z_charcap_”: 找不到标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 321 1 fineError 错误 63 error C3861: “_Out_z_charcap_”: 找不到标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 404 1 fineError 错误 69 error C3861: “_vswprintf_c_l”: 找不到标识符 c:\program files\microsoft visual studio 10.0\vc\include\swprintf.inl 41 1 fineError 错误 70 error C3861: “_vswprintf_c_l”: 找不到标识符 c:\program files\microsoft visual studio 10.0\vc\include\swprintf.inl 51 1 fineError 错误 71 error C3861: “_vswprintf_c_l”: 找不到标识符 c:\program files\microsoft visual studio 10.0\vc\include\swprintf.inl 65 1 fineError 错误 72 error C3861: “_vswprintf_c_l”: 找不到标识符 c:\program files\microsoft visual studio 10.0\vc\include\swprintf.inl 75 1 fineError 错误 73 error C3861: “_vswprintf”: 找不到标识符 c:\program files\microsoft visual studio 10.0\vc\include\swprintf.inl 89 1 fineError 错误 74 error C3861: “_vswprintf”: 找不到标识符 c:\program files\microsoft visual studio 10.0\vc\include\swprintf.inl 99 1 fineError 错误 77 error C3861: “fgetwc”: 找不到标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 627 1 fineError 错误 78 error C3861: “fputwc”: 找不到标识符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 629 1 fineError 错误 106 error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int c:\program files\microsoft visual studio 10.0\vc\include\wchar.h 94 1 fineError 错误 107 error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int c:\program files\microsoft visual studio 10.0\vc\include\wchar.h 94 1 fineError 警告 41 warning C4229: 使用了记时错误: 忽略数据上的修饰符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 333 1 fineError 警告 47 warning C4229: 使用了记时错误: 忽略数据上的修饰符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 334 1 fineError 警告 53 warning C4229: 使用了记时错误: 忽略数据上的修饰符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 335 1 fineError 警告 59 warning C4229: 使用了记时错误: 忽略数据上的修饰符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 336 1 fineError 警告 102 warning C4229: 使用了记时错误: 忽略数据上的修饰符 c:\program files\microsoft visual studio 10.0\vc\include\stdio.h 686 1 fineError
MFC中给控件关联变量之后该变量始终报未声明
我创建了一个MFC窗体程序,在主窗口用了一个ListBox控件,给它关联了一个control变量,但在该窗口类的cpp文件中调用该变量时总是报该变量是未声明的标识符,定义及报错情况见下图,求大神指教,谢谢!![![图片说明](https://img-ask.csdn.net/upload/201705/16/1494918219_497149.png) [![图片说明](https://img-ask.csdn.net/upload/201705/16/1494918211_129212.png)
MFC ADO OnSelchangeListaccess()报错问题
之前没用过ADO,学习过程中使用OnSelchangeListaccess()报错了,代码如下: ``` BOOL CDataBaseMFCTestDlg::OnInitDialog() { CDialogEx::OnInitDialog(); // 将“关于...”菜单项添加到系统菜单中。 // IDM_ABOUTBOX 必须在系统命令范围内。 ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE); if (pSysMenu != NULL) { BOOL bNameValid; CString strAboutMenu; bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX); ASSERT(bNameValid); if (!strAboutMenu.IsEmpty()) { pSysMenu->AppendMenu(MF_SEPARATOR); pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); } } // 设置此对话框的图标。 当应用程序主窗口不是对话框时,框架将自动 // 执行此操作 SetIcon(m_hIcon, TRUE); // 设置大图标 SetIcon(m_hIcon, FALSE); // 设置小图标 //////////////////////////////////////////////////////////////////////////////////////////// // 使用ADO创建数据库记录集 m_pRecordset.CreateInstance(__uuidof(Recordset)); // 在ADO操作中建议语句中要常用try...catch()来捕获错误信息, // 因为它有时会经常出现一些想不到的错误。jingzhou xu try { m_pRecordset->Open("SELECT * FROM DemoTable", // 查询DemoTable表中所有字段 theApp.m_pConnection.GetInterfacePtr(), // 获取库接库的IDispatch指针 adOpenDynamic, adLockOptimistic, adCmdText); } catch (_com_error& e) { dump_com_error(e); } ///////////////////////////////////////////////////////////////////////////////////////////////////// _variant_t var; CString strName, strAge; // 清空列表框 m_AccessList.ResetContent(); strName = strAge = ""; // 在ADO操作中建议语句中要常用try...catch()来捕获错误信息, // 因为它有时会经常出现一些想不到的错误。jingzhou xu try { if (!m_pRecordset->BOF) m_pRecordset->MoveFirst(); else { AfxMessageBox("表内数据为空"); return false; } // 读入库中各字段并加入列表框中 while (!m_pRecordset->adoEOF) { var = m_pRecordset->GetCollect("Name"); if (var.vt != VT_NULL) strName = (LPCSTR)_bstr_t(var); var = m_pRecordset->GetCollect("Age"); if (var.vt != VT_NULL) strAge = (LPCSTR)_bstr_t(var); m_AccessList.AddString(strName + " --> " + strAge); m_pRecordset->MoveNext(); } // 默认列表指向第一项,同时移动记录指针并显示 m_AccessList.SetCurSel(0); OnSelchangeListaccess(); } catch (_com_error& e) { dump_com_error(e); } return TRUE; // 除非将焦点设置到控件,否则返回 TRUE } ``` 说OnSelchangeListaccess()未定义标识符,原因在哪
myeclipse内置浏览器 显示空白
1、问题描述 myeclipse内置浏览器访问网页时显示空白。 如果是在浏览器(比如,谷歌、火狐、IE11)里面访问都没有问题。 2、需求描述 我们做的项目是基于高德地图的GIS web程序,然后,这个GIS项目被嵌套在一个c#软件里面。 嵌套的意思是,在c#软件里调用IE内核来访问 地图程序。现在的问题就是,访问网页时页面是空白。 另外,一开始在C#软件里面访问的时候,会出现2种错误,而且会弹出对话框错误信息, 1)报错信息:JS“缺少标识符 字符串或数字” 2)console未定义 把这2个错误修复之后,结果还是有问题,那就是显示空白(在c#里面访问,或者在myeclipse里面访问,都是显示空白)。关键是现在显示空白,但是不报也不弹出任何错误信息窗口了。 3、什么情况会导致出现这个问题呢?如何解决这个问题呢?
别人给的各种运动目标检测方法的代码,不知道少了什么东西一直调不通
1.我用的是VS2013,配置的是OpenCV3.4.0,运行如下程序的时候就说有许多未定义的标识符,琢磨了好久就是不知道哪里出了问题。求大神帮我看看程序。看看哪里出了问题,,需要的话我可以把整个程序发过去,(有偿) ``` #include <opencv2/highgui/highgui.hpp> #include <opencv2/core/core.hpp> #include <stdio.h> #include <stdlib.h> //#include "cvaux.h" #include "codeb.h" int CVCONTOUR_APPROX_LEVEL = 2; int CVCLOSE_ITR = 1; #define CV_CVX_WHITE CV_RGB(0xff,0xff,0xff) #define CV_CVX_BLACK CV_RGB(0x00,0x00,0x00) codeBook* cA; codeBook* cC; codeBook* cD; int maxMod[CHANNELS]; int minMod[CHANNELS]; unsigned cbBounds[CHANNELS]; bool ch[CHANNELS]; int nChannels = CHANNELS; int imageLen = 0; uchar *pColor; int Td; int Tadd; int Tdel; int T=50; int Fadd=35; int Tavgstale=50; int Fd=2; int Tavgstale_cD=50; int fgcount=0; float beta=0.1f; float gamma=0.1f; float forgratio=0.0f; float Tadap_update=0.4f; int clear_stale_entries(codeBook &c); uchar background_Diff(uchar *p, codeBook &c, int numChannels, int *minMod, int *maxMod); int update_codebook_model(uchar* p,codeBook& c,unsigned* cbBounds,int numChannels); int trainig_codebook(uchar* p,codeBook& c,unsigned* cbBounds,int numChannels); int training_clear_stale_entries(codeBook &c); int det_update_codebook_cC(uchar* p,codeBook& c,unsigned* cbBounds,int numChannels); int det_update_codebook_cD(uchar* p,codeBook& c,unsigned* cbBounds,int numChannels, int numframe); int realtime_clear_stale_entries_cC(codeBook &c, int FrmNum); int realtime_clear_stale_entries_cD(codeBook &c, int FrmNum); int cD_to_cC(codeBook &d, codeBook &c, int FrmNum); uchar background_diff_realtime(uchar* p,codeBook& c,int numChannels,int* minMod,int* maxMod); void help() { printf( "***Keep the focus on the video windows, NOT the consol***\n" "INTERACTIVE PARAMETERS:\n" "\tESC,q,Q - quit the program\n" "\th - print this help\n" "\tp - pause toggle\n" "\ts - single step\n" "\tr - run mode (single step off)\n" "=== CODEBOOK PARAMS ===\n" "\ty,u,v- only adjust channel 0(y) or 1(u) or 2(v) respectively\n" "\ta - adjust all 3 channels at once\n" "\tb - adjust both 2 and 3 at once\n" "\ti,o - bump upper threshold up,down by 1\n" "\tk,l - bump lower threshold up,down by 1\n" "\tz,x - bump Fadd threshold up,down by 1\n" "\tn,m - bump Tavgstale threshold up,down by 1\n" "\t Fadd小更新快,Tavgstale大更新快\n" ); } int count_Segmentation(codeBook *c, IplImage *I, int numChannels, int *minMod, int *maxMod) { int count = 0,i; uchar *pColor; int imageLen = I->width * I->height; //GET BASELINE NUMBER OF FG PIXELS FOR Iraw pColor = (uchar *)((I)->imageData); for(i=0; i<imageLen; i++) { if(background_Diff(pColor, c[i], numChannels, minMod, maxMod)) count++; pColor += 3; } fgcount=count; return(fgcount); } void connected_Components(IplImage *mask, int poly1_hull0, float perimScale, int *num, CvRect *bbs, CvPoint *centers) { static CvMemStorage* mem_storage = NULL; static CvSeq* contours = NULL; //CLEAN UP RAW MASK cvMorphologyEx( mask, mask, NULL, NULL, CV_MOP_OPEN, CVCLOSE_ITR ); cvMorphologyEx( mask, mask, NULL, NULL, CV_MOP_CLOSE, CVCLOSE_ITR ); //FIND CONTOURS AROUND ONLY BIGGER REGIONS if( mem_storage==NULL ) mem_storage = cvCreateMemStorage(0); else cvClearMemStorage(mem_storage); CvContourScanner scanner = cvStartFindContours(mask,mem_storage,sizeof(CvContour),CV_RETR_EXTERNAL,CV_CHAIN_APPROX_SIMPLE); CvSeq* c; int numCont = 0; while( (c = cvFindNextContour( scanner )) != NULL ) { double len = cvContourPerimeter( c ); double q = (mask->height + mask->width) /perimScale; //calculate perimeter len threshold if( len < q ) //Get rid of blob if it's perimeter is too small { cvSubstituteContour( scanner, NULL ); } else //Smooth it's edges if it's large enough { CvSeq* c_new; if(poly1_hull0) //Polygonal approximation of the segmentation c_new = cvApproxPoly(c,sizeof(CvContour),mem_storage,CV_POLY_APPROX_DP, CVCONTOUR_APPROX_LEVEL,0); else //Convex Hull of the segmentation c_new = cvConvexHull2(c,mem_storage,CV_CLOCKWISE,1); cvSubstituteContour( scanner, c_new ); numCont++; } } contours = cvEndFindContours( &scanner ); // PAINT THE FOUND REGIONS BACK INTO THE IMAGE cvZero( mask ); IplImage *maskTemp; //CALC CENTER OF MASS AND OR BOUNDING RECTANGLES if(num != NULL) { int N = *num, numFilled = 0, i=0; CvMoments moments; double M00, M01, M10; maskTemp = cvCloneImage(mask); for(i=0, c=contours; c != NULL; c = c->h_next,i++ ) { if(i < N) //Only process up to *num of them { cvDrawContours(maskTemp,c,CV_CVX_WHITE, CV_CVX_WHITE,-1,CV_FILLED,8); //Find the center of each contour if(centers != NULL) { cvMoments(maskTemp,&moments,1); M00 = cvGetSpatialMoment(&moments,0,0); M10 = cvGetSpatialMoment(&moments,1,0); M01 = cvGetSpatialMoment(&moments,0,1); centers[i].x = (int)(M10/M00); centers[i].y = (int)(M01/M00); } //Bounding rectangles around blobs if(bbs != NULL) { bbs[i] = cvBoundingRect(c); } cvZero(maskTemp); numFilled++; } //Draw filled contours into mask cvDrawContours(mask,c,CV_CVX_WHITE,CV_CVX_WHITE,-1,CV_FILLED,8); //draw to central mask } //end looping over contours *num = numFilled; cvReleaseImage( &maskTemp); } else { for( c=contours; c != NULL; c = c->h_next ) { cvDrawContours(mask,c,CV_CVX_WHITE, CV_CVX_BLACK,-1,CV_FILLED,8); } } } //////////////////////////// int main(int argc, char** argv) { IplImage* temp1 = NULL; IplImage* temp2 = NULL; IplImage* result = NULL; IplImage* result1 = NULL; IplImage* result2 = NULL; CvBGStatModel* bg_model = 0; CvBGStatModel* bg_model1=0; IplImage* rawImage = 0; IplImage* yuvImage = 0; IplImage* rawImage1 = 0; IplImage* pFrImg = 0; IplImage* pFrImg1= 0; IplImage* pFrImg2= 0; IplImage* ImaskCodeBookCC = 0; CvCapture* capture = 0; int c,n; maxMod[0] = 25; minMod[0] = 35; maxMod[1] = 8; minMod[1] = 8; maxMod[2] = 8; minMod[2] = 8; argc=2; argv[1]="intelligentroom_raw.avi"; if( argc > 2 ) { fprintf(stderr, "Usage: bkgrd [video_file_name]\n"); return -1; } if (argc ==1) if( !(capture = cvCaptureFromCAM(-1))) { fprintf(stderr, "Can not open camera.\n"); return -2; } if(argc == 2) if( !(capture = cvCaptureFromFile(argv[1]))) { fprintf(stderr, "Can not open video file %s\n", argv[1]); return -2; } bool pause = false; bool singlestep = false; if( capture ) { cvNamedWindow( "原视频序列图像", 1 ); cvNamedWindow("不实时更新的Codebook算法[本文]",1); cvNamedWindow("实时更新的Codebook算法[本文]",1); cvNamedWindow("基于MOG的方法[Chris Stauffer'2001]",1); cvNamedWindow("三帧差分", 1); cvNamedWindow("基于Bayes decision的方法[Liyuan Li'2003]", 1); cvMoveWindow("原视频序列图像", 0, 0); cvMoveWindow("不实时更新的Codebook算法[本文]", 360, 0); cvMoveWindow("实时更新的Codebook算法[本文]", 720, 350); cvMoveWindow("基于MOG的方法[Chris Stauffer'2001]", 0, 350); cvMoveWindow("三帧差分", 720, 0); cvMoveWindow("基于Bayes decision的方法[Liyuan Li'2003]",360, 350); int nFrmNum = -1; for(;;) { if(!pause) { rawImage = cvQueryFrame( capture ); ++nFrmNum; printf("第%d帧\n",nFrmNum); if(!rawImage) break; } if(singlestep) { pause = true; } if(0 == nFrmNum) { printf(". . . wait for it . . .\n"); temp1 = cvCreateImage(cvGetSize(rawImage), IPL_DEPTH_8U, 3); temp2 = cvCreateImage(cvGetSize(rawImage), IPL_DEPTH_8U, 3); result1 = cvCreateImage(cvGetSize(rawImage), IPL_DEPTH_8U, 1); result2 = cvCreateImage(cvGetSize(rawImage), IPL_DEPTH_8U, 1); result = cvCreateImage(cvGetSize(rawImage), IPL_DEPTH_8U, 1); bg_model = cvCreateGaussianBGModel(rawImage); bg_model1 = cvCreateFGDStatModel(rawImage); rawImage1 = cvCreateImage( cvGetSize(rawImage), IPL_DEPTH_8U, 3 ); yuvImage = cvCloneImage(rawImage); pFrImg = cvCreateImage( cvGetSize(rawImage), IPL_DEPTH_8U, 1 ); pFrImg1 = cvCreateImage( cvGetSize(rawImage), IPL_DEPTH_8U, 1 ); pFrImg2 = cvCreateImage( cvGetSize(rawImage), IPL_DEPTH_8U, 1 ); ImaskCodeBookCC = cvCreateImage( cvGetSize(rawImage), IPL_DEPTH_8U, 1 ); imageLen = rawImage->width*rawImage->height; cA = new codeBook [imageLen]; cC = new codeBook [imageLen]; cD = new codeBook [imageLen]; for(int f = 0; f<imageLen; f++) { cA[f].numEntries = 0; cA[f].t = 0; cC[f].numEntries = 0; cC[f].t = 0; cD[f].numEntries = 0; cD[f].t = 0; } for(int nc=0; nc<nChannels;nc++) { cbBounds[nc] = 10; } ch[0] = true; ch[1] = true; ch[2] = true; } if( rawImage ) { if(!pause) { cvSmooth(rawImage, rawImage1, CV_GAUSSIAN,3,3); cvChangeDetection(temp1, temp2, result1); cvChangeDetection(rawImage1, temp1, result2); cvAnd(result1, result2, result, NULL); cvCopy(temp1,temp2, NULL); cvCopy(rawImage,temp1, NULL); cvUpdateBGStatModel( rawImage, bg_model ); cvUpdateBGStatModel( rawImage, bg_model1 ); } cvCvtColor( rawImage1, yuvImage, CV_BGR2YCrCb ); if( !pause && nFrmNum >= 1 && nFrmNum < T ) { pColor = (uchar *)((yuvImage)->imageData); for(int c=0; c<imageLen; c++) { update_codebook_model(pColor, cA[c],cbBounds,nChannels); trainig_codebook(pColor, cC[c],cbBounds,nChannels); pColor += 3; } } if( nFrmNum == T) { for(c=0; c<imageLen; c++) { clear_stale_entries(cA[c]); training_clear_stale_entries(cC[c]); } } if(nFrmNum > T) { pColor = (uchar *)((yuvImage)->imageData); uchar maskPixelCodeBook; uchar maskPixelCodeBook1; uchar maskPixelCodeBook2; uchar *pMask = (uchar *)((pFrImg)->imageData); uchar *pMask1 = (uchar *)((pFrImg1)->imageData); uchar *pMask2 = (uchar *)((pFrImg2)->imageData); for(int c=0; c<imageLen; c++) { //本文中不带自动背景更新的算法输出 maskPixelCodeBook1=background_Diff(pColor, cA[c],nChannels,minMod,maxMod); *pMask1++ = maskPixelCodeBook1; //本文中带自动背景更新的算法输出 if ( !pause && det_update_codebook_cC(pColor, cC[c],cbBounds,nChannels)) { det_update_codebook_cD(pColor, cD[c],cbBounds,nChannels, nFrmNum); realtime_clear_stale_entries_cD(cD[c], nFrmNum); cD_to_cC(cD[c], cC[c], (nFrmNum - T)/5); } else { realtime_clear_stale_entries_cC(cC[c], nFrmNum); } maskPixelCodeBook2=background_Diff(pColor, cC[c],nChannels,minMod,maxMod); *pMask2++ = maskPixelCodeBook2; pColor += 3; } cvCopy(pFrImg2,ImaskCodeBookCC); if(!pause) { count_Segmentation(cC,yuvImage,nChannels,minMod,maxMod); forgratio = (float) (fgcount)/ imageLen; } } bg_model1->foreground->origin=1; bg_model->foreground->origin=1; pFrImg->origin=1; pFrImg1->origin=1; pFrImg2->origin=1; ImaskCodeBookCC->origin=1; result->origin=1; //connected_Components(pFrImg1,1,40); //connected_Components(pFrImg2,1,40); cvShowImage("基于MOG的方法[Chris Stauffer'2001]", bg_model->foreground); cvShowImage( "原视频序列图像", rawImage ); cvShowImage("三帧差分", result); cvShowImage( "不实时更新的Codebook算法[本文]",pFrImg1); cvShowImage("实时更新的Codebook算法[本文]",pFrImg2); cvShowImage("基于Bayes decision的方法[Liyuan Li'2003]", bg_model1->foreground); c = cvWaitKey(1)&0xFF; //End processing on ESC, q or Q if(c == 27 || c == 'q' || c == 'Q') break; //Else check for user input switch(c) { case 'h': help(); break; case 'p': pause ^= 1; break; case 's': singlestep = 1; pause = false; break; case 'r': pause = false; singlestep = false; break; //CODEBOOK PARAMS case 'y': case '0': ch[0] = 1; ch[1] = 0; ch[2] = 0; printf("CodeBook YUV Channels active: "); for(n=0; n<nChannels; n++) printf("%d, ",ch[n]); printf("\n"); break; case 'u': case '1': ch[0] = 0; ch[1] = 1; ch[2] = 0; printf("CodeBook YUV Channels active: "); for(n=0; n<nChannels; n++) printf("%d, ",ch[n]); printf("\n"); break; case 'v': case '2': ch[0] = 0; ch[1] = 0; ch[2] = 1; printf("CodeBook YUV Channels active: "); for(n=0; n<nChannels; n++) printf("%d, ",ch[n]); printf("\n"); break; case 'a': //All case '3': ch[0] = 1; ch[1] = 1; ch[2] = 1; printf("CodeBook YUV Channels active: "); for(n=0; n<nChannels; n++) printf("%d, ",ch[n]); printf("\n"); break; case 'b': //both u and v together ch[0] = 0; ch[1] = 1; ch[2] = 1; printf("CodeBook YUV Channels active: "); for(n=0; n<nChannels; n++) printf("%d, ",ch[n]); printf("\n"); break; case 'z': printf(" Fadd加1 "); Fadd += 1; printf("Fadd=%.4d\n",Fadd); break; case 'x': printf(" Fadd减1 "); Fadd -= 1; printf("Fadd=%.4d\n",Fadd); break; case 'n': printf(" Tavgstale加1 "); Tavgstale += 1; printf("Tavgstale=%.4d\n",Tavgstale); break; case 'm': printf(" Tavgstale减1 "); Tavgstale -= 1; printf("Tavgstale=%.4d\n",Tavgstale); break; case 'i': //modify max classification bounds (max bound goes higher) for(n=0; n<nChannels; n++) { if(ch[n]) maxMod[n] += 1; printf("%.4d,",maxMod[n]); } printf(" CodeBook High Side\n"); break; case 'o': //modify max classification bounds (max bound goes lower) for(n=0; n<nChannels; n++) { if(ch[n]) maxMod[n] -= 1; printf("%.4d,",maxMod[n]); } printf(" CodeBook High Side\n"); break; case 'k': //modify min classification bounds (min bound goes lower) for(n=0; n<nChannels; n++) { if(ch[n]) minMod[n] += 1; printf("%.4d,",minMod[n]); } printf(" CodeBook Low Side\n"); break; case 'l': //modify min classification bounds (min bound goes higher) for(n=0; n<nChannels; n++) { if(ch[n]) minMod[n] -= 1; printf("%.4d,",minMod[n]); } printf(" CodeBook Low Side\n"); break; } } } cvReleaseCapture( &capture ); cvReleaseBGStatModel((CvBGStatModel**)&bg_model); cvReleaseBGStatModel((CvBGStatModel**)&bg_model1); cvDestroyWindow( "原视频序列图像" ); cvDestroyWindow( "不实时更新的Codebook算法[本文]"); cvDestroyWindow( "实时更新的Codebook算法[本文]"); cvDestroyWindow( "基于MOG的方法[Chris Stauffer'2001]"); cvDestroyWindow( "三帧差分" ); cvDestroyWindow( "基于Bayes decision的方法[Liyuan Li'2003]"); cvReleaseImage(&temp1); cvReleaseImage(&temp2); cvReleaseImage(&result); cvReleaseImage(&result1); cvReleaseImage(&result2); cvReleaseImage(&pFrImg); cvReleaseImage(&pFrImg1); cvReleaseImage(&pFrImg2); if(yuvImage) cvReleaseImage(&yuvImage); if(rawImage) cvReleaseImage(&rawImage); if(rawImage1) cvReleaseImage(&rawImage1); if(ImaskCodeBookCC) cvReleaseImage(&ImaskCodeBookCC); delete [] cA; delete [] cC; delete [] cD; } else { printf("\n\nDarn, Something wrong with the parameters\n\n"); help(); } return 0; } int clear_stale_entries(codeBook &c) { int staleThresh = c.t>>1; int *keep = new int [c.numEntries]; int keepCnt = 0; for(int i=0; i<c.numEntries; i++) { if(c.cb[i]->stale > staleThresh) keep[i] = 0; else { keep[i] = 1; keepCnt += 1; } } c.t = 0; code_element **foo = new code_element* [keepCnt]; int k=0; for(int ii=0; ii<c.numEntries; ii++) { if(keep[ii]) { foo[k] = c.cb[ii]; foo[k]->t_last_update = 0; k++; } } delete [] keep; delete [] c.cb; c.cb = foo; int numCleared = c.numEntries - keepCnt; c.numEntries = keepCnt; return(numCleared); } uchar background_Diff(uchar *p, codeBook &c, int numChannels, int *minMod, int *maxMod) { int matchChannel; int i; for(i=0; i<c.numEntries; i++) { matchChannel = 0; for(int n=0; n<numChannels; n++) { if((c.cb[i]->min[n] - minMod[n] <= *(p+n)) && (*(p+n) <= c.cb[i]->max[n] + maxMod[n])) { matchChannel++; } else { break; } } if(matchChannel == numChannels) { break; } } if(i >= c.numEntries) return(255); return(0); } int update_codebook_model(uchar* p,codeBook& c,unsigned* cbBounds,int numChannels) { if(c.numEntries == 0) c.t = 0; c.t += 1; unsigned int high[3],low[3]; int matchChannel; float avg[3]; for(int i=0; i<c.numEntries; i++) { matchChannel = 0; for(int n=0; n<numChannels; n++) { if((c.cb[i]->learnLow[n] <= *(p+n)) && (*(p+n) <= c.cb[i]->learnHigh[n])) { matchChannel++; } } if(matchChannel == numChannels) { for(int n=0; n<numChannels; n++) { avg[n] = (c.cb[i]->f * c.cb[i]->avg[n] + *(p+n))/(c.cb[i]->f + 1); c.cb[i]->avg[n] = avg[n]; if(c.cb[i]->max[n] < *(p+n)) { c.cb[i]->max[n] = *(p+n); } else if(c.cb[i]->min[n] > *(p+n)) { c.cb[i]->min[n] = *(p+n); } } c.cb[i]->f += 1; c.cb[i]->t_last_update = c.t; int negRun = c.t - c.cb[i]->t_last_update; if(c.cb[i]->stale < negRun) c.cb[i]->stale = negRun; break; } } for(int n=0; n<numChannels; n++) { high[n] = *(p+n)+*(cbBounds+n); if(high[n] > 255) high[n] = 255; low[n] = *(p+n)-*(cbBounds+n); if(low[n] < 0) low[n] = 0; } if(i == c.numEntries) { code_element **foo = new code_element* [c.numEntries+1]; for(int ii=0; ii<c.numEntries; ii++) { foo[ii] = c.cb[ii]; } foo[c.numEntries] = new code_element; if(c.numEntries) delete [] c.cb; c.cb = foo; for(int n=0; n<numChannels; n++) { c.cb[c.numEntries]->avg[n] = *(p+n); c.cb[c.numEntries]->max[n] = *(p+n); c.cb[c.numEntries]->min[n] = *(p+n); c.cb[c.numEntries]->learnHigh[n] = high[n]; c.cb[c.numEntries]->learnLow[n] = low[n]; } c.cb[c.numEntries]->f = 1; c.cb[c.numEntries]->stale = c.t-1; c.cb[c.numEntries]->t_first_update = c.t; c.cb[c.numEntries]->t_last_update = c.t; c.numEntries += 1; } for(int s=0; s<c.numEntries; s++) { int negRun = c.t - c.cb[s]->t_last_update + c.cb[s]->t_first_update -1 ; if(c.cb[s]->stale < negRun) c.cb[s]->stale = negRun; } for(n=0; n<numChannels; n++) { if(c.cb[i]->learnHigh[n] < high[n]) c.cb[i]->learnHigh[n] += 1; if(c.cb[i]->learnLow[n] > low[n]) c.cb[i]->learnLow[n] -= 1; } return(i); } int trainig_codebook(uchar* p,codeBook& c,unsigned* cbBounds,int numChannels) { if(c.numEntries == 0) c.t = 0; c.t += 1; unsigned int high[3],low[3]; int matchChannel; float avg[3]; for(int i=0; i<c.numEntries; i++) { matchChannel = 0; for(int n=0; n<numChannels; n++) { if((c.cb[i]->learnLow[n] <= *(p+n)) && (*(p+n) <= c.cb[i]->learnHigh[n])) { matchChannel++; } } if(matchChannel == numChannels) { for(int n=0; n<numChannels; n++) { avg[n] = (c.cb[i]->f * c.cb[i]->avg[n] + *(p+n))/(c.cb[i]->f + 1); c.cb[i]->avg[n] = avg[n]; if(c.cb[i]->max[n] < *(p+n)) { c.cb[i]->max[n] = *(p+n); } else if(c.cb[i]->min[n] > *(p+n)) { c.cb[i]->min[n] = *(p+n); } } c.cb[i]->f += 1; c.cb[i]->t_last_update = c.t; int negRun = c.t - c.cb[i]->t_last_update; if(c.cb[i]->stale < negRun) c.cb[i]->stale = negRun; if (i!=0) { code_element **fo = new code_element* [c.numEntries]; fo[0] = c.cb[i]; for(int h=0; h<i; h++) { fo[h+1] = c.cb[h]; } for(int h=i+1; h<c.numEntries; h++) { fo[h] = c.cb[h]; } if(c.numEntries) delete [] c.cb; c.cb = fo; } break; } } for(int n=0; n<numChannels; n++) { high[n] = *(p+n)+*(cbBounds+n); if(high[n] > 255) high[n] = 255; low[n] = *(p+n)-*(cbBounds+n); if(low[n] < 0) low[n] = 0; } if(i == c.numEntries) { code_element **foo = new code_element* [c.numEntries+1]; for(int ii=0; ii<c.numEntries; ii++) { foo[ii] = c.cb[ii]; } foo[c.numEntries] = new code_element; if(c.numEntries) delete [] c.cb; c.cb = foo; for(n=0; n<numChannels; n++) { c.cb[c.numEntries]->avg[n] = *(p+n); c.cb[c.numEntries]->max[n] = *(p+n); c.cb[c.numEntries]->min[n] = *(p+n); c.cb[c.numEntries]->learnHigh[n] = high[n]; c.cb[c.numEntries]->learnLow[n] = low[n]; } c.cb[c.numEntries]->f = 1; c.cb[c.numEntries]->stale = c.t-1; c.cb[c.numEntries]->t_first_update = c.t; c.cb[c.numEntries]->t_last_update = c.t; c.numEntries += 1; } for(int s=0; s<c.numEntries; s++) { int negRun = c.t - c.cb[s]->t_last_update + c.cb[s]->t_first_update -1 ; if(c.cb[s]->stale < negRun) c.cb[s]->stale = negRun; } for(int n=0; n<numChannels; n++) { if(c.cb[i]->learnHigh[n] < high[n]) c.cb[i]->learnHigh[n] += 1; if(c.cb[i]->learnLow[n] > low[n]) c.cb[i]->learnLow[n] -= 1; } return(i); } int training_clear_stale_entries(codeBook &c) { int staleThresh = c.t>>1; int *keep = new int [c.numEntries]; int keepCnt = 0; for(int i=0; i<c.numEntries; i++) { if(c.cb[i]->stale > staleThresh) keep[i] = 0; else { keep[i] = 1; keepCnt += 1; } } code_element **foo = new code_element* [keepCnt]; int k=0; for(int ii=0; ii<c.numEntries; ii++) { if(keep[ii]) { foo[k] = c.cb[ii]; k++; } } delete [] keep; delete [] c.cb; c.cb = foo; int numCleared = c.numEntries - keepCnt; c.numEntries = keepCnt; return(numCleared); } int det_update_codebook_cC(uchar* p,codeBook& c,unsigned* cbBounds,int numChannels) { c.t += 1; int matchChannel; float avg[3]; int learnLow[3],learnHigh[3]; for(int i=0; i<c.numEntries; i++) { matchChannel = 0; for(int n=0; n<numChannels; n++) { if (forgratio >= Tadap_update ) { learnLow[n] = c.cb[i]->learnLow[n] * (1 - gamma); c.cb[i]->learnLow[n] = learnLow[n]; learnHigh[n] = c.cb[i]->learnHigh[n] * (1 + gamma); c.cb[i]->learnHigh[n] = learnHigh[n]; } if((c.cb[i]->learnLow[n] <= *(p+n)) && (*(p+n) <= c.cb[i]->learnHigh[n])) { matchChannel++; } } if(matchChannel == numChannels) { if (forgratio >= Tadap_update ) { for(int n=0; n<numChannels; n++) { avg[n] = (1 - beta) * c.cb[i]->avg[n] + *(p+n) * beta; c.cb[i]->avg[n] = avg[n]; if(c.cb[i]->max[n] < *(p+n)) { c.cb[i]->max[n] = *(p+n); } else if(c.cb[i]->min[n] > *(p+n)) { c.cb[i]->min[n] = *(p+n); } } } else { for(int n=0; n<numChannels; n++) { avg[n] = (c.cb[i]->f * c.cb[i]->avg[n] + *(p+n))/(c.cb[i]->f + 1); c.cb[i]->avg[n] = avg[n]; if(c.cb[i]->max[n] < *(p+n)) { c.cb[i]->max[n] = *(p+n); } else if(c.cb[i]->min[n] > *(p+n)) { c.cb[i]->min[n] = *(p+n); } } } int negRun = c.t - c.cb[i]->t_last_update; if(c.cb[i]->stale < negRun) c.cb[i]->stale = negRun; c.cb[i]->t_last_update = c.t; c.cb[i]->f += 1; break; } } if( i == c.numEntries) return (i); return(0); } int det_update_codebook_cD(uchar* p,codeBook& c,unsigned* cbBounds,int numChannels, int numframe) { if(c.numEntries == 0) c.t = numframe -1; c.t += 1; unsigned int high[3],low[3]; int matchChannel; float avg[3]; int learnLow[3],learnHigh[3]; for(int i=0; i<c.numEntries; i++) { matchChannel = 0; for(int n=0; n<numChannels; n++) { if (forgratio >= Tadap_update ) { learnLow[n] = c.cb[i]->learnLow[n] * (1 - gamma); c.cb[i]->learnLow[n] = learnLow[n]; learnHigh[n] = c.cb[i]->learnHigh[n] * (1 + gamma); c.cb[i]->learnHigh[n] = learnHigh[n]; } if((c.cb[i]->learnLow[n] <= *(p+n)) && (*(p+n) <= c.cb[i]->learnHigh[n])) { matchChannel++; } } if(matchChannel == numChannels) { if (forgratio >= Tadap_update ) { for(int n=0; n<numChannels; n++) { avg[n] = (1 - beta) * c.cb[i]->avg[n] + *(p+n) * beta; c.cb[i]->avg[n] = avg[n]; if(c.cb[i]->max[n] < *(p+n)) { c.cb[i]->max[n] = *(p+n); } else if(c.cb[i]->min[n] > *(p+n)) { c.cb[i]->min[n] = *(p+n); } } } else { for(int n=0; n<numChannels; n++) { avg[n] = (c.cb[i]->f * c.cb[i]->avg[n] + *(p+n))/(c.cb[i]->f + 1); c.cb[i]->avg[n] = avg[n]; if(c.cb[i]->max[n] < *(p+n)) { c.cb[i]->max[n] = *(p+n); } else if(c.cb[i]->min[n] > *(p+n)) { c.cb[i]->min[n] = *(p+n); } } } int negRun = c.t - c.cb[i]->t_last_update; if(c.cb[i]->stale < negRun) c.cb[i]->stale = negRun; c.cb[i]->f += 1; c.cb[i]->t_last_update = c.t; break; } } for(int n=0; n<numChannels; n++) { high[n] = *(p+n)+*(cbBounds+n); if(high[n] > 255) high[n] = 255; low[n] = *(p+n)-*(cbBounds+n); if(low[n] < 0) low[n] = 0; } if(i == c.numEntries) { code_element **foo = new code_element* [c.numEntries+1]; for(int ii=0; ii<c.numEntries; ii++) { foo[ii] = c.cb[ii]; } foo[c.numEntries] = new code_element; if(c.numEntries) delete [] c.cb; c.cb = foo; for(int n=0; n<numChannels; n++) { c.cb[c.numEntries]->avg[n] = *(p+n); c.cb[c.numEntries]->max[n] = *(p+n); c.cb[c.numEntries]->min[n] = *(p+n); c.cb[c.numEntries]->learnHigh[n] = high[n]; c.cb[c.numEntries]->learnLow[n] = low[n]; } c.cb[c.numEntries]->f = 1; c.cb[c.numEntries]->stale = 0; c.cb[c.numEntries]->t_first_update = c.t; c.cb[c.numEntries]->t_last_update = c.t; c.numEntries += 1; } for(int s=0; s<c.numEntries; s++) { int negRun = c.t - c.cb[s]->t_last_update; if(c.cb[s]->stale < negRun) c.cb[s]->stale = negRun; } for(int n=0; n<numChannels; n++) { if(c.cb[i]->learnHigh[n] < high[n]) c.cb[i]->learnHigh[n] += 1; if(c.cb[i]->learnLow[n] > low[n]) c.cb[i]->learnLow[n] -= 1; } return(i); } int realtime_clear_stale_entries_cC(codeBook &c, int FrmNum) { int staleThresh = FrmNum/2; int *keep = new int [c.numEntries]; int keepCnt = 0; for(int i=0; i<c.numEntries; i++) { if(c.cb[i]->stale > staleThresh) keep[i] = 0; else { keep[i] = 1; keepCnt += 1; } } c.t = 0; code_element **foo = new code_element* [keepCnt]; int k=0; for(int ii=0; ii<c.numEntries; ii++) { if(keep[ii]) { foo[k] = c.cb[ii]; k++; } } delete [] keep; delete [] c.cb; c.cb = foo; int numCleared = c.numEntries - keepCnt; c.numEntries = keepCnt; return(numCleared); } int realtime_clear_stale_entries_cD(codeBook &c, int FrmNum) { int *keep = new int [c.numEntries]; int keepCnt = 0; for(int i=0; i<c.numEntries; i++) { if(c.cb[i]->f <=Fd && c.cb[i]->stale >=Tavgstale_cD) keep[i] = 0; else { keep[i] = 1; keepCnt += 1; } } code_element **foo = new code_element* [keepCnt]; int k=0; for(int ii=0; ii<c.numEntries; ii++) { if(keep[ii]) { foo[k] = c.cb[ii]; k++; } } delete [] keep; delete [] c.cb; c.cb = foo; int numCleared = c.numEntries - keepCnt; c.numEntries = keepCnt; return(numCleared); } int cD_to_cC(codeBook &d, codeBook &c, int FrmNum) { int *keep_d = new int [d.numEntries]; int keepCnt = 0; for(int i=0; i<d.numEntries; i++) { int convertThresh = (FrmNum - T)/d.cb[i]->f; if(d.cb[i]->f >=Fadd && convertThresh <=Tavgstale) { keep_d[i] = 0; } else { keep_d[i] = 1; keepCnt += 1; } } code_element **foo_d = new code_element* [keepCnt]; int k=0; for(int ii=0; ii<d.numEntries; ii++) { if(keep_d[ii]) { foo_d[k] = d.cb[ii]; k++; } else { code_element **foo_c = new code_element* [c.numEntries+1]; for(int jj=0; jj<c.numEntries; jj++) { foo_c[jj] = c.cb[jj]; } foo_c[c.numEntries] = new code_element; delete [] c.cb; c.cb = foo_c; c.cb[c.numEntries] = d.cb[ii]; c.numEntries +=1; } } delete [] keep_d; delete [] d.cb; d.cb = foo_d; int numconverted = d.numEntries - keepCnt; d.numEntries = keepCnt; return(numconverted); } ``` 下面是报错: 1>------ 已启动生成: 项目: Realtime_online_cb_det, 配置: Debug x64 ------ 1> Realtime_online_cb_det.cpp 1>Realtime_online_cb_det.cpp(185): error C2065: “CvBGStatModel”: 未声明的标识符 1>Realtime_online_cb_det.cpp(185): error C2065: “bg_model”: 未声明的标识符 1>Realtime_online_cb_det.cpp(186): error C2065: “CvBGStatModel”: 未声明的标识符 1>Realtime_online_cb_det.cpp(186): error C2065: “bg_model1”: 未声明的标识符 1>Realtime_online_cb_det.cpp(271): error C2065: “bg_model”: 未声明的标识符 1>Realtime_online_cb_det.cpp(271): error C3861: “cvCreateGaussianBGModel”: 找不到标识符 1>Realtime_online_cb_det.cpp(272): error C2065: “bg_model1”: 未声明的标识符 1>Realtime_online_cb_det.cpp(272): error C3861: “cvCreateFGDStatModel”: 找不到标识符 1>Realtime_online_cb_det.cpp(308): error C3861: “cvChangeDetection”: 找不到标识符 1>Realtime_online_cb_det.cpp(309): error C3861: “cvChangeDetection”: 找不到标识符 1>Realtime_online_cb_det.cpp(315): error C2065: “bg_model”: 未声明的标识符 1>Realtime_online_cb_det.cpp(315): error C3861: “cvUpdateBGStatModel”: 找不到标识符 1>Realtime_online_cb_det.cpp(316): error C2065: “bg_model1”: 未声明的标识符 1>Realtime_online_cb_det.cpp(316): error C3861: “cvUpdateBGStatModel”: 找不到标识符 1>Realtime_online_cb_det.cpp(381): error C2065: “bg_model1”: 未声明的标识符 1>Realtime_online_cb_det.cpp(381): error C2227: “->foreground”的左边必须指向类/结构/联合/泛型类型 1> 类型是“unknown-type” 1>Realtime_online_cb_det.cpp(381): error C2227: “->origin”的左边必须指向类/结构/联合/泛型类型 1>Realtime_online_cb_det.cpp(382): error C2065: “bg_model”: 未声明的标识符 1>Realtime_online_cb_det.cpp(382): error C2227: “->foreground”的左边必须指向类/结构/联合/泛型类型 1> 类型是“unknown-type” 1>Realtime_online_cb_det.cpp(382): error C2227: “->origin”的左边必须指向类/结构/联合/泛型类型 1>Realtime_online_cb_det.cpp(391): error C2065: “bg_model”: 未声明的标识符 1>Realtime_online_cb_det.cpp(391): error C2227: “->foreground”的左边必须指向类/结构/联合/泛型类型 1> 类型是“unknown-type” 1>Realtime_online_cb_det.cpp(391): error C2660: “cvShowImage”: 函数不接受 1 个参数 1>Realtime_online_cb_det.cpp(396): error C2065: “bg_model1”: 未声明的标识符 1>Realtime_online_cb_det.cpp(396): error C2227: “->foreground”的左边必须指向类/结构/联合/泛型类型 1> 类型是“unknown-type” 1>Realtime_online_cb_det.cpp(396): error C2660: “cvShowImage”: 函数不接受 1 个参数 1>Realtime_online_cb_det.cpp(529): error C2065: “CvBGStatModel”: 未声明的标识符 1>Realtime_online_cb_det.cpp(529): error C2059: 语法错误:“)” 1>Realtime_online_cb_det.cpp(530): error C2065: “CvBGStatModel”: 未声明的标识符 1>Realtime_online_cb_det.cpp(530): error C2059: 语法错误:“)” 1>Realtime_online_cb_det.cpp(529): error C3861: “cvReleaseBGStatModel”: 找不到标识符 1>Realtime_online_cb_det.cpp(530): error C3861: “cvReleaseBGStatModel”: 找不到标识符 1>Realtime_online_cb_det.cpp(677): error C2065: “i”: 未声明的标识符 1>Realtime_online_cb_det.cpp(712): error C2065: “n”: 未声明的标识符 1>Realtime_online_cb_det.cpp(714): error C2065: “i”: 未声明的标识符 1>Realtime_online_cb_det.cpp(714): error C2227: “->learnHigh”的左边必须指向类/结构/联合/泛型类型 1>Realtime_online_cb_det.cpp(714): error C2065: “n”: 未声明的标识符 1>Realtime_online_cb_det.cpp(715): error C2065: “i”: 未声明的标识符 1>Realtime_online_cb_det.cpp(715): error C2227: “->learnLow”的左边必须指向类/结构/联合/泛型类型 1>Realtime_online_cb_det.cpp(715): error C2065: “n”: 未声明的标识符 1>Realtime_online_cb_det.cpp(717): error C2065: “i”: 未声明的标识符 1>Realtime_online_cb_det.cpp(789): error C2065: “i”: 未声明的标识符 1>Realtime_online_cb_det.cpp(799): error C2065: “n”: 未声明的标识符 1>Realtime_online_cb_det.cpp(801): error C2065: “n”: 未声明的标识符 1>Realtime_online_cb_det.cpp(802): error C2065: “n”: 未声明的标识符 1>Realtime_online_cb_det.cpp(803): error C2065: “n”: 未声明的标识符 1>Realtime_online_cb_det.cpp(804): error C2065: “n”: 未声明的标识符 1>Realtime_online_cb_det.cpp(805): error C2065: “n”: 未声明的标识符 1>Realtime_online_cb_det.cpp(824): error C2065: “i”: 未声明的标识符 1>Realtime_online_cb_det.cpp(824): error C2227: “->learnHigh”的左边必须指向类/结构/联合/泛型类型 1>Realtime_online_cb_det.cpp(825): error C2065: “i”: 未声明的标识符 1>Realtime_online_cb_det.cpp(825): error C2227: “->learnLow”的左边必须指向类/结构/联合/泛型类型 1>Realtime_online_cb_det.cpp(827): error C2065: “i”: 未声明的标识符 1>Realtime_online_cb_det.cpp(880): warning C4244: “=”: 从“float”转换到“int”,可能丢失数据 1>Realtime_online_cb_det.cpp(882): warning C4244: “=”: 从“float”转换到“int”,可能丢失数据 1>Realtime_online_cb_det.cpp(938): error C2065: “i”: 未声明的标识符 1>Realtime_online_cb_det.cpp(962): warning C4244: “=”: 从“float”转换到“int”,可能丢失数据 1>Realtime_online_cb_det.cpp(964): warning C4244: “=”: 从“float”转换到“int”,可能丢失数据 1>Realtime_online_cb_det.cpp(1024): error C2065: “i”: 未声明的标识符 1>Realtime_online_cb_det.cpp(1061): error C2065: “i”: 未声明的标识符 1>Realtime_online_cb_det.cpp(1061): error C2227: “->learnHigh”的左边必须指向类/结构/联合/泛型类型 1>Realtime_online_cb_det.cpp(1062): error C2065: “i”: 未声明的标识符 1>Realtime_online_cb_det.cpp(1062): error C2227: “->learnLow”的左边必须指向类/结构/联合/泛型类型 1>Realtime_online_cb_det.cpp(1064): error C2065: “i”: 未声明的标识符 ========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
caffe生成解决方案时出错
编译环境:win10 vs2017 15.5.6 boost_1_70_0 主要报错: Unknown compiler version - please run the configure tests and report the results 再次点生成解决方案时的主要报错: for each 语句不能在“std::array *”类型的变量上操作 ; “std::array”: 模板 参数太少 ; 无法打开文件“libboost_date_time-vc140-mt-gd-1_59.lib” 等等; 因为只能一条条复制,所以如有需要,可提供详细错误; 下面是重新生成解决方案的具体报错,有大佬来救救我吗,感激不尽!需要更详细信息可以直说。 报错:1>------ 已启动全部重新生成: 项目: libcaffe, 配置: Debug x64 ------ 1>ProtoCompile.cmd : Create proto temp directory "C:\Users\Kay Chow\Documents\caffe-master\windows\..\src\caffe\proto\temp" 1>ProtoCompile.cmd : Generating "C:\Users\Kay Chow\Documents\caffe-master\windows\..\src\caffe\proto\temp\caffe.pb.h" and "C:\Users\Kay Chow\Documents\caffe-master\windows\..\src\caffe\proto\temp\caffe.pb.cc" 1>ProtoCompile.cmd : Create proto include directory 1>子目录或文件 C:\Users\Kay Chow\Documents\caffe-master\windows\..\include\caffe\proto 已经存在。 1>ProtoCompile.cmd : Compare newly compiled caffe.pb.h with existing one 1>blob.cpp 1>common.cpp 1>data_reader.cpp 1>data_transformer.cpp 1>internal_thread.cpp 1>layer.cpp 1>absval_layer.cpp 1>accuracy_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>argmax_layer.cpp 1>base_conv_layer.cpp 1>base_data_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>batch_norm_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>batch_reindex_layer.cpp 1>bias_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>bnll_layer.cpp 1>box_annotator_ohem_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>concat_layer.cpp 1>contrastive_loss_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>conv_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>crop_layer.cpp 1>cudnn_conv_layer.cpp 1>cudnn_lcn_layer.cpp 1>cudnn_lrn_layer.cpp 1>cudnn_pooling_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>cudnn_relu_layer.cpp 1>cudnn_sigmoid_layer.cpp 1>cudnn_softmax_layer.cpp 1>cudnn_tanh_layer.cpp 1>data_layer.cpp 1>deconv_layer.cpp 1>dropout_layer.cpp 1>dummy_data_layer.cpp 1>eltwise_layer.cpp 1>elu_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>embed_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>euclidean_loss_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>exp_layer.cpp 1>filter_layer.cpp 1>flatten_layer.cpp 1>hdf5_data_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>hdf5_output_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>hinge_loss_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>im2col_layer.cpp 1>image_data_layer.cpp 1>infogain_loss_layer.cpp 1>inner_product_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>input_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>log_layer.cpp 1>loss_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>lrn_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>memory_data_layer.cpp 1>multinomial_logistic_loss_layer.cpp 1>mvn_layer.cpp 1>neuron_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>parameter_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>pooling_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>power_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>prelu_layer.cpp 1>psroi_pooling_layer.cpp 1>reduction_layer.cpp 1>relu_layer.cpp 1>reshape_layer.cpp 1>scale_layer.cpp 1>sigmoid_cross_entropy_loss_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>sigmoid_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>silence_layer.cpp 1>slice_layer.cpp 1>smooth_l1_loss_layer.cpp 1>smooth_L1_loss_ohem_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>softmax_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>softmax_loss_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>softmax_loss_ohem_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>split_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>spp_layer.cpp 1>tanh_layer.cpp 1>threshold_layer.cpp 1>tile_layer.cpp 1>window_data_layer.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>layer_factory.cpp 1>net.cpp 1>parallel.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>caffe.pb.cc 1>solver.cpp 1>adadelta_solver.cpp 1>adagrad_solver.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>adam_solver.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>nesterov_solver.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>rmsprop_solver.cpp 1>sgd_solver.cpp 1>syncedmem.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>benchmark.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>blocking_queue.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>cudnn.cpp 1>db.cpp 1>db_leveldb.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>db_lmdb.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>hdf5.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>im2col.cpp 1>insert_splits.cpp 1>io.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>math_functions.cpp 1>signal_handler.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>upgrade_proto.cpp 1>Unknown compiler version - please run the configure tests and report the results 1>Unknown compiler version - please run the configure tests and report the results 1>libcaffe.vcxproj -> C:\Users\Kay Chow\Documents\caffe-master\windows\..\Build\x64\Debug\libcaffe.lib 1>BinplaceCudaDependencies : CPU only build, don't copy cuda dependencies. 2>------ 已启动全部重新生成: 项目: caffe, 配置: Debug x64 ------ 3>------ 已启动全部重新生成: 项目: caffe.managed, 配置: Debug x64 ------ 4>------ 已启动全部重新生成: 项目: convert_cifar_data, 配置: Debug x64 ------ 5>------ 已启动全部重新生成: 项目: classification, 配置: Debug x64 ------ 6>------ 已启动全部重新生成: 项目: convert_mnist_data, 配置: Debug x64 ------ 7>------ 已启动全部重新生成: 项目: convert_mnist_siamese_data, 配置: Debug x64 ------ 8>------ 已启动全部重新生成: 项目: upgrade_net_proto_binary, 配置: Debug x64 ------ 9>------ 已启动全部重新生成: 项目: upgrade_net_proto_text, 配置: Debug x64 ------ 2>caffe.cpp 9>upgrade_net_proto_text.cpp 2>Unknown compiler version - please run the configure tests and report the results 4>convert_cifar_data.cpp 3>Stdafx.cpp 9>Unknown compiler version - please run the configure tests and report the results 5>classification.cpp 6>convert_mnist_data.cpp 7>convert_mnist_siamese_data.cpp 4>Unknown compiler version - please run the configure tests and report the results 5>Unknown compiler version - please run the configure tests and report the results 8>upgrade_net_proto_binary.cpp 6>Unknown compiler version - please run the configure tests and report the results 8>Unknown compiler version - please run the configure tests and report the results 7>Unknown compiler version - please run the configure tests and report the results 3>AssemblyInfo.cpp 3>caffelib.cpp 3>caffelib.cpp(61): error C2976: “std::array”: 模板 参数太少 3>D:\VS2017\VC\Tools\MSVC\14.12.25827\include\utility(474): note: 参见“std::array”的声明 3>caffelib.cpp(62): error C3699: “^”: 不能在类型“std::array”上使用此间接寻址 3>caffelib.cpp(62): note: 编译器将“^”替换为“*”以继续进行分析 3>caffelib.cpp(68): error C2976: “std::array”: 模板 参数太少 3>D:\VS2017\VC\Tools\MSVC\14.12.25827\include\utility(474): note: 参见“std::array”的声明 3>caffelib.cpp(68): error C3699: “^”: 不能在类型“std::array”上使用此间接寻址 3>caffelib.cpp(68): note: 编译器将“^”替换为“*”以继续进行分析 3>caffelib.cpp(69): error C3699: “^”: 不能在类型“std::array”上使用此间接寻址 3>caffelib.cpp(69): note: 编译器将“^”替换为“*”以继续进行分析 3>caffelib.cpp(127): error C2976: “std::array”: 模板 参数太少 3>D:\VS2017\VC\Tools\MSVC\14.12.25827\include\utility(474): note: 参见“std::array”的声明 3>caffelib.cpp(128): error C3699: “^”: 不能在类型“std::array”上使用此间接寻址 3>caffelib.cpp(128): note: 编译器将“^”替换为“*”以继续进行分析 3>caffelib.cpp(136): error C2976: “std::array”: 模板 参数太少 3>D:\VS2017\VC\Tools\MSVC\14.12.25827\include\utility(474): note: 参见“std::array”的声明 3>caffelib.cpp(136): error C3699: “^”: 不能在类型“std::array”上使用此间接寻址 3>caffelib.cpp(136): note: 编译器将“^”替换为“*”以继续进行分析 3>caffelib.cpp(137): error C3699: “^”: 不能在类型“std::array”上使用此间接寻址 3>caffelib.cpp(137): note: 编译器将“^”替换为“*”以继续进行分析 3>caffelib.cpp(64): error C2976: “std::array”: 模板 参数太少 3>D:\VS2017\VC\Tools\MSVC\14.12.25827\include\utility(474): note: 参见“std::array”的声明 3>caffelib.cpp(64): error C2027: 使用了未定义类型“std::array” 3>D:\VS2017\VC\Tools\MSVC\14.12.25827\include\utility(474): note: 参见“std::array”的声明 3>caffelib.cpp(64): error C3536: “outputs”: 初始化之前无法使用 3>caffelib.cpp(64): error C2109: 下标要求数组或指针类型 3>caffelib.cpp(65): error C2440: “return”: 无法从“int”转换为“std::array *” 3>caffelib.cpp(65): note: 从整型转换为指针类型要求 reinterpret_cast、C 样式转换或函数样式转换 3>caffelib.cpp(71): error C3285: for each 语句不能在“std::array *”类型的变量上操作 3>caffelib.cpp(72): error C2065: “name”: 未声明的标识符 3>caffelib.cpp(74): error C2976: “std::array”: 模板 参数太少 3>D:\VS2017\VC\Tools\MSVC\14.12.25827\include\utility(474): note: 参见“std::array”的声明 3>caffelib.cpp(74): error C3699: “^”: 不能在类型“std::array”上使用此间接寻址 3>caffelib.cpp(74): note: 编译器将“^”替换为“*”以继续进行分析 3>caffelib.cpp(74): error C2027: 使用了未定义类型“std::array” 3>D:\VS2017\VC\Tools\MSVC\14.12.25827\include\utility(474): note: 参见“std::array”的声明 3>caffelib.cpp(78): error C2976: “std::array”: 模板 参数太少 3>D:\VS2017\VC\Tools\MSVC\14.12.25827\include\utility(474): note: 参见“std::array”的声明 3>caffelib.cpp(78): error C2027: 使用了未定义类型“std::array” 3>D:\VS2017\VC\Tools\MSVC\14.12.25827\include\utility(474): note: 参见“std::array”的声明 3>caffelib.cpp(78): error C3536: “values”: 初始化之前无法使用 3>caffelib.cpp(78): error C2109: 下标要求数组或指针类型 3>caffelib.cpp(79): error C3536: “outputs”: 初始化之前无法使用 3>caffelib.cpp(79): error C2109: 下标要求数组或指针类型 3>caffelib.cpp(81): error C2440: “return”: 无法从“int”转换为“std::array *” 3>caffelib.cpp(81): note: 从整型转换为指针类型要求 reinterpret_cast、C 样式转换或函数样式转换 3>caffelib.cpp(132): error C2976: “std::array”: 模板 参数太少 3>D:\VS2017\VC\Tools\MSVC\14.12.25827\include\utility(474): note: 参见“std::array”的声明 3>caffelib.cpp(132): error C2027: 使用了未定义类型“std::array” 3>D:\VS2017\VC\Tools\MSVC\14.12.25827\include\utility(474): note: 参见“std::array”的声明 3>caffelib.cpp(132): error C3536: “outputs”: 初始化之前无法使用 3>caffelib.cpp(132): error C2109: 下标要求数组或指针类型 3>caffelib.cpp(133): error C2440: “return”: 无法从“int”转换为“std::array *” 3>caffelib.cpp(133): note: 从整型转换为指针类型要求 reinterpret_cast、C 样式转换或函数样式转换 3>caffelib.cpp(141): error C3285: for each 语句不能在“std::array *”类型的变量上操作 3>caffelib.cpp(142): error C2065: “name”: 未声明的标识符 3>caffelib.cpp(144): error C2976: “std::array”: 模板 参数太少 3>D:\VS2017\VC\Tools\MSVC\14.12.25827\include\utility(474): note: 参见“std::array”的声明 3>caffelib.cpp(144): error C3699: “^”: 不能在类型“std::array”上使用此间接寻址 3>caffelib.cpp(144): note: 编译器将“^”替换为“*”以继续进行分析 3>caffelib.cpp(144): error C2027: 使用了未定义类型“std::array” 3>D:\VS2017\VC\Tools\MSVC\14.12.25827\include\utility(474): note: 参见“std::array”的声明 3>caffelib.cpp(148): error C2976: “std::array”: 模板 参数太少 3>D:\VS2017\VC\Tools\MSVC\14.12.25827\include\utility(474): note: 参见“std::array”的声明 3>caffelib.cpp(148): error C2027: 使用了未定义类型“std::array” 3>D:\VS2017\VC\Tools\MSVC\14.12.25827\include\utility(474): note: 参见“std::array”的声明 3>caffelib.cpp(148): error C3536: “values”: 初始化之前无法使用 3>caffelib.cpp(148): error C2109: 下标要求数组或指针类型 3>caffelib.cpp(149): error C3536: “outputs”: 初始化之前无法使用 3>caffelib.cpp(149): error C2109: 下标要求数组或指针类型 3>caffelib.cpp(151): error C2440: “return”: 无法从“int”转换为“std::array *” 3>caffelib.cpp(151): note: 从整型转换为指针类型要求 reinterpret_cast、C 样式转换或函数样式转换 3>已完成生成项目“caffe.managed.vcxproj”的操作 - 失败。 4>LINK : fatal error LNK1104: 无法打开文件“libboost_thread-vc140-mt-gd-1_59.lib” 10>------ 已启动全部重新生成: 项目: upgrade_solver_proto_text, 配置: Debug x64 ------ 4>已完成生成项目“convert_cifar_data.vcxproj”的操作 - 失败。 6>LINK : fatal error LNK1104: 无法打开文件“libboost_thread-vc140-mt-gd-1_59.lib” 6>已完成生成项目“convert_mnist_data.vcxproj”的操作 - 失败。 10>upgrade_solver_proto_text.cpp 7>LINK : fatal error LNK1104: 无法打开文件“libboost_thread-vc140-mt-gd-1_59.lib” 7>已完成生成项目“convert_mnist_siamese_data.vcxproj”的操作 - 失败。 10>Unknown compiler version - please run the configure tests and report the results 9>LINK : fatal error LNK1104: 无法打开文件“libboost_date_time-vc140-mt-gd-1_59.lib” 9>已完成生成项目“upgrade_net_proto_text.vcxproj”的操作 - 失败。 8>LINK : fatal error LNK1104: 无法打开文件“libboost_date_time-vc140-mt-gd-1_59.lib” 8>已完成生成项目“upgrade_net_proto_binary.vcxproj”的操作 - 失败。 5>LINK : fatal error LNK1104: 无法打开文件“libboost_date_time-vc140-mt-gd-1_59.lib” 5>已完成生成项目“classification.vcxproj”的操作 - 失败。 2>LINK : fatal error LNK1104: 无法打开文件“libboost_date_time-vc140-mt-gd-1_59.lib” 2>已完成生成项目“caffe.vcxproj”的操作 - 失败。 11>------ 已启动全部重新生成: 项目: compute_image_mean, 配置: Debug x64 ------ 12>------ 已启动全部重新生成: 项目: convert_imageset, 配置: Debug x64 ------ 13>------ 已启动全部重新生成: 项目: extract_features, 配置: Debug x64 ------ 14>------ 已启动全部重新生成: 项目: test_all, 配置: Debug x64 ------ 15>------ 已启动全部重新生成: 项目: pycaffe, 配置: Debug x64 ------ 16>------ 已启动全部重新生成: 项目: matcaffe, 配置: Debug x64 ------ 15>Skipping project pycaffe, Python support is not enabled in CommonSettings.props. 16>Skipping project matcaffe, Matlab support is not enabled in CommonSettings.props. 12>convert_imageset.cpp 11>compute_image_mean.cpp 13>extract_features.cpp 14>test_accuracy_layer.cpp 14>test_argmax_layer.cpp 14>test_batch_norm_layer.cpp 14>test_batch_reindex_layer.cpp 14>test_benchmark.cpp 14>test_bias_layer.cpp 14>test_blob.cpp 14>test_caffe_main.cpp 14>Unknown compiler version - please run the configure tests and report the results 13>Unknown compiler version - please run the configure tests and report the results 12>Unknown compiler version - please run the configure tests and report the results 11>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 10>LINK : fatal error LNK1104: 无法打开文件“libboost_date_time-vc140-mt-gd-1_59.lib” 10>已完成生成项目“upgrade_solver_proto_text.vcxproj”的操作 - 失败。 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 11>LINK : fatal error LNK1104: 无法打开文件“libboost_filesystem-vc140-mt-gd-1_59.lib” 11>已完成生成项目“compute_image_mean.vcxproj”的操作 - 失败。 12>LINK : fatal error LNK1104: 无法打开文件“libboost_filesystem-vc140-mt-gd-1_59.lib” 12>已完成生成项目“convert_imageset.vcxproj”的操作 - 失败。 13>LINK : fatal error LNK1104: 无法打开文件“libboost_filesystem-vc140-mt-gd-1_59.lib” 13>已完成生成项目“extract_features.vcxproj”的操作 - 失败。 14>test_common.cpp 14>test_concat_layer.cpp 14>test_contrastive_loss_layer.cpp 14>test_convolution_layer.cpp 14>test_crop_layer.cpp 14>test_data_layer.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>test_data_transformer.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>test_db.cpp 14>test_deconvolution_layer.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>test_dummy_data_layer.cpp 14>test_eltwise_layer.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>test_embed_layer.cpp 14>test_euclidean_loss_layer.cpp 14>test_filler.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>test_filter_layer.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>test_flatten_layer.cpp 14>test_gradient_based_solver.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>test_hdf5data_layer.cpp 14>test_hdf5_output_layer.cpp 14>test_hinge_loss_layer.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>test_im2col_layer.cpp 14>test_image_data_layer.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>test_infogain_loss_layer.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>test_inner_product_layer.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>test_internal_thread.cpp 14>test_io.cpp 14>test_layer_factory.cpp 14>test_lrn_layer.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>test_math_functions.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>test_maxpool_dropout_layers.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>test_memory_data_layer.cpp 14>test_multinomial_logistic_loss_layer.cpp 14>test_mvn_layer.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>test_net.cpp 14>test_neuron_layer.cpp 14>test_platform.cpp 14>test_pooling_layer.cpp 14>test_power_layer.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>test_protobuf.cpp 14>test_random_number_generator.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>test_reduction_layer.cpp 14>c:\users\kay chow\documents\caffe-master\src\caffe\test\test_net.cpp(1010): error C2220: 警告被视为错误 - 没有生成“object”文件 14>c:\users\kay chow\documents\caffe-master\src\caffe\test\test_net.cpp(992): note: 编译 类 模板 成员函数 "void caffe::NetTest_TestLossWeightMidNet_Test<T>::TestBody(void)" 时 14> with 14> [ 14> T=Type 14> ] 14>c:\users\kay chow\documents\caffe-master\src\gtest\gtest.h(7341): note: 参见对正在编译的 类 模板 实例化 "caffe::NetTest_TestLossWeightMidNet_Test<T>" 的引用 14> with 14> [ 14> T=Type 14> ] (编译源文件 ..\..\src\caffe\test\test_net.cpp) 14>c:\users\kay chow\documents\caffe-master\src\gtest\gtest.h(7327): note: 编译 类 模板 成员函数 "bool testing::internal::TypeParameterizedTest<caffe::NetTest,testing::internal::TemplateSel<caffe::NetTest_TestLossWeightMidNet_Test>,caffe::gtest_type_params_NetTest_>::Register(const char *,const char *,const char *,int)" 时 (编译源文件 ..\..\src\caffe\test\test_net.cpp) 14>c:\users\kay chow\documents\caffe-master\src\caffe\test\test_net.cpp(992): note: 参见对正在编译的函数 模板 实例化“bool testing::internal::TypeParameterizedTest<caffe::NetTest,testing::internal::TemplateSel<caffe::NetTest_TestLossWeightMidNet_Test>,caffe::gtest_type_params_NetTest_>::Register(const char *,const char *,const char *,int)”的引用 14>c:\users\kay chow\documents\caffe-master\src\caffe\test\test_net.cpp(992): note: 参见对正在编译的 类 模板 实例化 "testing::internal::TypeParameterizedTest<caffe::NetTest,testing::internal::TemplateSel<caffe::NetTest_TestLossWeightMidNet_Test>,caffe::gtest_type_params_NetTest_>" 的引用 14>c:\users\kay chow\documents\caffe-master\src\caffe\test\test_net.cpp(1010): warning C4838: 从“double”转换到“Dtype”需要收缩转换 14>c:\users\kay chow\documents\caffe-master\src\caffe\test\test_net.cpp(961): warning C4838: 从“double”转换到“Dtype”需要收缩转换 14>c:\users\kay chow\documents\caffe-master\src\caffe\test\test_net.cpp(941): note: 编译 类 模板 成员函数 "void caffe::NetTest_TestLossWeight_Test<T>::TestBody(void)" 时 14> with 14> [ 14> T=Type 14> ] 14>c:\users\kay chow\documents\caffe-master\src\gtest\gtest.h(7341): note: 参见对正在编译的 类 模板 实例化 "caffe::NetTest_TestLossWeight_Test<T>" 的引用 14> with 14> [ 14> T=Type 14> ] (编译源文件 ..\..\src\caffe\test\test_net.cpp) 14>c:\users\kay chow\documents\caffe-master\src\gtest\gtest.h(7327): note: 编译 类 模板 成员函数 "bool testing::internal::TypeParameterizedTest<caffe::NetTest,testing::internal::TemplateSel<caffe::NetTest_TestLossWeight_Test>,caffe::gtest_type_params_NetTest_>::Register(const char *,const char *,const char *,int)" 时 (编译源文件 ..\..\src\caffe\test\test_net.cpp) 14>c:\users\kay chow\documents\caffe-master\src\caffe\test\test_net.cpp(941): note: 参见对正在编译的函数 模板 实例化“bool testing::internal::TypeParameterizedTest<caffe::NetTest,testing::internal::TemplateSel<caffe::NetTest_TestLossWeight_Test>,caffe::gtest_type_params_NetTest_>::Register(const char *,const char *,const char *,int)”的引用 14>c:\users\kay chow\documents\caffe-master\src\caffe\test\test_net.cpp(941): note: 参见对正在编译的 类 模板 实例化 "testing::internal::TypeParameterizedTest<caffe::NetTest,testing::internal::TemplateSel<caffe::NetTest_TestLossWeight_Test>,caffe::gtest_type_params_NetTest_>" 的引用 14>test_reshape_layer.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>test_scale_layer.cpp 14>test_sigmoid_cross_entropy_loss_layer.cpp 14>test_slice_layer.cpp 14>test_softmax_layer.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>test_softmax_with_loss_layer.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>test_solver.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>test_solver_factory.cpp 14>test_split_layer.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>test_spp_layer.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>test_stochastic_pooling.cpp 14>test_syncedmem.cpp 14>test_tanh_layer.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>test_threshold_layer.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>Unknown compiler version - please run the configure tests and report the results 14>test_tile_layer.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>test_upgrade_proto.cpp 14>test_util_blas.cpp 14>gtest-all.cpp 14>Unknown compiler version - please run the configure tests and report the results 14>已完成生成项目“test_all.vcxproj”的操作 - 失败。 ========== 全部重新生成: 成功 3 个,失败 13 个,跳过 0 个 ==========
关于类声明与实现的分离的一个问题
这段代码是正确的,头文件实现了类的声明和定义。但是当我在建另一个源文件a.cpp时,在a.cpp里写上#include"Struct_new.h" _就立马报错了, 错误 1 error C2146: 语法错误: 缺少“;”(在标识符“elem1”的前面) c:\users\admin\documents\visual studio 2013\projects\struct\struct\struct_new.h 8 1 struct 说未定义识别法“Datatype”。这是为什么呢?_ 主程序: struct Datatype{ int a = 0; int b = 0; }; bool operator<(const Datatype& item1, const Datatype& item2){ return item1.a < item2.a; } using namespace std; #include"Struct_new.h" int main(){ Datatype v1, v2; v1.a = 3; v1.b = 4; v2.a = 5; v2.b = 6; T C(v1, v2); C.compare(); system("pause"); return 0; } ``` ``` 类的头文件: #ifndef STRUCT_NEW_H #define STRUCT_NEW_H #include<iostream> #include<stdlib.h> using namespace std; class T{ private: Datatype elem1, elem2; public: T(Datatype l1, Datatype l2) :elem1(l1), elem2(l2){ } void compare(); }; void T::compare(){ if (elem1.a < elem2.a) cout << "重载函数正确" << endl; cout << "重载错误" << endl; } #endif ``` ```
PL0编译器调用procedure无限循环
如题,自己参照网上的例子做了一个C语言的PL0编译器,能跑通,但是遇到调用procedure的时候,就会一直循环无限调用,查错查了好久,还是没有找到,希望有大神能为我解答一下!谢谢~ 代码如下,有点长。。 #include <iostream> #include <cstdlib> #include <cstdio> #include <cstring> using namespace std; #define MAXERR 20//最多错误次数 #define AL 12//标识符最大长度 #define NORW 14//保留字个数 #define NUMMAX 14//最大数字位数 #define TXMAX 100//符号表容量 #define AMAX 2048//地址上界 #define CXMAX 200//最多的虚拟机代码数 #define stacksize 500//运行时数据栈元素最多为500个 #define symnum 32 #define fctnum 8 enum symbol //符号 { nul, ident, number, pluss, minuss, times, slash, oddsym, eql, neq, lss, leq, gtr, geq, lparen, rparen, comma, semicolon, period, becomes, beginsym, endsym, ifsym, thensym, elsesym, whilesym, writesym, readsym, dosym, callsym, constsym, varsym, procsym, }; enum object //符号表类型 { constant, variable, procedure, }; enum fct //虚拟机指令 { LIT, OPR, LOD, STO, CAL, INT, JMP, JPC, }; struct instruction //虚拟机代码结构 { enum fct f;//虚拟机指令 int l;//引用层与声明层层次差 int a;//根据f的不同而不同 }; FILE * fin; FILE * fout; FILE * fv;//虚拟机代码 FILE * fo;//源代码 FILE * fr;//代码运行结果 FILE * ft;//符号表 char fname[AL]; char ch;//存放当前字符 int cc, ll;//getch计数器,cc表示ch的位 int cx;//虚拟机代码指针 int num;//当前数字 int err;//错误计数器 char a[AL+1];//临时符号 char id[AL+1];//当前ident char line[81];//行缓冲区 char word[NORW][AL];//保留字 enum symbol sym;//当前符号 enum symbol wsym[NORW];//保留字对应符号值 enum symbol ssym[256];//单字符符号值 struct instruction code[CXMAX];//存放虚拟机代码的数组 char mnemonic[fctnum][5];//虚拟机代码指令名称 bool declbegsys[symnum];//表示声明开始的符号集合 bool statbegsys[symnum];//表示语句开始的符号集合 bool facbegsys[symnum];//表示因子开始的符号集合 struct tablestruct //符号表结构 { char name[AL];//名字 enum object kind;//类型 int val;//数值 int level;//所处层 int addr;//地址 int size;//需要分配的数据区空间 }; struct tablestruct table[TXMAX];//符号表 void init(); int inset(int e, bool* s); int addset(bool* sr, bool* s1, bool* s2, int n); int subset(bool* sr, bool* s1, bool* s2, int n); int mulset(bool* sr, bool* s1, bool* s2, int n); void error(int n); void getsym(); void getch(); void gen(enum fct x, int y, int z); void test(bool* s1, bool* s2, int n); void block(int lev, int tx, bool* fsys); void enter(enum object k, int* ptx, int lev, int* pdx); int position(char* idt, int tx); void constdeclaration(int* ptx, int lev, int* pdx); void vardeclaration(int* ptx, int lev, int* pdx); void listcode(int cx0); void statement(bool* fsys, int* ptx, int lev); void expression(bool* fsys, int* ptx, int lev); void term(bool* fsys, int* ptx, int lev); void factor(bool* fsys, int* ptx, int lev); void condition(bool* fsys, int* ptx, int lev); void interpret(); int base(int l, int* s, int b); void init() { int i; for(i=0; i<255; i++) //单字符符号 { ssym[i] = nul; } ssym['+'] = pluss; ssym['-'] = minuss; ssym['*'] = times; ssym['/'] = slash; ssym['('] = lparen; ssym[')'] = rparen; ssym['='] = eql; ssym[','] = comma; ssym['.'] = period; ssym[';'] = semicolon; //保留字名字 strcpy(&(word[0][0]), "begin"); strcpy(&(word[1][0]), "call"); strcpy(&(word[2][0]), "const"); strcpy(&(word[3][0]), "do"); strcpy(&(word[4][0]), "else"); strcpy(&(word[5][0]), "end"); strcpy(&(word[6][0]), "if"); strcpy(&(word[7][0]), "odd"); strcpy(&(word[8][0]), "procedure"); strcpy(&(word[9][0]), "read"); strcpy(&(word[10][0]), "then"); strcpy(&(word[11][0]), "var"); strcpy(&(word[12][0]), "while"); strcpy(&(word[13][0]), "write"); //保留字符号 wsym[0] = beginsym; wsym[1] = callsym; wsym[2] = constsym; wsym[3] = dosym; wsym[4] = elsesym; wsym[5] = endsym; wsym[6] = ifsym; wsym[7] = oddsym; wsym[8] = procsym; wsym[9] = readsym; wsym[10] = thensym; wsym[11] = varsym; wsym[12] = whilesym; wsym[13] = writesym; //指令名称 strcpy(&(mnemonic[LIT][0]), "LIT"); strcpy(&(mnemonic[OPR][0]), "OPR"); strcpy(&(mnemonic[LOD][0]), "LOD"); strcpy(&(mnemonic[STO][0]), "STO"); strcpy(&(mnemonic[CAL][0]), "CAL"); strcpy(&(mnemonic[INT][0]), "INT"); strcpy(&(mnemonic[JMP][0]), "JMP"); strcpy(&(mnemonic[JPC][0]), "JPC"); //符号集 for(i=0; i<symnum; i++) { declbegsys[i] = false; statbegsys[i] = false; facbegsys[i] = false; } //声明开始符号集 declbegsys[constsym] = true; declbegsys[varsym] = true; declbegsys[procsym] = true; //语句开始符号集 statbegsys[beginsym] = true; statbegsys[callsym] = true; statbegsys[ifsym] = true; statbegsys[whilesym] = true; //因子开始符号集 facbegsys[ident] = true; facbegsys[number] = true; facbegsys[lparen] = true; } /* *用数组实现集合的集合运算 */ int inset(int e, bool* s) { return s[e]; } int addset(bool* sr, bool* s1, bool* s2, int n) { int i; for(i=0; i<n ;i++) { sr[i] = s1[i] || s2[i]; } return 0; } int subset(bool* sr, bool* s1, bool* s2, int n) { int i; for(i=0; i<n; i++) { sr[i] = s1[i] && (!s2[i]); } return 0; } int mulset(bool* sr, bool* s1, bool* s2, int n) { int i; for(i=0; i<n; i++) { sr[i] = s1[i] && s2[i]; } return 0; } //error处理:输出报错位置以及错误编号 void error(int n) { cc--;//出错时当前符号已经读完,cc-1 //printf("错误编号:%d\n",n); cout<<"错误编号:"<<n<<endl; fprintf(fo, "错误编号:%d\n", n); err++; if(err > MAXERR) { exit(1); } } //读取字符 void getch() { if(cc == ll)//判断缓冲区中是否有字符,若无字符,则读入下一行字符到缓冲区中 { if(feof(fin)) { cout<<"程序不完整"<<endl; exit(1); } ll = 0; cc = 0; printf("%d ", cx); fprintf(fo, "%d ", cx); ch = ' '; while(ch != 10)//读取一行字符到缓冲区 { //fscanf(fin,"%c",&ch) if(EOF == fscanf(fin, "%c", &ch)) { line[ll] = 0; break; } printf("%c", ch); //cout<<ch; fprintf(fo, "%c", ch); line[ll] = ch; ll++; } } ch = line[cc]; cc++; } //词法分析 void getsym() { int i, j, k; while(ch==' ' || ch==10 || ch==9)//过滤掉空格、换行符 { getch(); } if((ch>='a' && ch<='z') || (ch>='A' && ch<='Z')) { i = 0; do{ if(i < AL) { a[i] = ch; i++; } getch(); } while((ch>='a' && ch<='z') || (ch>='A' && ch<='Z') || (ch>='0' && ch<='9')); a[i] = 0; strcpy(id, a); /* for(j = 0; j < 13; j++) { if(strcmp(id, word[i]) == 0) break; } */ //改为用二分法查找保留字 j = 0; k = NORW - 1; do { i=(j + k) / 2; if(strcmp(id, word[i])<=0) { k = i - 1; } if(strcmp(id, word[i])>=0) { j = i + 1; } } while(j <= k); if(j - 1 > k)//单词为保留字 { sym = wsym[i]; } else//单词为标识符 { sym = ident; } } else { if(ch>='0' && ch<='9')//单词为数字 { i = 0; num = 0; sym = number; do { num = 10 * num + ch - '0'; i++; getch(); } while(ch>='0' && ch<='9'); //获取数字的值 i--; if(i > NUMMAX)//数字位数太大 { error(30); } } else { if(ch == ':')//检测赋值符号 { getch(); if(ch == '=') { sym = becomes; getch(); } else { sym = nul;//不能识别的符号 } } else { if(ch == '<')//检测小于或小于等于符号以及不等号 { getch(); if(ch == '=') { sym = leq; getch(); } else if(ch=='>')//检测不等号 { sym = neq;//构成不等号<> getch(); } else { sym = lss; } } else { if(ch == '>')//检测大于或大于等于符号 { getch(); if(ch == '=') { sym = geq; getch(); } else { sym = gtr; } } else { sym = ssym[ch];//当符号不满足上述条件时,全部按照单字符号处理 if(sym != period) { getch(); } } } } } } } //生成P-code即虚拟机代码 void gen(enum fct x, int y, int z ) { if (cx >= CXMAX) { cout<<"虚拟机代码长度过长!"<<endl; exit(1); } if ( z >= AMAX) { cout<<"地址偏移越界!"<<endl; exit(1); } code[cx].f = x; code[cx].l = y; code[cx].a = z; cx++; } //测速当前符号单词是否合法 void test(bool* s1, bool* s2, int n) { if(!inset(sym, s1)) { error(n);//当检测不通过时,不停获取符号,直到它属于S1或S2 while((!inset(sym, s1)) && (!inset(sym, s2))) { getsym(); } } } //分程序分析处理 void block(int lev, int tx, bool* fsys) { int i; int dx;//名字分配到的相对地址 int tx0;//保留初始tx int cx0;//保留初始cx bool nxtlev[symnum]; dx = 3;//分别存放SL,DL和返回地址 tx0 = tx;//本层标识符初始位置 table[tx].addr = cx;//当前层代码开始位置 gen(JMP, 0, 0);//生成跳转指令 do{ if(sym == constsym)//常量声明符号,处理常量声明 { getsym(); do{ constdeclaration(&tx, lev, &dx); while(sym == comma)//逗号,继续读取 { getsym(); constdeclaration(&tx, lev, &dx); } if(sym == semicolon)//分号,结束读取 { getsym(); } else { error(5);//漏掉逗号或者分号 } }while(sym == ident); } if(sym == varsym)//变量声名符号,处理变量声名 { getsym(); do{ vardeclaration(&tx, lev, &dx); while(sym == comma)//逗号,继续读取 { getsym(); vardeclaration(&tx, lev, &dx); } if(sym == semicolon)//分号,结束读取 { getsym(); } else { error(5);//漏掉逗号或者分号 } }while(sym == ident); } while(sym == procsym)//过程声名符号,处理过程声名 { getsym(); if(sym == ident) { enter(procedure, &tx, lev, &dx);//过程名字 getsym(); } else { error(4);//procedure后应为标识符 } if(sym == semicolon)//分号,结束读取 { getsym(); } else { error(5);//漏掉分号 } memcpy(nxtlev, fsys, sizeof(bool)* symnum); nxtlev[semicolon]=true; block(lev+1, tx, nxtlev);//递归 if(sym == semicolon) { getsym(); memcpy(nxtlev, statbegsys, sizeof(bool)* symnum); nxtlev[ident]=true; nxtlev[procsym]=true; test(nxtlev, fsys, 6); } else { error(5);//漏掉分号 } } memcpy(nxtlev, statbegsys, sizeof(bool)*symnum); nxtlev[ident]=true; //nxtlev[period]=true; test(nxtlev, declbegsys, 7); } while(inset(sym, declbegsys));//直到没有声明符号 code[table[tx0].addr].a = cx;//开始生成当前过程代码 table[tx0].addr = cx;//当前过程代码地址 table[tx0].size = dx;//dx为当前过程数据的size cx0 = cx; gen(INT, 0, dx);//生成分配内存代码 //输出符号表 for(i = 1; i <= tx; i++) { switch(table[i].kind) { case constant: printf("%d const %s", i, table[i].name); printf("val=%d\n", table[i].val); fprintf(ft, "%d const %s", i, table[i].name); fprintf(ft, "val=%d\n", table[i].val); break; case variable: printf("%d var %s", i, table[i].name); printf("lev=%d addr=%d\n", table[i].level, table[i].addr); fprintf(ft, "%d var %s", i, table[i].name); fprintf(ft, "lev=%d addr=%d\n", table[i].level, table[i].addr); break; case procedure: printf("%d proc %s", i, table[i].name); printf("lev=%d addr=%d size=%d\n", table[i].level,table[i].addr, table[i].size); fprintf(ft, "%d proc %s", i, table[i].name); fprintf(ft, "lev=%d adr=%d size=%d \n", table[i].level,table[i].addr, table[i].size); break; } } printf("\n"); fprintf(ft, "\n"); //语句后跟分号或end memcpy(nxtlev, fsys, sizeof(bool)* symnum);//每个后跟符号集和都包含上层后跟符号集和,以便补救 nxtlev[semicolon] = true; nxtlev[endsym] = true; statement(nxtlev, &tx, lev); gen(OPR, 0, 0); //每个过程出口都要使用的释放数据段命令 memset(nxtlev, 0, sizeof(bool)* symnum); //分程序没有补救集合 test(fsys, nxtlev, 8);//检测后跟符号正确性 listcode(cx0);//输出代码 } //登录符号表 void enter (enum object k, int *ptx, int lev, int *pdx) { (*ptx)++; strcpy(table[(*ptx)].name, id);//符号表记录标识符的名字 table[(*ptx)].kind = k; switch(k) { case constant://常量 if (num > AMAX) { error(31);//过界报错 num = 0; } table[(*ptx)].val = num;//记录常数值 break; case variable://变量 table[(*ptx)].level = lev; table[(*ptx)].addr = (*pdx); (*pdx)++; break; case procedure://过程 table[(*ptx)].level = lev; break; } } //查找标识符在符号表的位置 int position(char* idt, int tx) { int i; strcpy(table[0].name, idt); i = tx; while(strcmp(table[i].name, idt) != 0) { i--; } return i; } //常量定义处理 void constdeclaration(int* ptx, int lev,int* pdx) { if(sym == ident) { getsym(); if((sym == eql) || (sym == becomes)) { if(sym == becomes) { error(1);//应该是=而不是:= } getsym(); if(sym == number) { enter(constant, ptx, lev, pdx);//填写符号表 getsym(); } else { error(2);//=后应为数 } } else { error(3);//标识符后应为= } } else { error(4);//const后应为标识符 } } //变量声明处理 void vardeclaration(int* ptx ,int lev, int* pdx) { if(sym == ident) { enter(variable, ptx, lev, pdx);//填写符号表 getsym(); } else { error(4);//var后应为标识符 } } //列出P-code指令清单 void listcode(int cx0) { int i; printf("\n"); for(i=cx0; i<cx; i++) { printf("%d %s %d %d\n", i, mnemonic[code[i].f], code[i].l,code[i].a); fprintf(fv,"%d %s %d %d\n", i, mnemonic[code[i].f], code[i].l, code[i].a); } } //语句部分分析处理 void statement(bool* fsys, int * ptx, int lev) { int i, cx1, cx2; bool nxtlev[symnum]; if(sym == ident)//按照赋值语句处理 { i = position(id, *ptx);//查找标识符在符号表中的位置 if(i == 0) { error(11);//标识符未说明 } else { if((table[i].kind != variable)) { error(12);//不可向常量或过程赋值 i = 0; } else { getsym(); if(sym == becomes) { getsym(); memcpy(nxtlev, fsys, sizeof(bool)* symnum); expression(nxtlev, ptx, lev); if(i != 0) { gen(STO, lev-table[i].level, table[i].addr); } } else { error(13);//应为赋值运算符:= } } } } else { if(sym == readsym)//按照read语句处理 { getsym(); if(sym != lparen) { error(40);//应为左括号 } else { do{ getsym(); if(sym == ident) { i = position(id, *ptx);//查找要读的变量 } else { i = 0; } if(i == 0) { error(35);//read括号中标识符未声明 } else { gen(OPR, 0, 15);//生成输入指令 gen(STO, lev-table[i]. level, table[i].addr);//将栈顶内容存到变量中 } getsym(); }while(sym == comma);//读多个变量 } if(sym!=rparen) { error(33);//应为右括号 while(!inset(sym, fsys))//出错补救,直到收到上层函数的后跟符号 { getsym(); } } else { getsym(); } } else { if(sym==writesym)//按照write语句处理 { getsym(); if(sym != lparen) { error(40);//应为左括号 } else { do{ getsym(); memcpy(nxtlev, fsys, sizeof(bool)* symnum); nxtlev[rparen] = true; nxtlev[comma] = true;//write后符号为)或, expression(nxtlev, ptx, lev);//调用表达式处理 gen(OPR, 0, 13);//生成输出指令,输出栈顶的值 gen(OPR, 0, 14);//换行 }while(sym == comma);//输出多个 if(sym != rparen) { error(33);//应为右括号 } else { getsym(); } } } else { if(sym == callsym)//按照call语句处理 { getsym(); if(sym != ident) { error(14);//call后应为标识符 } else { i=position(id, *ptx); if(i == 0) { error(11); //过程未声明 } else { if(table[i].kind == procedure) { gen(CAL, lev-table[i].level, table[i].addr);//生成call指令 } else { error(15);//不可调用常量或变量 } } getsym(); } } else { if(sym == ifsym)//按照if语句处理 { getsym(); memcpy(nxtlev, fsys, sizeof(bool)* symnum); nxtlev[thensym] = true; nxtlev[dosym] = true;//if后符号为then或do condition(nxtlev, ptx, lev);//调用条件处理 if(sym == thensym) { getsym(); } else { error(16);//应为then } cx1 = cx;//当前指令地址 gen(JPC, 0, 0);//生成条件跳转指令 statement(fsys, ptx, lev);//处理then下面的语句 if(sym==elsesym)//处理else语句 { getsym(); cx2 = cx; code[cx1].a=cx+1;//cx+1为then语句执行后的else语句的位置 gen(JMP, 0, 0); statement(fsys, ptx, lev); code[cx2].a = cx;//cx为else后语句执行完的位置 } else { code[cx1].a = cx;//cx为then后面语句执行 完的位置,它正是前面未定的跳转地址*/ } } else { if(sym==beginsym)//按照复合语句处理 { getsym(); memcpy(nxtlev, fsys, sizeof(bool)* symnum); nxtlev[semicolon]=true; nxtlev[endsym]=true;//begin后符号为:或end statement(nxtlev, ptx, lev);//处理begin和end之间的语句 while((inset(sym, statbegsys)) || (sym == semicolon)) { if(sym = semicolon) { getsym(); } else { error(10);//语句之间没有分号 } statement(nxtlev, ptx, lev); }//循环处理 if(sym == endsym) { getsym(); } else { error(17);//应为分号或end } } else { if(sym == whilesym)//按照while语句处理 { cx1 = cx;//判断条件操作位置 getsym(); memcpy(nxtlev, fsys, sizeof(bool)* symnum); nxtlev[dosym]=true;//while后符号为do condition(nxtlev, ptx, lev);//调用条件处理 cx2 = cx;//循环体的结束的下一个位置 gen(JPC, 0, 0);//生成条件跳转 if(sym == dosym) { getsym(); } else { error(18);//应为do } statement(fsys, ptx, lev); gen(JMP, 0, cx1);//重新判断条件 code[cx2].a = cx; } } } } } } } memset(nxtlev, 0, sizeof(bool)* symnum);//语句结束无补救集合 test(fsys, nxtlev, 19);//检测语句结束的正确性 } //表达式分析处理 void expression(bool* fsys, int* ptx, int lev) { enum symbol sign;//正负号 bool nxtlev[symnum]; if((sym == pluss) || (sym == minuss))//开头的正负号 { sign = sym; getsym(); memcpy(nxtlev, fsys, sizeof(bool)* symnum); nxtlev[pluss] = true; nxtlev[minuss] = true; term(nxtlev, ptx, lev);//对项进行处理 if(sign == minuss) { gen(OPR, 0, 1);//如果开头为负号,生成取负指令 } } else { memcpy(nxtlev, fsys, sizeof(bool)* symnum); nxtlev[pluss] = true; nxtlev[minuss] = true; term(nxtlev, ptx, lev);//对项进行处理 } while((sym == pluss) || (sym == minuss)) { sign = sym; getsym(); memcpy(nxtlev, fsys, sizeof(bool)* symnum); nxtlev[pluss] = true; nxtlev[minuss] = true; term(nxtlev, ptx, lev);//对项进行处理 if(sign == pluss) { gen(OPR, 0, 2);//加法 } else { gen(OPR, 0, 3);//减法 } } } //项分析处理 void term(bool*fsys, int *ptx, int lev) { enum symbol sign;//乘除法符号 bool nxtlev[symnum]; memcpy(nxtlev, fsys, sizeof(bool)* symnum); nxtlev[times] = true; nxtlev[slash] = true; factor(nxtlev, ptx, lev);//对因子进行处理 while((sym == times) || (sym == slash)) { sign = sym; getsym(); factor(nxtlev, ptx, lev); if(sign == times) { gen(OPR, 0, 4);//乘法 } else { gen(OPR, 0, 5);//除法 } } } //因子分析处理 void factor(bool* fsys, int* ptx, int lev) { int i; bool nxtlev[symnum]; test(facbegsys, fsys, 24);//检测因子开始符号 while(inset(sym, facbegsys))//循环处理因子 { if(sym == ident)//因子为常量或者变量 { i = position(id, *ptx);//查找标识符位置 if(i == 0) { error(11);//未声明标识符 } else { switch(table[i].kind)//不同形式标识符 { case constant: gen(LIT, 0, table[i].val);//常量入栈 break; case variable: gen(LOD, lev-table[i].level, table[i].addr);//变量入栈 break; case procedure: error(21);//表达式内不能有过程标识符 break; } } getsym(); } else { if(sym == number) //因子为数字的时候 { if(num > AMAX) { error(31);//过界报错 num = 0; } gen(LIT, 0, num); getsym(); } else { if(sym == lparen)//因子为表达式的时候 { getsym(); memcpy(nxtlev, fsys, sizeof(bool)* symnum); nxtlev[rparen] = true; expression(nxtlev, ptx, lev); if(sym == rparen) { getsym(); } else { error(22);//没有右括号 } } //test(fsys, facbegsys, 23);//一个因子处理完毕,遇到的单词应在fsys集合中 ,如果不是,报错并找到下一个因子的开始,使语法分析继续运行 } } memset(nxtlev, 0, sizeof(bool) * symnum); nxtlev[lparen] = true; test(fsys, facbegsys, 23);//一个因子处理完毕,遇到的单词应在fsys集合中 ,如果不是,报错并找到下一个因子的开始,使语法分析继续运行 } } //条件分析处理 void condition(bool* fsys, int* ptx, int lev) { enum symbol sign; bool nxtlev[symnum]; if(sym == oddsym) { getsym(); expression(fsys, ptx, lev); gen(OPR, 0, 6); } else//处理分析逻辑表达式 { memcpy(nxtlev, fsys, sizeof(bool)* symnum); nxtlev[eql]=true; nxtlev[neq]=true; nxtlev[lss]=true; nxtlev[leq]=true; nxtlev[gtr]=true; nxtlev[geq]=true; expression(nxtlev, ptx, lev); if((sym!=eql)&&(sym!=neq)&&(sym!=lss)&&(sym!=leq)&&(sym!=gtr)&&(sym!=geq)) { error(20);//应为关系运算符 } else { sign = sym; getsym(); expression(fsys, ptx, lev); switch(sign) { case eql: gen(OPR, 0, 7); break; case neq: gen(OPR, 0, 8); break; case lss: gen(OPR, 0, 9); break; case gtr: gen(OPR, 0, 10); break; case leq: gen(OPR, 0, 11); break; case geq: gen(OPR, 0, 12); break; } } } } //P-code解释执行程序 void interpret() { int p = 0;//指令指针 int b = 1;//指令基址 int t = 0;//栈顶指针 struct instruction i;//存放当前指令 int s[stacksize];//栈 cout<<"执行PL0:"<<endl; fprintf(fr, "执行PL0:\n"); s[0] = 0; s[1] = 0; s[2] = 0; s[3] = 0; do{ i = code[p];//读当前指令 p++; switch(i.f) { case LIT://将a的值取到栈顶 t++; s[t]=i.a; break; case OPR://数字逻辑运算 switch(i.a) { case 0://函数调用后返回 t = b - 1; p = s[t+3]; b = s[t+2]; break; case 1://取反 s[t] = -s[t]; break; case 2://栈顶两个元素相加 t--; s[t] = s[t] + s[t+1]; break; case 3://栈顶两个元素相减 t--; s[t] = s[t] - s[t+1]; break; case 4://栈顶两个元素相乘 t--; s[t] = s[t] * s[t+1]; break; case 5://栈顶两个元素相除 t--; s[t] = s[t] / s[t+1]; break; case 6://栈顶元素奇偶判断 s[t] = s[t] % 2; break; case 7://栈顶两个元素是否相等 t--; s[t] = (s[t] == s[t+1]); break; case 8://栈顶两个元素是否不等 t--; s[t] = (s[t] != s[t+1]); break; case 9://小于 t--; s[t] = (s[t] < s[t+1]); break; case 10://大于 t--; s[t] = (s[t] > s[t+1]); break; case 11://小于等于 t--; s[t] = (s[t] <= s[t+1]); break; case 12://大于等于 t--; s[t] = (s[t] >= s[t+1]); break; case 13://输出栈顶值 printf("%d", s[t]); fprintf(fr, "%d", s[t]); t--; break; case 14://输出换行符 printf("\n"); fprintf(fr, "\n"); break; case 15://读入 t++; printf("输入:"); fprintf(fr, "输入:"); scanf("%d", &(s[t])); fprintf(fr, "%d\n", s[t]); break; } break; case LOD://取相对当前过程的数据基地址为a的内存的值到栈顶 t++; s[t] = s[base(i.l, s, b) + i.a]; break; case STO://栈顶的值存到相对当前过程的数据基地址为a的内存 s[base(i.l, s, b) + i.a] = s[t]; t--; break; case CAL://调用子程序 s[t+1] = base(i.l, s,b); s[t+2] = b; s[t+3] = p; b = t + 1; p = i.a; break; case INT://分配内存 t += i.a; break; case JMP://直接跳转 p=i.a; break; case JPC://条件跳转 if(s[t] == 0) { p = i.a; } t--; break; } }while(p != 0); printf("PL0结束\n"); fprintf(fr, "PL0结束\n"); } //通过静态链求出数据区基地址 int base(int l,int* s, int b) { int b1; b1 = b; while(l > 0) { b1 = s[b1]; l--; } return b1; } int main() { bool nxtlev[symnum]; cout<<"*****PL0编译器*****"<<endl; cout<<"输出文件中,fv为虚拟机代码,fo为源代码,fr为运行结果,ft为符号表"<<endl; cout<<"请输入pl0文件:"<<endl; scanf("%s", fname); fin = fopen(fname, "r"); if(fin == NULL) { cout<<"无法打开文件!" <<endl; exit(1); } if(fgetc(fin) == EOF) { cout<<"文件为空!" <<endl; exit(1); } rewind(fin); fo = fopen("fo.txt", "w"); init(); err = 0; cc = ll = cx = 0; ch=' '; getsym(); fv = fopen("fv.txt", "w"); ft = fopen("ft.txt", "w"); addset(nxtlev, declbegsys, statbegsys, symnum); nxtlev[period]=true; block(0, 0, nxtlev);//调用编译程序 fclose(fv); fclose(fo); fclose(ft); fclose(fin); printf("\n"); if(sym != period) { error(9);//应为句号 } if(err == 0) { cout<<"*****************************"<<endl; fr = fopen("fr.txt", "w"); interpret(); fclose(fr); } else { printf("程序出错!"); } fclose(fin); printf("\n"); getchar(); }
在中国程序员是青春饭吗?
今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...
【JSON解析】浅谈JSONObject的使用
简介 在程序开发过程中,在参数传递,函数返回值等方面,越来越多的使用JSON。JSON(JavaScript Object Notation)是一种轻量级的数据交换格式,同时也易于机器解析和生成、易于理解、阅读和撰写,而且Json采用完全独立于语言的文本格式,这使得Json成为理想的数据交换语言。 JSON建构于两种结构: “名称/值”对的集合(A Collection of name/va...
《MySQL 性能优化》之理解 MySQL 体系结构
本文介绍 MySQL 的体系结构,包括物理结构、逻辑结构以及插件式存储引擎。
程序员请照顾好自己,周末病魔差点一套带走我。
程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。
一名大专同学的四个问题
【前言】   收到一封来信,赶上各种事情拖了几日,利用今天要放下工作的时机,做个回复。   2020年到了,就以这一封信,作为开年标志吧。 【正文】   您好,我是一名现在有很多困惑的大二学生。有一些问题想要向您请教。   先说一下我的基本情况,高考失利,不想复读,来到广州一所大专读计算机应用技术专业。学校是偏艺术类的,计算机专业没有实验室更不用说工作室了。而且学校的学风也不好。但我很想在计算机领...
复习一周,京东+百度一面,不小心都拿了Offer
京东和百度一面都问了啥,面试官百般刁难,可惜我全会。
Java 14 都快来了,为什么还有这么多人固守Java 8?
从Java 9开始,Java版本的发布就让人眼花缭乱了。每隔6个月,都会冒出一个新版本出来,Java 10 , Java 11, Java 12, Java 13, 到2020年3月份,...
达摩院十大科技趋势发布:2020 非同小可!
【CSDN编者按】1月2日,阿里巴巴发布《达摩院2020十大科技趋势》,十大科技趋势分别是:人工智能从感知智能向认知智能演进;计算存储一体化突破AI算力瓶颈;工业互联网的超融合;机器间大规模协作成为可能;模块化降低芯片设计门槛;规模化生产级区块链应用将走入大众;量子计算进入攻坚期;新材料推动半导体器件革新;保护数据隐私的AI技术将加速落地;云成为IT技术创新的中心 。 新的画卷,正在徐徐展开。...
轻松搭建基于 SpringBoot + Vue 的 Web 商城应用
首先介绍下在本文出现的几个比较重要的概念: 函数计算(Function Compute): 函数计算是一个事件驱动的服务,通过函数计算,用户无需管理服务器等运行情况,只需编写代码并上传。函数计算准备计算资源,并以弹性伸缩的方式运行用户代码,而用户只需根据实际代码运行所消耗的资源进行付费。Fun: Fun 是一个用于支持 Serverless 应用部署的工具,能帮助您便捷地管理函数计算、API ...
讲真,这两个IDE插件,可以让你写出质量杠杠的代码
周末躺在床上看《拯救大兵瑞恩》 周末在闲逛的时候,发现了两个优秀的 IDE 插件,据说可以提高代码的质量,我就安装了一下,试了试以后发现,确实很不错,就推荐给大家。 01、Alibaba Java 代码规范插件 《阿里巴巴 Java 开发手册》,相信大家都不会感到陌生,其 IDEA 插件的下载次数据说达到了 80 万次,我今天又贡献了一次。嘿嘿。 该项目的插件地址: https://github....
Python+OpenCV实时图像处理
目录 1、导入库文件 2、设计GUI 3、调用摄像头 4、实时图像处理 4.1、阈值二值化 4.2、边缘检测 4.3、轮廓检测 4.4、高斯滤波 4.5、色彩转换 4.6、调节对比度 5、退出系统 初学OpenCV图像处理的小伙伴肯定对什么高斯函数、滤波处理、阈值二值化等特性非常头疼,这里给各位分享一个小项目,可通过摄像头实时动态查看各类图像处理的特点,也可对各位调参、测试...
2020年一线城市程序员工资大调查
人才需求 一线城市共发布岗位38115个,招聘120827人。 其中 beijing 22805 guangzhou 25081 shanghai 39614 shenzhen 33327 工资分布 2020年中国一线城市程序员的平均工资为16285元,工资中位数为14583元,其中95%的人的工资位于5000到20000元之间。 和往年数据比较: yea...
为什么猝死的都是程序员,基本上不见产品经理猝死呢?
相信大家时不时听到程序员猝死的消息,但是基本上听不到产品经理猝死的消息,这是为什么呢? 我们先百度搜一下:程序员猝死,出现将近700多万条搜索结果: 搜索一下:产品经理猝死,只有400万条的搜索结果,从搜索结果数量上来看,程序员猝死的搜索结果就比产品经理猝死的搜索结果高了一倍,而且从下图可以看到,首页里面的五条搜索结果,其实只有两条才是符合条件。 所以程序员猝死的概率真的比产品经理大,并不是错...
害怕面试被问HashMap?这一篇就搞定了!
声明:本文以jdk1.8为主! 搞定HashMap 作为一个Java从业者,面试的时候肯定会被问到过HashMap,因为对于HashMap来说,可以说是Java集合中的精髓了,如果你觉得自己对它掌握的还不够好,我想今天这篇文章会非常适合你,至少,看了今天这篇文章,以后不怕面试被问HashMap了 其实在我学习HashMap的过程中,我个人觉得HashMap还是挺复杂的,如果真的想把它搞得明明白...
毕业5年,我问遍了身边的大佬,总结了他们的学习方法
我问了身边10个大佬,总结了他们的学习方法,原来成功都是有迹可循的。
python爬取百部电影数据,我分析出了一个残酷的真相
2019年就这么匆匆过去了,就在前几天国家电影局发布了2019年中国电影市场数据,数据显示去年总票房为642.66亿元,同比增长5.4%;国产电影总票房411.75亿元,同比增长8.65%,市场占比 64.07%;城市院线观影人次17.27亿,同比增长0.64%。 看上去似乎是一片大好对不对?不过作为一名严谨求实的数据分析师,我从官方数据中看出了一点端倪:国产票房增幅都已经高达8.65%了,为什...
推荐10个堪称神器的学习网站
每天都会收到很多读者的私信,问我:“二哥,有什么推荐的学习网站吗?最近很浮躁,手头的一些网站都看烦了,想看看二哥这里有什么新鲜货。” 今天一早做了个恶梦,梦到被老板辞退了。虽然说在我们公司,只有我辞退老板的份,没有老板辞退我这一说,但是还是被吓得 4 点多都起来了。(主要是因为我掌握着公司所有的核心源码,哈哈哈) 既然 4 点多起来,就得好好利用起来。于是我就挑选了 10 个堪称神器的学习网站,推...
这些软件太强了,Windows必装!尤其程序员!
Windows可谓是大多数人的生产力工具,集娱乐办公于一体,虽然在程序员这个群体中都说苹果是信仰,但是大部分不都是从Windows过来的,而且现在依然有很多的程序员用Windows。 所以,今天我就把我私藏的Windows必装的软件分享给大家,如果有一个你没有用过甚至没有听过,那你就赚了????,这可都是提升你幸福感的高效率生产力工具哦! 走起!???? NO、1 ScreenToGif 屏幕,摄像头和白板...
阿里面试,面试官没想到一个ArrayList,我都能跟他扯半小时
我是真的没想到,面试官会这样问我ArrayList。
曾经优秀的人,怎么就突然不优秀了。
职场上有很多辛酸事,很多合伙人出局的故事,很多技术骨干被裁员的故事。说来模板都类似,曾经是名校毕业,曾经是优秀员工,曾经被领导表扬,曾经业绩突出,然而突然有一天,因为种种原因,被裁员了,...
大学四年因为知道了这32个网站,我成了别人眼中的大神!
依稀记得,毕业那天,我们导员发给我毕业证的时候对我说“你可是咱们系的风云人物啊”,哎呀,别提当时多开心啦????,嗯,我们导员是所有导员中最帅的一个,真的???? 不过,导员说的是实话,很多人都叫我大神的,为啥,因为我知道这32个网站啊,你说强不强????,这次是绝对的干货,看好啦,走起来! PS:每个网站都是学计算机混互联网必须知道的,真的牛杯,我就不过多介绍了,大家自行探索,觉得没用的,尽管留言吐槽吧???? 社...
良心推荐,我珍藏的一些Chrome插件
上次搬家的时候,发了一个朋友圈,附带的照片中不小心暴露了自己的 Chrome 浏览器插件之多,于是就有小伙伴评论说分享一下我觉得还不错的浏览器插件。 我下面就把我日常工作和学习中经常用到的一些 Chrome 浏览器插件分享给大家,随便一个都能提高你的“生活品质”和工作效率。 Markdown Here Markdown Here 可以让你更愉快的写邮件,由于支持 Markdown 直接转电子邮...
看完这篇HTTP,跟面试官扯皮就没问题了
我是一名程序员,我的主要编程语言是 Java,我更是一名 Web 开发人员,所以我必须要了解 HTTP,所以本篇文章就来带你从 HTTP 入门到进阶,看完让你有一种恍然大悟、醍醐灌顶的感觉。 最初在有网络之前,我们的电脑都是单机的,单机系统是孤立的,我还记得 05 年前那会儿家里有个电脑,想打电脑游戏还得两个人在一个电脑上玩儿,及其不方便。我就想为什么家里人不让上网,我的同学 xxx 家里有网,每...
史上最全的IDEA快捷键总结
现在Idea成了主流开发工具,这篇博客对其使用的快捷键做了总结,希望对大家的开发工作有所帮助。
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
谁是华为扫地僧?
是的,华为也有扫地僧!2020年2月11-12日,“养在深闺人不知”的华为2012实验室扫地僧们,将在华为开发者大会2020(Cloud)上,和大家见面。到时,你可以和扫地僧们,吃一个洋...
AI 没让人类失业,搞 AI 的人先失业了
最近和几个 AI 领域的大佬闲聊 根据他们讲的消息和段子 改编出下面这个故事 如有雷同 都是巧合 1. 老王创业失败,被限制高消费 “这里写我跑路的消息实在太夸张了。” 王葱葱哼笑一下,把消息分享给群里。 阿杰也看了消息,笑了笑。在座几位也都笑了。 王葱葱是个有名的人物,21岁那年以全额奖学金进入 KMU 攻读人工智能博士,累计发表论文 40 余篇,个人技术博客更是成为深度学习领域内风向标。 ...
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆每天早上8:30推送 作者|Mr.K 编辑| Emma 来源|技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯...
作为一名大学生,如何在B站上快乐的学习?
B站是个宝,谁用谁知道???? 作为一名大学生,你必须掌握的一项能力就是自学能力,很多看起来很牛X的人,你可以了解下,人家私底下一定是花大量的时间自学的,你可能会说,我也想学习啊,可是嘞,该学习啥嘞,不怕告诉你,互联网时代,最不缺的就是学习资源,最宝贵的是啥? 你可能会说是时间,不,不是时间,而是你的注意力,懂了吧! 那么,你说学习资源多,我咋不知道,那今天我就告诉你一个你必须知道的学习的地方,人称...
那些年,我们信了课本里的那些鬼话
教材永远都是有错误的,从小学到大学,我们不断的学习了很多错误知识。 斑羚飞渡 在我们学习的很多小学课文里,有很多是错误文章,或者说是假课文。像《斑羚飞渡》: 随着镰刀头羊的那声吼叫,整个斑羚群迅速分成两拨,老年斑羚为一拨,年轻斑羚为一拨。 就在这时,我看见,从那拨老斑羚里走出一只公斑羚来。公斑羚朝那拨年轻斑羚示意性地咩了一声,一只半大的斑羚应声走了出来。一老一少走到伤心崖,后退了几步,突...
一个程序在计算机中是如何运行的?超级干货!!!
强烈声明:本文很干,请自备茶水!???? 开门见山,咱不说废话! 你有没有想过,你写的程序,是如何在计算机中运行的吗?比如我们搞Java的,肯定写过这段代码 public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } ...
立即提问