搜档网
当前位置:搜档网 › dsp 编译错误与解决方法

dsp 编译错误与解决方法

dsp 编译错误与解决方法
dsp 编译错误与解决方法

dsp--ccs部分错误及解决

1,ERROR multiple sections with name PAGE0

解决 PAGE 0 中间有个空格隔开。

2 ERROR MEMORY specification ignored

解决 书写格式错误

3 ERROR:zero or missing length for memory area SPRAM

SPRAM: origin=0x0060H, 解决 书写格式错误

4 W ARNING: entry point other than _c_int00 specified

解决,在“TMS320C6000优化汇编手册”第五章“链接C/C++代

令人生厌的multiple definition of

我把所有的全局变量写在一个global.h里 然后其他文件都include 了它 于是出现了multiple definition of ..... 编译器gcc ) 后来在网上搜到了很多类似的错误大家各有各的烦心事。我的代码结构

main.cpp

#include "global.h"

WinMain(....)

...

}

file_1.cpp

#include "global.h"

....

file_2.cpp

#include "global.h"

...

由于工程中的每个文件都是独立的解释的即使头文件有

#ifndef _x_h

....

#enfif )

在其他文件中只要包含了global.h 就会独立的解释,然后生成每个文件生成独立的标示符。在编译器连接时,就会将工程中所有的符号整合在一起,由于文件中有重名变量,于是就出现了重复定义的错误。

下面是解决方法

在global.c或.cpp) 中声明变量 然后建一个头文件global.h 在所有的变量声明前加上extern ... 如extern HANDLE ghEvent; 注意这儿不要有变量的初始化语句。然后在其他需要使用全局变量的cpp文件中包含.h 文件而不要包含.cpp 文件。编译器会为global.cpp 生成目标文件 然后连接时 在使用全局变量的文件中就会连接到此文件。在其他文件中只要包含了global.h 就会独立的解释,然后生成每个文件生成独立的标示符。在编译器连接时就会将工程中所有的符号整合在一起,由于文件中有重名变量,于是就出现了重复定义的错误。

can't open file '/.obj' for input 是什么原因引起的?

cmd文件中有不合法的符号 比如 “//”等

1 fatal error: #error NO CHIP DEFINED 详细的出错信息:

"...." -g -q -fr"e:/project_documents/dsp_project/dsp_mp3/Debug" -d"_DEBUG" -@"Debug.lkf" ...c"

"...", line 141: fatal error: #error NO CHIP DEFINED 1 fatal error detected in the compilation of "...c".

在Build Options 的compiler里设置"-d"CHIP_..""如果没有设置一下

2 Q I have started to study the book "Digital Signal Processing and Applications with the C671

3 and C6416 DSK (by Rulph Chassaing, 2005)". I am working with a C6713DSK, using CCS 3.1. But when I try to run the first example (sine8_LED) in Rulph Chassaing's book on the C6713 Device Cycle Accurate Simulator, I get the following error messages: Trouble running Target CPU: Memory Map Error: READ access by CPU to address 0x1b7c100, which is RESERVED in Hardware. Trouble running Target CPU: Memory Map Error: WRITE access by Default to address 0x1b7c100, which is RESERVED in Hardware.

