简体   繁体   English

在Windows 7上使用frama-c

[英]frama-c usage on windows 7

I have installed Boron version of windows installer from frame-c website http://frama-c.com/download.html 我已经从frame-c网站http://frama-c.com/download.html安装了Windows安装程序的Boron版本。

when I try to run the val plugin, I am getting an error about preprocessor varaible CPP not being set as below: 当我尝试运行val插件时,收到关于未设置预处理器可变CPP的错误,如下所示:

 C:\\Frama-C\\bin>frama-c.exe -val filename.cpp [kernel] user error: failed to run: gcc -C -E -I. -o "C:\\Users\\akandoor\\AppData\\Local\\Temp\\filename.cpp4f5d23.i" "filename.cpp" you may set the CPP environment variable to select the proper preprocessor command or use the option "-cpp-command". [kernel] user error: skipping file "filename.cpp" that has errors. [kernel] Frama-C aborted because of an invalid user input. 

with the -cpp-command I get the following error: 使用-cpp-command我得到以下错误:

 C:\\Frama-C\\bin>frama-c.exe -cpp-command 'C:\\utils\\cygwin\\bin\\gcc.exe -C -E -I. - xc' filename.cpp [kernel] user error: option `-C' is unknown. use `frama-c.exe -help' for more information. [kernel] Frama-C aborted because of an invalid user input. 

ANy clues/suggestions? 有任何线索/建议吗?

Here is a suggestion: since pre-processing is causing trouble, do the pre-processing in any way that is convenient for you, saving the pre-processed file(s) as .i files. 这是一个建议:由于预处理会引起麻烦,因此请以对您方便的任何方式进行预处理,并将预处理后的文件另存为.i文件。 Then pass the .i files on Frama-C commandline: it will know it does not need to pre-process them then. 然后在Frama-C命令行上传递.i文件:它将知道它不需要进行预处理。

If you insert annotations into the .c files or want to change the pre-processing options, do not forget to re-generate the .i files. 如果您在.c文件中插入批注或要更改预处理选项,请不要忘记重新生成.i文件。


Another suggestion more often addressed to people who want the last, improved Frama-C version is to install inside a Linux virtual machine. 对于想要最后一个改进的Frama-C版本的用户来说,另一个更常见的建议是在Linux虚拟机中安装。 This would make everything just work. 这将使一切正常工作。 There would be a GCC in the default PATH, and this GCC would take the commandline options -C and -E to pre-process. 默认PATH中会有一个GCC,并且该GCC将使用命令行选项-C-E进行预处理。 You would be using the same environment as most of the users and developers of Frama-C. 您将使用与Frama-C的大多数用户和开发人员相同的环境。 And you could have a more recent version, too. 您也可以使用更新的版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM