当前位置:文档之家› CCS编译错误和警告信息

CCS编译错误和警告信息

CCS编译错误和警告信息
CCS编译错误和警告信息

C28x编译器错误和警告消息

From Texas Instruments Wiki从德州仪器维基

Jump to:跳转到:navigation导航,search搜索

Translate this page to TranslateShow original

C28x Compiler Error and Warning MessagesC28x编译器错误和警告消息Contents内容

[hide]

?11Introduction介绍

?22Possible Errors,Warnings and Remarks可能的错误、警告和言论?33Common Errors and Warnings常见的错误和警告

o 3.13.1Warning:build attribute vendor section TI missing in ":compatibility cannot be determined

警告:构建属性供应商部分TI失踪”<图书馆或对象>:兼容性不能

确定

o 3.23.2fatal error:file.....rts2800_fpu32.lib"specifies ISA

revision"C28FPU32",which is not compatible with ISA

revision"C2800"specified in a previous file or on the

command lineobj>“指定ISA修订“C28FPU32”,这不是兼容ISA

修订“C2800”之前的文件中指定或在命令行上

o 3.33.3Warning:entry-point symbol other than"_c_int00"

specified:"code_start"警告:入口点符号除了“_c_int00”规

定:“code_start”

o 3.43.4Error:unresolved symbols remain....错误:未解决符号保持....

o 3.53.5Error:Tag_ISA attribute value of"2"that is different than one previously seen("1");combining

incompatible files错误:Tag_ISA属性值的“2”是不同于一个以

前见过(“1”);结合不兼容的文件

o 3.63.6Error:Tag_Memory_Model attribute value of"1"that is different than one previously seen("2");combining

incompatible files错误:Tag_Memory_Model属性值“1”,是不同

于一个以前见过(“2”);结合不兼容的文件

o 3.73.7Error:placement fails for object"csmpasswds"错误:放置失败对象“csmpasswds”

o 3.83.8Warning:function declared implicitly警告:数的隐式声明

o 3.93.9Error:placement fails for object错误:放置失败的对象

o 3.103.10Error:placement fails for object".text错误:对象放置失败”text。设置

o 3.113.11extern cregister volatile unsigned int IFR;

"../include/DSP2802x_Device.走读生cregister波动unsigned

int仪表;“../include/DSP2802x_Device。h",line51:

error:omission of explicit type is nonstandard("int"

assumed)h”,51行:错误:遗漏显式类型的非标准(“int”假设) o 3.123.12typedef interrupt void(*PINT)(void);

"..\include\DSP2802x_PieVect.typedef中断无效(*品脱)(空

白);“..\\DSP2802x_PieVect包括。h",line26:error:

omission of explicit type is nonstandard("int"assumed)h”

第26行:错误:遗漏显式类型的非标准(“int”假设) Introduction介绍

Often it is helpful to know what errors and warnings can be generated as well as the source of common errors.通常它有助于知道错误和警告可以生成以及常见错误的来源。This article includes a list of the error,warning and remark messages generated as well as a list of common errors and their resolution.本文包含的错误、警告和备注信息生成以及常见错误的列表和他们的决议。

Possible Errors,Warnings and Remarks可能的错误、警告和言论

The following file lists the error/warning/remark messages generated by the Texas Instruments C/C++parser.以下文件列出了错误/警告/备注信息由德州仪器C/c++生成解析器。The purpose of this list to provide some indication as to which error/warning id#corresponds to which

error/warning message.这个列表的目的提供一些指示哪个错误/警告id号对应哪个错误/警告信息。

C28x Compiler Error List:C28x编译器错误列表:

TICompiler_C28_ErrorList.pdfTICompiler_C28_ErrorList.pdf

Common Errors and Warnings常见的错误和警告

Warning:build attribute vendor section TI missing in":compatibility cannot be determined警告:构建属性供应商部分TI失踪”<图书馆或对象>:兼容性不能确定

The library was built with an older tool set than the application it is being linked into.与一个较年长的工具集图书馆建于不是被链

接到应用程序。Older tools did not define this attribution.旧的

工具没有定义这个属性。Build attributes have existed for quite

sometime so this warning is the exception.构建属性已经存在了很

长时间内所以这个警告是例外。Previously the tools interpreted files with no build attributes as having0values,but this is incorrect.

以前没有构建的工具解释文件属性为0值,但这是不正确的。They are now treated as compatible with everything,but warn the user that they are on their ow n.他们现在视为兼容一切,但警告用户,他们在他们自己

的。

Examples:例子:

?The IQmath Library which is built with an older compiler but is compatible with current compilers.IQmath库构建一个老的

编译器,但当前编译器兼容。

?Flash API which is built with older compilers due to

testing.Flash API构建与老的编译器测试。

?SFO library used for the HRPWM module.SFO库用于HRPWM模块。

NOTE:注意:To suppress the warning you can use the linker option --diag_suppress=16002which can be placed in the linker command

file抑制警告你可以使用链接器选项——diag_suppress=16002,可以

放置在链接器命令文件

fatal error:file.....rts2800_fpu32.lib

rts2800_fpu32.lib<引导。obj>"specifies ISA revision"C28FPU32",which is not compatible with ISA revision"C2800"specified in a previous file or on the command lineobj>“指定ISA修订“C28FPU32”,这不是兼容ISA 修订“C2800”之前的文件中指定或在命令行上

This is an attempt to link source compiled with

--float_support=FPU32with a non-FPU32object file.这是一个试图编译链接来源与——float_support=FPU32non-FPU32对象文件。In

this case the RTS library was built with--float_support=fpu32.在这种情况下,RTS——float_support=fpu32图书馆建成。This could,

instead,be another library or a project source file.相反,这可能成为另一个库或者一个项目源文件。

?Check each library and make sure each was built with the-v28 --float_support=FPU32switch.检查每个库和确保每个建于

-v28——float_support=FPU32开关。

?Make sure all.确保所有。c files are compiled using the-v28 --float_support=FPU32switch.c文件编译使用

-v28——float_support=FPU32开关。(In Code Composer Studio

you can set this as a global build option or a per-file build

option).(在代码作曲家工作室可以设置这个作为全球构建是选择

或构建选项)。

If the project is not for a device with the C28x+FPU unit,then the RTS library should be changed to the non FPU32version.如果项目不是C28x+FPU的设备单元,那么RTS图书馆应该改为非FPU32版本。See 看到C28x Code Generation Tips and Tricks Wiki ArticleC28x代码生成Wiki文章的技巧和窍门for information on the runtime support

library.信息在运行时支持库。

The two can not be linked because the calling conventions for float are different.这两个不能联系因为浮动的调用约定是不同的。If it is

a fixed-point device then“float”numbers are passed on the stack.

然后如果是定点装置“浮动”数字传递到栈上。If it is a28x+FPU

device,then“float”is passed in FPU registers.如果它是一个

28x+FPU设备,然后在FPU寄存器传递“浮动”。

Warning:entry-point symbol other than"_c_int00"specified:

"code_start"警告:入口点符号除了“_c_int00”规定:“code_start”

This warning is fine and can be ignored.很好,可以忽略这个警告。

It is just telling you that the entry point for the program is set to code_start instead of the default_c_int00which is what we need in these examples.它只是告诉你程序的入口点设置为code_start而不是默认的_c_int00哪些是我们需要在这些例子中。Other Peripheral

Examples provided by TI will also generate this warning.其它外围TI提供的示例会生成此警告。

Error:unresolved symbols remain....错误:未解决符号保持....

It means somewhere in the source the symbol has been used,but the linker is unable to find where it is created.这意味着在源符号被使用,但是链接器无法找到了。For example,if your code had the

statement c=IQdiv(a,b);but the IQmath library has not been

included in the project,the symbol IQdiv will be flagged as

undefined.例如,如果您的代码声明c=IQdiv(a,b);但是IQmath库没有被包含在这个项目,象征IQdiv将标记为未定义。

Symbols that include$$in them(for example:FD$$MPY or FD$$TOL) likely come from the runtime support library.他们的符号,包括$

$(例如:FD MPY或FD美元美元TOL)可能来自运行时支持库。See看到C28x Code Generation Tips and Tricks Wiki ArticleC28x代码生成Wiki文章的技巧和窍门for information on the runtime support library.信息在运行时支持库。

Error:Tag_ISA attribute value of"2"that is different than one previously seen("1");combining incompatible files错误:Tag_ISA属性值的“2”是不同于一个以前见过(“1”);结合不兼容的文件

The tools are complaining about mismatched values of"Tag_ISA", which means there are mismatched ISA versions.的工具都在抱怨的不匹配值“Tag_ISA”,这意味着有不匹配的ISA版本。"1"is C27x, and"2"is C28x,so this test case is mixing C27x and C28x object files.C27x“1”,“2”是C28x,所以这个测试用例是混合C27x C28x对象文件。A future release of codegen will use"C2700"and"C2800"

instead of"1"and"2"in the error message.codegen的未来版本将使用“C2700”和“C2800”而不是“1”和“2”的错误消息。

Make sure all files are compiled with-v28to avoid this error.

确保所有文件编译-v28为了避免这种错误。

Error:Tag_Memory_Model attribute value of"1"that is different than one previously seen("2");combining incompatible files错

误:Tag_Memory_Model属性值“1”,是不同于一个以前见过(“2”);结合不兼容的文件

Some files or libraries have been compiled using a small memory model and others with a large memory model.一些文件或库编译使用一个小的内存模型和其他大内存模型。The linker will not allow you to combine files linked with different memory models.链接器将不允许您将文件与不同的内存模型。

For C2000,large memory model(-ml compiler switch)is recommended and used in examples provided by TI.C2000,大内存模型(-ml编译器开关)推荐并使用电信提供的例子。

Error:placement fails for object"csmpasswds"错误:放置失败对象“csmpasswds”

This is an issue in an early version of the5.这是一个问题的一个早期版本5。x compiler/linker.x编译器和链接器。The linker is

complaining about a section with the same name on page0and page

1.链接器在抱怨一个具有相同名称的部分页面0和1。You can change

the name of one of these sections in the liker.你可以改变其中一

个部分的名称的爱好者。cmd file.cmd文件。The suggested fix,however, is to update the codegen tools.然而,建议修复更新codegen工具。

Warning:function declared implicitly警告:数的隐式声明

This is not a warning to ignore.这不是一个警告,不容忽视。It means

a function doesn't have a prototype and the compiler has made some

assumptions about the values you are passing/returning.这意味着

一个函数没有一个原型和编译器做了一些假设你传递/返回的值。That

can quickly lead to a bug.很快就会导致一个错误。Fix this warning!

解决这个警告!

Error:placement fails for object错误:放置失败的对象

This is a linker error that means the object will not fit into memory.

这是一个链接器错误这意味着对象将不适合到内存中。This can be due to

data page blocking.这可能是由数据页阻塞。Refer to指C28x

Compiler:Understanding Linking Wiki articleC28x编译器:了解连接

维基文章for more information.获得更多信息。

Error:placement fails for object".text错误:对象放置失败”text。设置

This is a linker error that means not enough memory was available

to allocate code.这是一个链接器错误意味着没有足够的内存可用来分

配代码。Refer to指C28x Compiler:Understanding Linking Wiki

articleC28x编译器:了解连接维基文章for more information.获得更多

信息。

extern cregister volatile unsigned int IFR;"../include/DSP2802x_Device.走读生cregister波动unsigned int仪表;“../include/DSP2802x_Device。h",line51:error:omission of explicit type is nonstandard("int" assumed)h”,51行:错误:遗漏显式类型的非标准(“int”假设)

MISRA rules require that you build in strict ANSI mode.MISRA规

则要求你建立严格ANSI模式。This means it is an error to use any

feature not specified in the ANSI standard.这意味着一个错误使用

ANSI标准中没有指定的任何功能。In your case,these features are the

keywords cregister and interrupt.在你的案例中,这些特性是关键词

cregister和中断。The net effect is you cannot use interrupt and

cregister and,at the same time,conform to MISRA.净效应是不能使

用中断和cregister,与此同时,符合MISRA。

The fix is to instead use alternate keyword,__cregister,or

__interrupt,or__asm(),if you are writing code for strict

ANSI/ISO mode(using the--strict_ansi compiler option).解决办法是用替代字,__cregister,或__interrupt或__asm(),如果您正在编写代码严格ANSI/ISO模式(使用——strict_ansi编译器选项)。

typedef interrupt void(*PINT)(void);

"..\include\DSP2802x_PieVect.typedef中断无效(*品脱)(空白);“..\\ DSP2802x_PieVect包括。h",line26:error:omission of explicit type is nonstandard("int"assumed)h”第26行:错误:遗漏显式类型的非标准(“int”假设)

MISRA rules require that you build in strict ANSI mode.MISRA规则要求你建立严格ANSI模式。This means it is an error to use any feature not specified in the ANSI standard.这意味着一个错误使用ANSI标准中没有指定的任何功能。In your case,these features are the keywords cregister and interrupt.在你的案例中,这些特性是关键词cregister和中断。The net effect is you cannot use interrupt and cregister and,at the same time,conform to MISRA.净效应是不能使用中断和cregister,与此同时,符合MISRA。

The fix is to instead use alternate keyword,__cregister,or

__interrupt,or__asm(),if you are writing code for strict

ANSI/ISO mode(using the--strict_ansi compiler option).解决办法是用替代字,__cregister,或__interrupt或__asm(),如果您正在编写代码严格ANSI/ISO模式(使用——strict_ansi编译器选项)。

KEIL常见编译错误大全

KEIL常见编译错误大全 【致命错误】 立即终止编译这些错误通常是命令行指定的无效选项的结果当编译器不 能访问一个特定的源包含文件时也产生致命错误 致命错误信息采用下面的格式 C51FATAL-ERROR– ACTION: LINE: ERROR: C51TERMIANTED. C51FATAL-ERROR– ACTION: FILE: ERROR: C51TERMIANTED. 下面说明Action和Error中可能的内容 Actions ALLOCATING MEMORY 编译器不能分配足够的存储区来编译指定的源文件. CREATING LIST-FILE/OBJECT-FILE/WORKFILE 编译器不能建立列表文件,OBJ文件,或工作文件这个错误的出现可能是磁盘满或写保护,或文件已存在和只读. GENERATING INTERMEDIATE CODE 源文件包含的一个函数太大,不能被编译器编译成虚拟代码.尝试把函数分小或重新编译. OPENING INPUT-FILE 编译器不能发现或打开所选的源或包含文件. PARSING INVOKE-/#PRAGMA-LINE 当在命令行检测到参数计算,或在一个#pragma中检测到参数计算,就产生这样的错误. PARSING SOURCE-FILE/ANALYZING DECLARATIONS 源文件包含太多的外部参考.减少源文件访问的外部变量和函数的数目. WRITING TO FILE

C语言编译中的常见错误

C语言编译中的常见错误 1、警告类错误 ?‘XXX’declare but never used变量XXX已定义但从未用过。 ?‘XXX’is assigned a value which is never used变量XXX已赋值但从未用过。?Code has no effect 程序中含有没有实际作用的代码。 ? Non-portable pointer conversion不适当的指针转换,可能是在应该使用指针的 地方用了一个非0的数值。 ?Possib le use of ‘XXX’before definition表达式中使用了未赋值的变量 ?Possibly incorrect assignment这样的赋值可能不正确 ?Redeclaration of ‘main’一个程序文件中主函数main不止一个。 ?Suspicious pointer conversion可疑的指针转换。通常是使用了基本类型不匹配的指针。 ?Unreachable code程序含有不能执行到的代码。 2、错误或致命错误 ?Compound statement missing } in function main程序结尾缺少括号}。 ?“}”expected;“(”expected等复合语句或数组初始化的结尾缺少“)”;“(”。 ? Case outside of switch case不属于Switch结构,多由于switch结构中的花括 号不配对所致。 ?Case statement missing ‘:’ switch结构中的某个case之后缺少冒号。 ? Constant expression required定义数组时指定的数组长度不是常量表达式。 ? Declaration syntax error 结构体或联合类型的定义后缺少分号。 ? Declaration was expected 缺少说明,通常是因为缺少分界符如逗号、分号、右圆 括号等所引起的。 ?Default outside switch Default部分放到了switch结构之外,一般是因为花括号 不匹配而引起的。 ?do statement must have while do语句中缺少相应的while部分。 ? Expression syntax 表达式语法错。如表达式中含有两个连续的运算符

c语言编译常见错误列表

1."c" not an argument in function sum 该标识符不是函数的参数 2.array bounds missing ] in function main 缺少数组界限符"]" 3.Array size too large in function main 数组规模太大 4.bad file name format in include directive 在包含指令中的文件名格式不正确. 5.Call of non-function in function main 调用未经过定义的函数. 6.cannot modify a const object in function main 对常量不能进行修改. 7.character constant too long in function main 字符常量太大 8.constant expression required in funtion main 数组定义的时候,数组大小要求是常数 https://www.doczj.com/doc/3c18955612.html,pound statment missing } in function main 复合语句漏掉符号"{" 10.declaration syntax error in function main 宣告语法错误 11.expression syntax in function main 表达式语法错误 12. extra parameter in call to sum in function 调用函数时使用了过多的参数 13.illegal use of floating point in function main 浮点数的不合法使用 14.illegal pionter subtraction in function main 不合法的指针相减 15.invalid pointer addition in function main 无效的指针相加 16.out of memory in function main 内存不足 17.statement missing ; in function main 语句后面漏掉分号. 警告报错

Fluent_UDF_第七章_UDF的编译与链接

第七章 UDF的编译与链接 编写好UDF件(详见第三章)后,接下来则准备编译(或链接)它。在7.2或7.3节中指导将用户编写好的UDF如何解释、编译成为共享目标库的UDF。 _ 第 7.1 节: 介绍 _ 第 7.2 节: 解释 UDF _ 第 7.3 节: 编译 UDF 7.1 介绍 解释的UDF和编译的UDF其源码产生途径及编译过程产生的结果代码是不同的。编译后的UDF由C语言系统的编译器编译成本地目标码。这一过程须在FLUENT运行前完成。在FLUENT运行时会执行存放于共享库里的目标码,这一过程称为“动态装载”。 另一方面,解释的UDF被编译成与体系结构无关的中间代码或伪码。这一代码调用时是在内部模拟器或解释器上运行。与体系结构无关的代码牺牲了程序性能,但其UDF可易于共享在不同的结构体系之间,即操作系统和FLUENT版本中。如果执行速度是所关心的,UDF文件可以不用修改直接在编译模式里运行。 为了区别这种不同,在FLUENT中解释UDF和编译UDF的控制面板其形式是不同的。解释UDF的控制面板里有个“Compile按钮”,当点击“Compile按钮”时会实时编译源码。编译UDF的控制面板里有个“Open按钮”,当点击“Open按钮” 时会“打开”或连接目标代码库运行FLUENT(此时在运行FLUENT之前需要编译好目标码)。 当FLUENT程序运行中链接一个已编译好的UDF库时,和该共享库相关的东西都被存放到case文件中。因此,只要读取case文件,这个库会自动地链接到FLUENT 处理过程。同样地,一个已经经过解释的UDF文件在运行时刻被编译,用户自定义的C函数的名称与内容将会被存放到用户的case文件中。只要读取这个case文件,这些函数会被自动编译。 注:已编译的UDF所用到的目标代码库必须适用于当前所使用的计算机体系结构、操作系统以及FLUENT软件的可执行版本。一旦用户的FLUENT升级、操作系统改变了或者运行在不同的类型的计算机,必须重新编译这些库。

常见C语言错误提示信息

Ambiguous operators need parentheses 不明确的运算需要用括号括起Ambiguous symbol ''xxx'' 不明确的符号 Argument list syntax error 参数表语法错误 Array bounds missing 丢失数组界限符 Array size toolarge 数组尺寸太大 Bad character in paramenters 参数中有不适当的字符 Bad file name format in include directive 包含命令中文件名格式不正确 Bad ifdef directive synatax 编译预处理ifdef有语法错 Bad undef directive syntax 编译预处理undef有语法错 Bit field too large 位字段太长 Call of non-function 调用未定义的函数 Call to function with no prototype 调用函数时没有函数的说明 Cannot modify a const object 不允许修改常量对象 Case outside of switch 漏掉了case 语句 Case syntax error Case 语法错误 Code has no effect 代码不可述不可能执行到Compound statement missing{ 分程序漏掉"{" Conflicting type modifiers 不明确的类型说明符 Constant expression required

要求常量表达式 Constant out of range in comparison 在比较中常量超出范围Conversion may lose significant digits 转换时会丢失意义的数字Conversion of near pointer not allowed 不允许转换近指针 Could not find file ''xxx'' 找不到XXX文件 Declaration missing ; 说明缺少";" Declaration syntax error 说明中出现语法错误 Default outside of switch Default 出现在switch语句之外Define directive needs an identifier 定义编译预处理需要标识符Division by zero 用零作除数 Do statement must have while Do-while语句中缺少while部分Enum syntax error 枚举类型语法错误 Enumeration constant syntax error 枚举常数语法错误 Error directive :xxx 错误的编译预处理命令 Error writing output file 写输出文件错误 Expression syntax error 表达式语法错误 Extra parameter in call 调用时出现多余错误 File name too long 文件名太长 Function call missing ) 函数调用缺少右括号

gcc 常见的编译警告与错误(按字母顺序排列)备课讲稿

g c c常见的编译警告与错误(按字母顺序排 列)

gcc 常见的编译警告与错误(按字母顺序排列) C语言初学者遇到的最大问题往往是看不懂编译错误,进而不知如何修改程序。有鉴于此,本附录罗列了用gcc编译程序时经常出现的编译警告与错误。需要提醒读者的是,出现警告(warning)并不影响目标程序的生成,但出现错误(error)则无法生成目标程序。 为便于读者查阅,下面列出了经常遇到的警告与错误,给出了中英文对照(英文按字典顺序排列),并对部分错误与警告做了必要的解释。 #%s expects \FILENAME\ or … #%s 需要 \FILENAME\ 或… #%s is a deprecated GCC extension #%s 是一个已过时的 GCC 扩展 #%s is a GCC extension #%s 是一个 GCC 扩展 #~ error: #~ 错误: #~ In file included from %s:%u #~ 在包含自 %s:%u 的文件中 #~ internal error: #~ 内部错误: #~ no newline at end of file #~ 文件未以空白行结束

#~ warning: #~ 警告: #elif after #else #elif 出现在 #else 后 #elif without #if #elif 没有匹配的 #if #else after #else #else 出现在 #else 后 #else without #if #else 没有匹配的 #if #endif without #if #endif 没有匹配的 #if #include nested too deeply #include 嵌套过深 #include_next in primary source file #include_next 出现在主源文件中 #pragma %s %s is already registered #pragma %s %s 已经被注册 #pragma %s is already registered #pragma %s 已经被注册 #pragma once in main file #pragma once 出现在主文件中

C语言调试常见错误及修改方法(附习题)

1.调试 C 程序时常见的错误类型分析 一般情况下,错误主要分为两大类:一、语法错误。对于这种错误,用编译器很容易解决。所以,改错题的第一步是先编译,解决这类语法错误。下面总结了二级C 语言上机改错题中常见的语法错误: (1) 丢失分号,或分号误写成逗号。 (2) 关键字拼写错误,如本来小写变成大写。 (3) 语句格式错误,例如for 语句中多写或者少写分号。 (4) 表达式声明错误,例如:少了() (5) 函数类型说明错误。与main ()函数中不一致。 (6) 函数形参类型声明错误。例如:少* 等。 (7) 运算符书写错误,例如:/ 写成了。二、逻辑错误,或者叫语义错误,这和实现程序功能紧密相关,一般不能用编译器发现。对于逻辑错误可以按这样的步骤进行查找。 (1) 先读试题,看清题目的功能要求。 (2) 通读程序,看懂程序中算法的实现方法。 (3) 细看程序,发现常见错误点。 2.改错题的改错方式总结,当然这些总结只能对大部分改错行有效 1、若错误行是函数首部,可分为以下几种情况: A、该行最后若有分号则删除,中间若有分号则改成逗号 B、形参类型不一致的问题,特别是指针类型,若后面用到某形参时有指针运算则该形参必为指针类型;若形参是二维数组或指向m 个元素的指针变量,则第二维的长度必须与main 中对应数组的第二维长度相同 C、函数类型不一致的问题,若函数中没有return语句则函数类型为void,若有return语句则函数的类型必须与return 后变量的类型一致。 2、若错误行是if 或while 语句,则首先看有没有用小括号将整个表达式括起,若没有则加上小括号。 3、若错误行中有if、while 、for 则要特别注意条件表达式的错误问题: A、指针变量的应用,若表达式中有指针变量且没有指针运算符,则加上指针运算符 B、若条件表达式中只有一个等于号,则改成两个等于号,若为其它比较运算符则一般是进行逆转或加一个等于号 C、f or 中要用分号分隔表达式,而不是用逗号 4、语法错误 A、语句缺少分号,若错误行中有语句没有用分号结束,则加上分号。 B、大小写不对,若错误行中有大写字母则一般都改成小写字母。 5、指针变量的运用,若错误行中有指针变量,并且该变量名前没有指针运算符则一般都是加上指针运算符 6、若错误行为return 语句,则首先看是否是缺少分号若是则加上分号即可;否则就是return 后的变量或表达式错误(此时可通过看题意,来分析该返回哪一变量或表达式)

IAR常见编译错误

