编译器会出现哪些错误提示
VC6.0是使用spawn来调用cl编译器来进行编译,并且把cl的输出截获,在VC的界面中显示。这个spawn工具就是目录C:\Program Files\Microsoft Visual Studio\COMMON\MSDev98\Bin下的VCSPAWN.EXE程序。error spawing的意思就是启动vcspawn.exe时出现错误。你可以从别的地方拷贝一个vcspawn.exe覆盖试一下。
不行的话是不是没有关闭文件**.exe,导致无法写入?
㈡ C语言 编程后,有错误,怎么查看是那部分出错了!
【编写完代码后直接编译,如果有错误,编译器会自动弹出提示的】
例子如下:
(2)编译器会出现哪些错误提示扩展阅读:
C语言是一种计算机程序设计语言。它既有高级语言的特点,又具有汇编语言的特点。它可以作为系统设计语言,编写工作系统应用程序,也可以作为应用程序设计语言,编写不依赖计算机硬件的应用程序。
C语言适用范围大。适合于多种操作系统,如Windows、DOS、UNIX、LINUX等等;也适用于多种机型。C语言对编写需要硬件进行操作的场合,明显优于其它高级语言,有一些大型应用软件也是用C语言编写的。
㈢ 下面哪几项在编译时候,会出现错误提示( )
偷偷的测试了一下 呵呵
A 和D 错误 parseInt() 参数只接受 String
C选项 int()没有这种用法。
B选择 编译通过 执行通过 得到汉字 “我”的字符内码 25105
答案 ACD
㈣ 关于C语言在编译时常出现的错误有哪些
1、fatal error C1010: unexpected end of file while looking for precompiled header directive。
寻找预编译头文件路径时遇到了不该遇到的文件尾。(一般是没有#include "stdafx.h")
2、fatal error C1083: Cannot open include file: 'R…….h': No such file or directory
不能打开包含文件“R…….h”:没有这样的文件或目录。
3、error C2011: 'C……': 'class' type redefinition
类“C……”重定义。
4、error C2018: unknown character '0xa3'
不认识的字符'0xa3'。(一般是汉字或中文标点符号)
5、error C2057: expected constant expression
希望是常量表达式。(一般出现在switch语句的case分支中)
6、error C2065: 'IDD_MYDIALOG' : undeclared identifier
“IDD_MYDIALOG”:未声明过的标识符。
7、error C2082: redefinition of formal parameter 'bReset'
函数参数“bReset”在函数体中重定义。
8、error C2143: syntax error: missing ':' before '{'
句法错误:“{”前缺少“;”。
9、error C2146: syntax error : missing ';' before identifier 'dc'
句法错误:在“dc”前丢了“;”。
10、error C2196: case value '69' already used
值69已经用过。(一般出现在switch语句的case分支中)
11、error C2509: 'OnTimer' : member function not declared in 'CHelloView'
成员函数“OnTimer”没有在“CHelloView”中声明。
12、error C2511: 'reset': overloaded member function 'void (int)' not found in 'B'
重载的函数“void reset(int)”在类“B”中找不到。
13、error C2555: 'B::f1': overriding virtual function differs from 'A::f1' only by return type or calling convention
类B对类A中同名函数f1的重载仅根据返回值或调用约定上的区别。
14、error C2660: 'SetTimer' : function does not take 2 parameters
“SetTimer”函数不传递2个参数。
15、warning C4035: 'f……': no return value
“f……”的return语句没有返回值。
16、warning C4553: '= =' : operator has no effect; did you intend '='?
没有效果的运算符“= =”;是否改为“=”?
17、warning C4700: local variable 'bReset' used without having been initialized
局部变量“bReset”没有初始化就使用。
18、error C4716: 'CMyApp::InitInstance' : must return a value
“CMyApp::InitInstance”函数必须返回一个值。
19、LINK : fatal error LNK1168: cannot open Debug/P1.exe for writing
连接错误:不能打开P1.exe文件,以改写内容。(一般是P1.Exe还在运行,未关闭)
20、error LNK2001: unresolved external symbol "public: virtual _ _thiscall C……::~C……(void)"
连接时发现没有实现的外部符号(变量、函数等)。
function call missing argument list 调用函数的时候没有给参数。
member function definition looks like a ctor, but name does not match enclosing class 成员函数声明了但没有使用
unexpected end of file while looking for precompiled header directive 在寻找预编译头文件时文件意外结束,编译不正常终止可能造成这种情况
㈤ java编译器怎样提示丢失大括号的错误
一般都会在Class最后的括号下面出现红线
少个括号
Syntax error insert "}" to complete Classbody(语法错误,插入"}"去完成class)
多个括号
Syntax error on token "}",delete this token (在"}"这个标记上语法错误,删除这个标记)
㈥ C++编译出现“无法解析的外部命令”错误提示!
#include<iostream>
using namespace std;
template <class T>
class Seqlist
{
private:
T*element;
int size;
int len;
public:
Seqlist(int size=64);
Seqlist(T value[],int n);
~Seqlist();
bool isEmpty();
int length();
T get(int i);
bool set(int i,T x);
template <class Type>
friend ostream& operator<<(ostream& out,Seqlist<Type>& list);
void insert(int i,T x);
void insert(T x); //表后插入
bool remove(int i,T& old); //删除第i个元素存入old中
void clear();
};
template<class T>
Seqlist<T>::Seqlist(int size)
{
this->size=size<64?64:size;
this->element=new T[this->size];
this->len=0;
}
template<class T>
Seqlist<T>::Seqlist(T value[],int n)
{
if(n>0)
{
this->element=new T[2*n]; //Ensure to have enough room to insert
this->size=2*n;
for(int i=0;i<n;i++)
this->element[i]=value[i];
this->len=n;
}
}
template<class T>
Seqlist<T>::~Seqlist()
{
delete[]this->element;
}
template<class T>
bool Seqlist<T>::isEmpty()
{
return len==0;
}
template<class T>
int Seqlist<T>::length()
{
return len;
}
template<class T>
T Seqlist<T>::get(int i)
{
if(i>=0&&i<len)
return element[i];
throw"参数i指定元素无效";
}
template<class T>
bool Seqlist<T>::set(int i,T x)
{
if(i>=0&&i<len)
{
element[i]=x;
return true;
}
return false;
}
template <class T>
ostream& operator<<(ostream& out,Seqlist<T> &list)
{
out<<list.element;
return out;
}
template<class T>
void Seqlist<T>::insert(int i,T x)
{
if(len==size)
{
T*temp=element;
element=new T[size*2];
for(int i=0;i<size;i++)
element[i]=temp[i];
size*=2;
}
if(i<0)
i=0;
if(i>len)
i=len;
for(int j=len-1;j>=i;j--)
element[i+1]=element[i];
element[i]=x;
len++;
}
template<class T>
void Seqlist<T>::insert(T x)
{
insert(len,x);
}
template<class T>
bool Seqlist<T>::remove(int i,T&old)
{
if(len>0&&i>=0&&i<len)
{
old=element[i];
for(int j=i;j<len;j++)
element[i]=element[j+1];
len--;
return true;
}
return false;
}
template<class T>
void Seqlist<T>::clear()
{
len==0;
}
int main()
{
char a[]="abcde";
Seqlist<char> a1(a,6);
cout<<a1;
return 0;
}
改成这样就没问题了,主要有2个问题。
1.定义一般模板友元关系时 应该如下定义
template <class Type>//这里是重点 这句话一定要加 并且与外面的template <class T>不一致
//这是上面提示错误的主要原因
friend ostream& operator<<(ostream& out,Seqlist<Type>& list);
2.这个函数你并没有给出具体定义 我按着大概思路写了一个 具体你自己改
template <class T>
ostream& operator<<(ostream& out,Seqlist<T> &list)
{
out<<list.element;
return out;
}
你的程序还有很多小的问题,根据编译器提示一点一点改就行了。
希望帮到了你!
㈦ C++中逻辑错误、语法错误、编译错误分别出现什么情况
语法错误 就会导致 编译错误
编译错误和连接错误不能生成可执行程序
逻辑错误 没办法检查,只能影响结果
㈧ c语言编译总是提示 1 error
首先你格式错了,一般都是这样
#include<stdio.h>
void
main()
{
主程序
}
注意引号那些要在英文模式下输,象一楼的程序就是对的,
其次这个问题很多情况下是由于路径设置的问题引起的,“CL.exe”是VC使用真正的编译器(编译程序),其路径在“VC根目录\VC98\Bin”下面,你可以到相应的路径下找到这个应用程序。
因此问题可以按照以下方法解决:点击VC“TOOLS(工具)”—>“Option(选择)”—>“Directories(目录)”重新设置“Excutable
Fils、Include
Files、Library
Files、Source
Files”的路径。很多情况可能就一个盘符的不同(例如你的VC装在C,但是这些路径全部在D),改过来就OK了。
㈨ c++课程设计一般都会出现哪些错误,错误提示都是什么
编译器的部分工作是寻找程序代码中的错误。编译器不能查出程序的意义是否正确, 但它可以查出程序形式上的错误。下面是编译器能查出的最普遍的一些错误。语法错误。程序员犯了 C++ 语言中的语法错误。下面代码段说明常见的语法错误;每个注释描述下一行的错误。// error: missing ')' in parameter list for main int main ( { // error: used colon, not a semicolon after endl std::cout << "Read each file." << std::endl: // error: missing quotes around string literal std::cout << Update master. << std::endl; // ok: no errors on this line std::cout << "Write new master." <<std::endl; // error: missing ';' on return statement return 0 }
类型错误。C++ 中每个数据项都有其相关联的类型。例如,值 10 是一个整数。用双引号标注起来的单词“hello”是字符串字面值。类型错误的一个实例是传递了字符串字面值给应该得到整型参数的函数。声明错误。C++ 程序中使用的每个名字必须在使用之前声明。没有声明名字通常会导致错误信息。最常见的两种声明错误,是从标准库中访问名字时忘记使用“std::”,以及由于疏忽而拼错标识符名:#include <iostream> int main() { int v1, v2; std::cin >> v >> v2; // error: uses " v "not" v1" // cout not defined, should be std::cout cout << v1 + v2 << std::endl; return 0; } 错误信息包含行号和编译器对我们所犯错误的简要描述。按错误报告的顺序改正错误是个好习惯,通常一个错误可能会产生一连串的影响,并导致编译器报告比实际多得多的错误。最好在每次修改后或最多改正了一些显而易见的错误后,就重新编译代码。这个循环就是众所周知的编辑—编译—调试。
㈩ 在C++中,代码不符合语法规则,编程时有错误提示吗
编程时指的是代码编写阶段,这个时候编译器是不会有错误提示的,有错无提示的是编辑器,例如一些高级的编辑器,vscode、nodepad++ 等等,现在一般有错误提示的编辑器都叫IDE了也就是集成开发环境,它们可以帮助编译器提前过滤一些语法错误。