Intel Visual Fortran 与 Visual Studio 集成的若干问题

Intel Visual Fortran 与Visual Studio 集成的若干问题
2009/01/11 10:12
一.无法集成
在Visual Studio 2005中集成Intel Fortran 11 。首先应装 Visual Studio 2005,至少要选择VC++组件,安装好了之后再安装Intel Fortran 11。
安装过程中注意有没有 Intel Visual Fortran Comiler 11.0 Integrations in Microsoft Visual Studio 组件,这个组件的作用就是使之集成到 VS 开发环境。一般都是默认安装的。
两个软件都安装完了之后启动VS2005,看看Help->About Microsoft Visual Studio 里是否显示组件已经安装成功,如图:
或者查看新建项目时有无
如果没有出现与Fortran 有关的工程类型,则说明集成并未安装成功。
此时可到VS 的安装目录中,比如:C:\Program Files\Microsoft Visual Studio
8\Intel Fortran\VFPackages里双击批处理文件integrate.bat之后再启动VS2005看看是否集成成功。
一般的错误为:VFProj.Dll没有成功注册。通过 Regsvr32 工具对其注册。在命令行内输入:
Regsvr32 "C:\Program Files\Microsoft Visual Studio 8\Intel
Fortran\VFPackages\VFProj.DLL"
若注册失败并显示错误码为0x80070005,则是因为注册表权限问题导致。
将电脑重新启动,按F8进入安装模式,在DOS窗口中输入如下命令:
C:\WINDOWS\system32\secedit /configure /cfg %windir%\repair\secsetup.inf /db secsetup.sdb /verbose
等到100%的时候,重新启动电脑。此时再次注册VFProj.dll就会成功。再次启动VS2005就会发现已经集成成功了。
另外使用中文版的VS2005也有可能集成不成功,解决方法为:
在非英语版本的Visual Studio 2005中集成Intel Fortran 10会遇到这个问题。Visual Studio 2003不会遇到。解决办法如下:
Installing Into a Non-English Version of Microsoft Visual Studio 2005*
If you are using a non-English version of Microsoft Visual Studio 2005 and have installed the Intel Visual Fortran Integrations into Microsoft Visual Studio, there is an additional procedure you must follow in order to make the integrations usable. This does not apply to Microsoft Visual Studio.NET 2003.
You must first identify the Locale ID that Microsoft uses to identify your language locale. For example, the ID for English is 1033 and the ID for Japanese is 1041. You can find the Locale ID for your version of Microsoft Visual Studio 2005 by looking for a folder whose name is a four or five digit number in \Program Files\Microsoft Visual Studio 8\Common7\IDE. The number is your Locale ID.
In each of the following folders:
\Program Files\Microsoft Visual Studio
8\Common7\IDE\ProjectTemplates\IntelFortran\COM Server
\Program Files\Microsoft Visual Studio
8\Common7\IDE\ProjectTemplates\IntelFortran\Console Application
\Program Files\Microsoft Visual Studio
8\Common7\IDE\ProjectTemplates\IntelFortran\Library
\Program Files\Microsoft Visual Studio
8\Common7\IDE\ProjectTemplates\IntelFortran\QuickWin Application \Program Files\Microsoft Visual Studio
8\Common7\IDE\ProjectTemplates\IntelFortran\Windowing Application you will find a folder named 1033. Make a copy of the 1033 folder (and its contents) and rename the folder to be that of your Locale ID(中文的 ID 是:2052). For example, if you have a German version of Visual Studio 2005, you would make a copy of the 1033 folder in each of the above folders and rename the copy 1031 (the Locale ID for "German - Germany") Repeat this step for each of the five folders listed above.
After the folder copy is done, open a Fortran Build Environment command window (Start > All Programs > Intel(R) Software Development Tools > Intel(R) Fortran Compiler > Fortran Build Environment for IA-32 Applications. In that command window, type the command:
devenv /setup
This will properly register the Fortran integration.
In a future update to the product these copies will be made automatically at install time. We apologize for the inconvenience。
二. VC++ 执行 CMD 错误
VS2005 C++编译一个程序,竟然出现error PRJ0003:Error spawning '' 依下面方法便可解决:
tools=> Options => Projects and Solutions -> VC++ Directories page
在$(PATH)的下一行写上:
$(SystemRoot)\System32;$(SystemRoot);$(SystemRoot)\System32\wbem
如图:
三. 资源编辑器对话框编辑内无法新增 Fortran 的控件
这是一个 Visual Studio 的 Bug,安装 Visual Studio SP1 后即可解决。注意自己是英文版还是中文版,别下载错了。最好通过 Windows Update 升级。
VC 与Visual Fortran 使用Console 全屏窗口
2008/12/24 19:39
昨天成成哥哥问我怎么把 Console 程序设置为全屏效果。这里简单说一下。
设置 Console 窗口全屏,需要使用到一个 API 函数:SetConsoleDisplayMode。
这个函数在较低的 SDK 中并没有列出。我们需要用动态调用来使用这个函数。
它的定义如下:
SetConsoleDisplayMode
The SetConsoleDisplayMode function sets the display mode of the specified console screen buffer.
BOOL SetConsoleDisplayMode(
HANDLE hConsoleOutput,
DWORD dwFlags,
PCOORD lpNewScreenBufferDimensions);
Parameters
hConsoleOutput
飞向美国论坛[in] Handle to a console screen buffer.
dwFlags
[in] Display mode of the console. This parameter can be one or more of the following values.
Value Meaning
CONSOLE_FULLSCREEN_MODE Text is displayed in full-screen
1mode.
CONSOLE_WINDOWED_MODE 2Text is displayed in a console window.
lpNewScreenBufferDimensions
Pointer to a COORD structure that receives the new dimensions of the screen buffer, in characters.
使用上,比较简单,这里提供 VC 和 Fortran 两种版本的演示。
VC 版:
#include"stdafx.h"
#include<windows.h>
typedef DWORD (CALLBACK *MYPROC)(HANDLE,DWORD,PCOORD);
int main(int argc, _TCHAR* argv[])
{
MYPROC pAddr ;
HMODULE hModule;
HANDLE hCon;
BOOL bRes;
sj operahCon = GetStdHandle( STD_OUTPUT_HANDLE ); // 获得Console窗口句柄
hModule = LoadLibrary( TEXT("Kernel32.DLL"));  // 获得Kernel32 的模块句柄
pAddr = (MYPROC) GetProcAddress( hModule , "SetConsoleDisplayMode"); // 获得函数地址
bRes = pAddr( hCon , 1 , NULL );
return (0);
}
Fortran 版,需要在 Visual Fortran 系列编译器下使用:
Use Kernel32 !//使用Kernel32 函数库
Interface!//书写SetConsoleDisplayMode 的函数接口
Subroutine SetConsoleDisplayMode( hConsoleOutput , dwFlags , dwNULL )
Integer , Value :: hConsoleOutput
Integer , Value :: dwFlags
Integer :: dwNULL
End Subroutine SetConsoleDisplayMode
End Interface
Integer :: pAddr , hModule , hCon !// 定义函数地址,Kernel32 模块句柄,Console 窗口句柄
Pointer( pAddr , SetConsoleDisplayMode) !// 将函数地址和函数关联起来
xcelhModule = LoadLibrary("Kernel32.DLL")  !// 获得Kernel32 的模块句柄
pAddr = GetProcAddress( hModule ,"SetConsoleDisplayMode") !// 获得函数地址hCon = GetStdHandle( STD_OUTPUT_HANDLE ) !// 获得Console窗口句柄
Call SetConsoleDisplayMode( hCon , 1 , 0 ) !// 调用函数,第一个参数是Console 窗口句柄,第二个参数为1 表示全屏,为0 表示窗口模式。第三个参数没有用。
End Program
这两个程序可以方便的修改为函数过程使用。把这个函数的第二个参数改成 0,可以恢复 Console 的窗口模式。
程序设计的几个基本概念
2008/12/17 22:11
最近有位朋友刚开始学编程,所以以下文字写给她的。高手就不用看了~~
关于程序设计的几个基本概念,其实还是蛮重要的。然而很多新手,甚至已经书写过很多程序的老手,他们的这些概念都非常的模糊。
首先说一说高级语言和汇编语言,以及机器语言的区别和联系。很多课本上也都有提到过,但都比较模糊,难以深刻的理解。
实际上,我们的计算机是不懂得我们的语言的(中文,英文等)。而计算机处理数据,只是 1 和 0 两种而已。因此,真正的计算机执行的命令,都是以 0 和 1 这样的数字形式存在的。不同的处理器,他们的执行命令也不同,但基本上已经形成业内的一些规范和指令集。
而机器语言由于都是用数字表示的指令和数据,因此非常的生涩,几乎不会有人直接使用它书写程序。
于是,人们使用更方便理解的,具有一定意义的,文字的命令去一一对应这些机器语言。这样相当于提供了一种人可以接受的机器语言形式,这就是汇编语言。
汇编语言与机器语言的对应关系非常直接,非常简单,这就使得机器语言与汇编语言之间,存在一种很直接的相互转换过程。这就是汇编和反汇编。(汇编指从汇编语言到机器语言,反汇编则相反)(实际上,某些汇编语句还是需要转换的,但绝大多数都可以直接与机器语言对应)
汇编的过程,就是一个汇编程序(比如微软的 MASM)将一个文本形式的汇编源代码(比如 *.asm 文件)翻译成机器语言的过程。
比如有以下的 *.asm 文件代码段:
rA dd ?  ;定义 rA 变量
rB dd ?  ;定义 rB 变量
rC dd ?  ;定义 rC 变量
.code
start:
mov rA , 1  ;为 rA 赋值为 1
mov rB , 2  ;为 rB 赋值为 2
mov eax , rA  ;将 rA 装载入 eax 寄存器农村公共产品供给
add eax , rB  ;在 eax 寄存器加上 rB 的值
mov rC , eax  ;将相加的结果,也就是 eax 寄存器的值放入 rC 变量当然,我们的汇编程序并不是死死的要求我们敲入一个又一个的变量地址。汇编程序还有很多功能,比如变量内存管理。
如上代码提到的变量 rA,rB 和 rC 三个变量。汇编程序自动为我们分配了地址。而所有的定义语句,在汇编后将不再存在。
以上的汇编语句,经过汇编以后,就变成了形如以下的机器语言(后面对应了反汇编后的“汇编”表达形式):潍坊日向友好学校
C705 00304000 01000000      ;mov dword ptr [403000], 1
C705 04304000 02000000      ;mov dword ptr [403004], 2
A1 00304000                  ;mov eax, [403000]
郭莎莎
0305 04304000                ;add eax, [403004]
A3 08304000                  ;mov [403008], eax
这里的 [403000] 就是 rA 的地址,[403004] 是 rB 的,而 [403008] 是 rC 的。也就是说,经过汇编之后,所有的变量名变成了地址,所有的函数,也变成了地址,所有的常量也变成了它的值。这样,我们在书写汇编语言代码的时候,就不需要去考虑内存地址的问题,简化了我们的工作。而从“变量名”(如 rA,rB,rC)到“内存空间”(如

本文发布于:2024-09-22 07:40:04,感谢您对本站的认可!

本文链接:https://www.17tex.com/xueshu/444445.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:机器语言   函数   安装
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议