【转】IAR常见编译错误—比较全 IAR常见编译错误,比较全面的: 前面的序号表示错误编号 0 Format chosen cannot support banking Format unable to support banking. 1 Corrupt file. Unexpected end of file in module module (file) encountered XLINK aborts immediately. Recompile or reassemble, or check the compatibility between XLINK and C compiler. 2 Too many errors encountered (>100) XLINK aborts immediately. 3 Corrupt file. Checksum failed in module module (file). Linker checksum is linkcheck, module checksum is modcheck XLINK aborts immediately. Recompile or reassemble. 4 Corrupt file. Zero length identifier encountered in module module (file) XLINK aborts immediately. Recompile or reassemble. 5 Address type for CPU incorrect. Error encountered in module module (file) XLINK aborts immediately. Check that you are using the right files and libraries. 6 Program module module redeclared in file file. Ignoring second module XLINK will not produce code unless the Always generate output (-B) option (forced dump) is used. 7 Corrupt file. Unexpected UBROF – format end of file encountered in module module (file) XLINK aborts immediately. Recompile or reassemble. 8 Corrupt file. Unknown or misplaced tag encountered in module module (file). Tag tag XLINK aborts immediately. Recompile or reassemble. 9 Corrupt file. Module module start unexpected in file file XLINK aborts immediately. Recompile or reassemble. 10 Corrupt file. Segment no. segno declared twice in module module (file) XLINK aborts immediately. Recompile or reassemble. 11 Corrupt file. External no. ext no declared twice in module module (file) XLINK aborts immediately. Recompile or reassemble. 12 Unable to open file file XLINK aborts immediately. If you are using the command line, check the

常见gcc 编译错误整理

常见gcc 编译错误整理(开始)1 1 error: expected expression before 'else' else之前无表达式。 2 error: lvalue required as left operand of assignment 左值问题。 3 error: invalid storage class for function 'XXXXXX' 在文件的某个地方,丢失了一个大括号‘}’。 常见gcc编译警告整理(开始) 1、warning: no newline at end of file 在文件最后一行加上回车键 解释:在《Rationale for the C99 standard》一文中,有C99的相关信息: A backslash immediately before a newline has long been used to continue string literals, as well as preprocessing command lines. In the interest of easing machine generation of C, and of transporting code to machines with restrictive physical line lengths, the C89 Committee generalized this mechanism to permit any token to be continued by interposing a backslash/newline sequence. c/c++代码的每一行后面有一个“结束符”,也就是newline。避免当被include的文件展开后,前一个文件的最后一行与后一个文件的第一行直接被连接成一行从而造成错误。 2、warning: comparison between pointer and integer 解释:integer与pointer比较

UDF 编译疑难问题

UDF 编译疑难问题 作者华南理工大学何奎2016 5月 随着用户求解的问题越来越复杂,使用fluent 软件难免使用编译型的UDF,编译型需要用户安装微软visual stadio C++ 开发软件,并做正确的环境变量配置。否则则会出现如nmake 不是内部命令的错误。除了编译环境的正确设置,还有一些细节上的疑难问题一并给出解决方法。目前这些问题都是网上搜索不到的,希望有缘人能在百度文库里找到这篇文献。 关于环境变量的设置,网络上已经有大量的实例,现介绍一种简单的环境变量配置方法: 在fluent 的安装目录下找到udf.bat, 修改以下内容: set MSVC_DEFAULT=%ProgramFiles(x86)%\Microsoft Visual Studio 14.0 if exist "%MSVC_DEFAULT%\VC\vcvarsall.bat" set MSVC=%MSVC_DEFAULT% if not "%MSVC%" == "" goto msvc_env110 这个文件中还有其他类似的语句,但是都是重复查找不同的编译环境。通过查找vcvarsall.bat,fluent才知道编译器位置。如果不是就要靠运行msvc_env110,那就要手动设置环境变量了。注意你安装了VS2015以后,在program(x86)中有Microsoft Visual Studio 14.0,Microsoft Visual Studio 12.0,Microsoft Visual Studio 11.0,其中只有一个是有效的,这个要仔细确认(一般只有一个文件夹是完整的安装,估计这样做是为了向下兼容性)。 修改完了这个路径以后就OK了。 环境变量配置完全以后,还会出现一些别的问题。如编译UDF时会利用math.h, 注意编译这个文件有可能会出现很多问题。如下: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\math.h(483): error C2059: 语法错误:“常量”C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\math.h(483): error C2143: 语法错误: 缺少“)”(在“/”的前面) C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\math.h(483): error C2143: 语法错误: 缺少“{”(在“/”的前面) C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\math.h(483): error C2059: 语法错误:“/” C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\math.h(483): error C2059: 语法错误:“)” 如果光按fluent提示的查找错误,是不可能完成错误查找的,打开math.h因为你会看见483行是这样 _Check_return_ _ACRTIMP double __cdeclcbrt(_In_ double _X);(求立方根函数) 这个语句本身是没有什么问题的。如果想修改这条语句完成math.h的编译,那就走入了死胡同。那 么换个版本的math.h呢? 于是换了个瑞典公司开发的版本Copyright 2003-2010 IAR Systems AB(瑞典著名软件开发商). 结果编译出现: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\math.h(19): fatal error C1083: 无法打开包括文件: “ycheck.h”: No such file or directory 如果你查找ycheck.h,想加入这个头文件来解决这个问题的话,你会发现在中文资料库里根本就查不到 这样的头文件。这可能是该公司内部开发的一个头文件。所以这条路又行不通。那么如果将这条预处理程 序忽略掉呢?结果就会出现以下的编译错误: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\math.h(99): error C2061: 语法错误: 标识符“__ATTRIBUTES” C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\math.h(99): error C2059:

VC6常见编译错误

目录 VC6.0编译常见错误 (1) 第一部分编译错误 (1) 1.error C2001: newline in constant (1) 2.error C2015: too many characters in constant (2) 3.error C2018: unknown character '0x##' (3) 4.error C2041: illegal digit '#' for base '8' (3) 5.error C2065: 'xxxx' : undeclared identifier (3) 6.error C2086: 'xxxx' : redefinition (5) 7.error C2374: 'xxxx' : redefinition; multiple initialization (5) 8.C2143: syntax error : missing ';' before (identifier) 'xxxx' (5) 9.error C2137: empty character constant (6) 10.error C2374: 'xxxx' : redefinition; multiple initialization (7) 第二部分链接错误 (7) 1.error LNK2001: unresolved external symbol _main (7) 2.error LNK2005: _main already defined in xxxx.obj (7) VC6.0编译常见错误 第一部分编译错误 1.error C2001: newline in constant 编号:C2001 直译:在常量中出现了换行。错误分析: (1)字符串常量、字符常量中是否有换行。

Keil C 编译器常见警告与错误信息

https://www.doczj.com/doc/3c18955612.html,/support/man/docs/c51/c51_c277.htm错误信息查询 Keil C 编译器常见警告与错误信息 error C132 :“****”not in formal parameter list 花了偶将近半个小时来查找错误,最终发现原来是在头文件里的一个函数声明时露了一个分号造成紧挨着在它下面声明的参数not in formal parameter list。 记在在这里,免得以后忘记了,同时也供大家分享。 下面是另外一些常见的错误提示: 1.第一种错误信息 ***WARNING L15: MULTIPLE CALL TO SEGMENT SEGMENT: ?PR?_WRITE_GMVLX1_REG?D_GMVLX1 CALLER1: ?PR?VSYNC_INTERRUPT?MAIN CALLER2: ?C_C51STARTUP ***WARNING L15: MULTIPLE CALL TO SEGMENT SEGMENT: ?PR?_SPI_SEND_WORD?D_SPI CALLER1: ?PR?VSYNC_INTERRUPT?MAIN CALLER2: ?C_C51STARTUP ***WARNING L15: MULTIPLE CALL TO SEGMENT SEGMENT: ?PR?SPI_RECEIVE_WORD?D_SPI CALLER1: ?PR?VSYNC_INTERRUPT?MAIN CALLER2: ?C_C51STARTUP - 该警告表示连接器发现有一个函数可能会被主函数和一个中断服务程序(或者调用中断服务程序的函数)同时调用,

Fluent无法编译UDF文件的常见解决方法

解决Fluent无法编译UDF文件的问题 方法1 对于Fluent加载UDF时出现"The UDF library you are trying to load(libudf)is not complied for parallel use on the current platform (win64)"错误,主要是没有正确设置本机VS安装路径,导致udf编译器无法成功编译c代码。解决方法: 1. 找到Fluent内的UDF.bat编译器。这里以我自己2019R2的64位学生版为例,在D:\Program Files\ANSYS Inc\ANSYS Student\v194\fluent\ntbin\win64下找到udf.bat用记事本打开 2. 将本机Visual Studio的安装路径写入。这里以我自己VS2015为例,将本机visual studio 2015的安装路径赋值给MSVC_DEFAULT,由于VS2015的版本代号是14.0,因此将"%ProgramFiles(x86)%\Microsoft Visual Studio 14.0"替换为"D:\Program Files (x86)\Microsoft Visual Studio 14.0",保存文件即可,如图1~2所示 更改前

更改后 方法2 对于某些低版本的VS,以上操作可能不足以解决问题,需要手动配置环境变量,具体方法如下: 1.找到Fluent安装路径下的setenv.exe,双击运行选择是,路径X:\Program Files\ANSYS Inc\v130\fluent\ntbin\win64\setenv.exe 2.右键“我的电脑”—属性—高级—环境变量,添加用户变量,以VS2013为例INCLUDE=D:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include; LIB=D:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\amd64;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib\x64;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib\kernel32.lib Path=D:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64;D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE;

编译时的常见错误