A Generally this type of error means that the CCS sees this section of memory marked as either Read-Only or RESERVED (Don't read or write). CCS can be passed a virtual memory map which is a safety net for the user. If you look inside your DSK's GEL file you will see a number of instruction calls for GEL_MapAdd() with six arguments inside. Two of these arguments denote a starting address range and the length of that range. These are used to notify CCS what memory is valid (and by extension, everything not mentioned is invalid memory). Take a look inside your DSK6713.gel file (probably located in C:\CCStudio_v3.1\cc\gel) and find where the GEL_MapAdd() instructions are located. You should see something similar to the following: GEL_MapAdd(0x01b7c000, 0, 0x00000128, 1, 1); // PLL here 0x01b7c000 is the starting address and 0x00000128 is the length of 'valid' memory. Because 0x1b7c100 falls within this range, if your GEL file looks like this CCS should then allow accesses to this register. The GEL file may need to be updated so that the address of the PLLCSR register is included to the CCS Memory Map. I actually just noticed that the title of your post is "C6713 Device Cycle Accurate Simulator" but you mentioned using the DSK. Can you please clarify which you are using? If using the DSK, open the DSK6713.gel file found in C:\CCStudio_v3.1\cc\gel and locate the setup_memory_map() function. Inside this function you should see numerous calls to GEL_MapAdd(). One of these will look similar to the one I copied in my last post. Once you find the function call that starts with the address 0x01b7c000, find out the length of this range (which should be the third argument). If this length does not cover address 0x01b7c100, modify the range to something like 0x00000128 to ensure that all of the PLL registers are included. If you are using the Cycle Accurate Simulator, I think this might be a limitation of the simulator software as it is run entirely on software as opposed to hardware. Well, you can modify the init6713sim.gel file in the same directory to add a GEL_MapAdd() from my earlier post. With the original GEL file CCS thinks that this memory range is invalid (because the simulator does not support the PLL). This would get rid of the errors regarding accessing that memory space, but because the PLL is not supported on the simulator

writes to this address will not work. I've seen the project you mentioned before, but I do not remember enough about it to know whether or not this would cause the application to fail. I think a bigger question here is why work on the simulator if you have a DSK handy? The code from that book is designed specifically to work on the DSK hardware, not on a CPU simulator.

3 把调试程序的时候的一些错误提示和解决方法记录下来,有备无患

1.symbol referencing errors

undefined first referenced

symbol in file

--------- ----------------

_dot_asm E:\CCStudio_v3.1\MyProjects\dot_mpy_6211\Debug

\main.obj

>> error: symbol referencing errors

提示找不到符号,一般是出现在用c调用汇编函数的时候,比较大的可能性是汇编程序里面

的标号写错了(特别是前面少了一个下划线),或者是忘记将标号定义成全局的了(在文件开

头用".global 标号"的形式可以定义) 不过我碰到另外一种情况,是由于存在同名的文件. 比如说我的工程里面,有dot.c和dot.asm两个文件,分别定义了dot_c和dot_asm两个函数,这个时候就会有其中一个函数提示找不到了,经过检查,原来CCS在编译的时候,会根据文件名(不含扩展名)生成同名的目标文件(扩展名为obj),而我前面的两个文件,文件名相同而扩展名不同,那么在编译的时候,就会有一个生成的目标文件被另外一个覆盖的问题(取决于编译的顺序).知道了原因就好解决了,只要这两个文件的文件名不要相同就好了.

2.弹出一个确认框,提示"TRDX target application does not match emulation protocol!Loaded program was created with an rtdx library which does not match the target device" 错误原因是使用的是软件模拟(Simulator),不能模拟JTAG 解决方法:打开cdb文件,选择"Input/Output -> RTDX-Real-Time Data Exchange Settings"右键,然后选择"Properties",打开对话框,RTDX Mode的下拉列表中选择Simulator(默认值是JTAG,需要接仿真器才能用默认值) 放在这里备用吧. 各位大侠小弟以前用的是cc2000 现在改用ccs2.2 但是在编译的时候报错说不能打开obj文件,我查了一下在指定的obj保存目录下根本就没生成obj文件,修改一下编译的路径在编写DSP程序时遇到一个很奇怪的问题,我的程序在CCS4.1版本下运行正常 但在2.20版本中确总是出现以下编译问题can't open file E:\HNJN100.obj for input 版本一样编译器版本不一样,这时要从新建立.mak文件,然后add files包含进来.cmd .asm等程序文件编译即可,不能直接打开编译.cmd文件错

快刀斩乱麻,进入你的项目文件夹 把所有.obj文件删掉 一般在obj文件夹中 然后执行rebuild all 一般就能解决问题。

> 1112.mak, LINE 32: -o flag does not specify a valid file NAME

>> : can't open file .out for input Build Complete,

2 Errors, 0 Warnings.

bill(75623171) 12:51:05

这个是什么原因

补充两句

现代编译器都支持分别编译技术 即每个文件都可以独自编译生成二进制目标文件 .obj

最后连接在一起生成可执行文件 .out 。问题是ccs编译器采用了独特的识别文件修改的方法 如果原文件的修改时间大于目标文件的修改时间 编译器就认为次原文件被修改过。如果用户的工程文件曾经复制到别的电脑并做过修改,此时清查,看并修改原文件的修改时间。否则就可能出现编译上的错误 这往往是由两台电脑的时间系统不同而导致的。就像我遇到的这种错误一样。

如史修栋所说 把所有.obj文件删掉 一般在obj文件夹中 然后执行rebuild all

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语言编译常见错误列表

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.sodocs.net/doc/5b1196061.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升级、操作系统改变了或者运行在不同的类型的计算机,必须重新编译这些库。

VC6.0中 各link错误解决方案

VC6 各link错误解决 修改浏览权限| 删除错误1: LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main 在project-setting-link里找到project options 去掉里面的/subsystem:console 错误2: nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endt... 将工程设置为Using MFC in a static library 错误3: libcmtd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main 在project-setting-link里找到project options 将里面的/subsystem:console 改为/subsystem:windows ///////////////////////////////////////////////////////////// VC6的几个Link error 修改浏览权限| 删除sega 发表于- 2005-9-30 19:56:00 今天下午别人问我的,错误大概是这样: nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex Debug/poisson.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe. 我也不知道到底nafxcwd这个库是怎么回事,就google了一下,果然找到些东西: 解决外部符号错误:_main,_WinMain@16,__beginthreadex 在创建MFC项目时, 不使用MFC AppWizard向导, 如果没有设置好项目参数, 就会在编译时产生很多连接错误, 如error LNK2001错误, 典型的错误提示有: libcmtd.lib(crt0.obj) : error LNK2001: unresolved external symbol _main LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 msvcrtd.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16 nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex 下面介绍解决的方法:

常见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 ) 函数调用缺少右括号

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 后的变量或表达式错误(此时可通过看题意,来分析该返回哪一变量或表达式)

VC6.0编译错误解决方法集锦

VC6.0编译错误解决方法集锦 windows编程2010-05-08 21:14:39 阅读83 评论0 字号:大中小订阅 VC6.0编译错误解决方法集锦 最近打算学习一下网络编程,而大部分socket编程环境都是Unix的,很是不便,在windows中总是不能编译,特寻得一篇文章解决此痒。爽哉、爽哉! linking... server.obj : error lnk2001: unresolved external symbol server.obj : error lnk2001: unresolved external symbol s erver.obj : error lnk2001: unresolved external symbol server.obj : error lnk2001: unresolved external symbol server.obj : error lnk2001: unresolved external symbol server.obj : error lnk2001: unresolved external symbol s erver.obj : error lnk2001: unresolved external symbol server.obj : error lnk2001: unresolved external symbol server.obj : error lnk2001: unresolved external symbol server.obj : error lnk2001: unresolved external symbol server.obj : error lnk2001: unresolved external symbol server.obj : error lnk2001: unresolved external symbol server.obj : error lnk2001: unresolved external symbol server.obj : error lnk2001: unresolved external symbol server.obj : error lnk2001: unresolved external symbol 原因和解决办法: 找不到相应函数,问题是Link选项里没有加入相应的lib库,winsock要连接wsock32.lib。特定库的找到办法是看LNK2001中找不到的函数名,通过msdn或者其他手段获取这个函数所在的库名,链接进去就OK了。 可以在project->setting->Link->object/library modules 里添加wsock32.lib,也可在stdafx.cpp 里添加#pragma comment(lib,"wsock32.lib") 一般来说, 这是工程的类型选择错误引起的.如在VC中, 1.本来应该选择"Win32 Console Application",而错误选择了"Win32 Application" 2.使用了MFC的类,而选择"工程"的"设置"不使用MFC库编译. 改正的方法有: 1. 选择"工程"-> "设置"-> 连接,在底部的编辑窗口中,找到"/subsystem",把其改成 "/subsystem:console" "/subsystem:windows". 2.在"工程"-> "设置"->"一般"选项中,在MFC项中改为"USE

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

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 表达式语法错。如表达式中含有两个连续的运算符

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:

QUARTUS2编译错误解决方法

Error(10257):Verilog HDL error at dp4inNpa.v(13):unsized constants are not allowed in concatenations 解决方法:拼接语句a_fout={0,exp_a_out,temp_a_out,12'd0};其中0应标注位宽,编辑器不会默认为1位,应为a_fout= {1'b0,exp_a_out,temp_a_out,12'd0}; Error(10053):Verilog HDL error at dp4inNpa.v(12):can't index object"a" with zero packed or unpacked array dimensions 解决方法:错:input a;对:input[12:0]a; Error:Net"acc[12]",which fans out to"accumulate:inst4|acc[12]", cannot be assigned more than one value Error:Net is fed by"time_get_sub:inst3|acc[12]" Error:Net is fed by"sample_en:inst6|acc_out[12]" 解决方法:输入的某些引脚同时给了两个值,大概不是重复定义管脚就是重复赋值了。 Error:Top-level design entity"delta_t"is undefined 解决方法:将.v文件名和module的名称改为一致 Error:Inconsistent dimensions for element"tR" 解决方法:"tR"在传递过程中可能丢失了"[12..0]"

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

https://www.sodocs.net/doc/5b1196061.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”没有初始化就使用。

相关主题