一、编译时的常见错误 1. 数据类型错误。此类错误是初学者编程时的常见现象, 下面是一些要引起注意的错误: (1) 所有变量和常量必须要加以说明。 (2) 变量只能赋给相同类型的数据。 (3) 对scanf()语句, 用户可能输入错误类型的数据项, 这将导致运行时出错, 并报出错信息。为避免这样的错误出现, 你就提示用户输入正确类型的数据。 (4) 在执行算术运算时要注意: a. 根据语法规则书写双精度数字。要写0.5, 而不是写.5; 要写1.0, 而不是1。尽管C语言会自动地把整型转换成双精度型, 但书写双精度型是个好习惯。让C语言为你做强行转换这是一种效率不高的程序设计风格。这有可能导致转换产生错误。 b. 不要用0除。这是一个灾难性的错误, 它会导致程序失败, 不管C 语言的什么版本, 都是如此, 执行除法运算要特别小心。 c. 确保所有的双精度数(包括那些程序输入用的双精度数) 是在实数范围之内。 d. 所有整数必须在整数允许的范围内。这适用于所有计算结果, 包括中间结果。 2. 将函数后面的";"忘掉。此时错误提示色棒将停在该语句下的一行, 并显示: Statement missing ; in function <函数名> 3. 给宏指令如#include, #define等语句尾加了";"号。 4. "{"和"}"、"("和")"、"/*"和"*/"不匹配。引时色棒将位于错误所在的行, 并提示出有关丢掉括号的信息。 5. 没有用#include指令说明头文件, 错误信息提示有关该函数所使用的参数未定义。 6. 使用了Turbo C保留关键字作为标识符, 此时将提示定义了太多数据类型。 7. 将定义变量语句放在了执行语句后面。此时会提示语法错误。 8. 使用了未定义的变量, 此时屏幕显示: Undefined symbol '<变量名>' in function <函数名> 9. 警告错误太多。忽略这些警告错误并不影响程序的执行和结果。编译时当警告错误数目大于某一规定值时(缺省为100)便退出编译器, 这时应改变集成开发环境Options/Compiler/Errors中的有关警告错误检查开关为off。 10. 将关系符"=="误用作赋值号"="。此时屏幕显示: Lvalue required in function <函数名> 二、连接时的常见错误 1. 将Turbo C库函数名写错。这种情况下在连接时将会认为此函数是用户自定义函数。此时屏幕显示: Undefined symbol '<函数名>' in <程序名> 2. 多个文件连接时, 没有在"Project/Project name中指定项目文件(.PRJ文件), 此时出现找不到函数的错误。 3. 子函数在说明和定义时类型不一致。 4. 程序调用的子函数没有定义。 三、运行时的常见错误 1. 路径名错误。在MS-DOS中, 斜杠(\)表示一个目录名; 而在Turbo C 中斜杠是个某个字符串的一个转义字符, 这样, 在用Turbo C 字符串给出一个路径名时应考虑"\"的转义的作用。例如, 有这样一条语句: file=fopen("c:\new\tbc.dat", "rb"); 目的是打开C盘中NEW目录中的TBC.DAT文件, 但做不到。这里"\"后面紧接的分别是"n"及"t", "\n"及"\t"将被分别编译为换行及tab字符, DOS将认为它是不正确的文件名而拒绝接受, 因为文件名中不能和换行或tab字符。正确的写法应为: file=fopen("c:\\new\\tbc.dat", "rb"); 2. 格式化输入输出时, 规定的类型与变量本身的类型不一致。例如: float l;

编译出错种类

VC++编译的常见错误 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”没有初始化就使用。

64位 ANSYS FLUENT 编译UDF方法

ANSYS FLUENT 12.x 13.x版下使用Visual Studio 2010编译UDF的设置方法 COMSOL出了点问题,只能重装系统搞定。神马软件都要重装啊,今天装好ANSYS后,打开FLUENT界面时,灵感闪现,想出下面的方法设置UDF编译环境。 其实ANSYS版的FLUENT用UDF是不需要到系统环境变量里面设置path,include,lib的,如果您用的是Visual Studio 2010及后续版本,只需要按一定的规则设置udf.bat文件就行了。从udf.bat文件结构看,VS版本在VS2010以前的都可以不用设置,即可使用。 实现方法,以Win7 X64位ANSYS X64位为例: 1.找到fluent安装目录下的udf.bat(C:\Program Files\ANSYS Inc\v121\fluent\ntbin\win64\udf.bat) 用文本编辑器修改udf.bat: 添加 echo trying to find MS C compiler, version 10.0.... set MSVC_DEFAULT=%ProgramFiles(x86)%\Microsoft Visual Studio 10.0 if exist "%MSVC_DEFAULT%\vC\vcvarsall.bat" set MSVC=%MSVC_DEFAULT% if not "%MSVC%" == "" goto msvc_env100 set MSVC_DEFAULT=%ProgramFiles%\Microsoft Visual Studio 10.0 if exist "%MSVC_DEFAULT%\vC\vcvarsall.bat" set MSVC=%MSVC_DEFAULT% if not "%MSVC%" == "" goto msvc_env100 :msvc_env100 set MSVC_VERSION=100 call "%MSVC%\VC\vcvarsall.bat" amd64 goto ms_c_end 注:如果Visual Studio安装到其他盘,(可能)需要修改路径,比如装到D盘Program Files下,便这样添加: set MSVC_DEFAULT=d:\Program Files\Microsoft Visual Studio 10.0 if exist "%MSVC_DEFAULT%\vC\vcvarsall.bat" set MSVC=%MSVC_DEFAULT% if not "%MSVC%" == "" goto msvc_env100 :msvc_env100 set MSVC_VERSION=100 call "%MSVC%\VC\vcvarsall.bat" amd64 goto ms_c_end

相关主题
文本预览
相关文档 最新文档