How to run QAC tool from command line? - qa-c

I have a C project and I would like to run QAC tool v7.0 from command line. I tried the following option,
C:\qac.exe -via <project_name.prj>
However, when I run the above command. I get an error saying the "VersionTag" is not found. The "VersionTag" string is the first line in the .prj file. I am not sure this is the right way to run this tool. Any help appreciated.
The qac -help is not giving valuable information either. The tool version is pretty old and the company 'Programming Research' behind this tool also has been renamed? to Perforce. They do not have any information about command line invocation either from the existing documentation or webpage.

The QAC utility is the "engine" part of the QAC package, corresponding to a compiler.
It won't be happy being run on command line without a number of environment variables:
QACBIN must point to the bin directory of the QAC package installation;
QACHELPFILES must point to the location of message help files;
QACOUTPUT points to the location where output files will be generated (binary .err file for each source file and textual .met file containing semantic and metric information.
The -via parameter to the command line should point at a text file containing other parameters used by the utility.
The .prj file is a package-level file defining the location of C source files being analysed plus their configuration settings files, among other things. It definitely should not be passed directly as a parameter to the QAC utility.
This should get you started, and other questions need to be more specific.

Related

WAF.IO how to start compile?

my question my look silly but I'm complete yellow bird in programming.
Have challenge to compile using waf.io. I went thru basic instructions https://waf.io/apidocs/tutorial.html?highlight=start. But there is missing basic information: where I should put all these commands?
You must put these commands in a file named wscript. This file should be in the directory where your other project files are.
Then you will use the waf command in the same directory to run it.
Look at the waf book.

How does AOSP build system produce .rsp files and how to get them?

According to How does AOSP 9.0 build system link the executable? and What does # mean in this clang command in AOSP build log? , when linking a module, AOSP seems to produce a .rsp file that contains all the obj files that the module need,and pass the file name as a parameter to the link command, for example:
prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++ /OpenSource/Build/Android/9.0.0_r30/soong/.intermediates/bionic/libc/crtbegin_so/android_x86_64_core/crtbegin_so.o #/OpenSource/Build/Android/9.0.0_r30/soong/.intermediates/frameworks/base/libs/hwui/libhwui/android_x86_64_core_shared/libhwui.so.rsp ......
But the .rsp files seems to be removed after build.
The question is, how are these file generated and how to get these files? This may require to learn and modify the build scripts which is out of reach for me.
There maybe the answer for you, read the ninja build manual , in that manual .rsp file mentioned.
https://ninja-build.org/manual.html
the following is info that I copy out.
rspfile, rspfile_content
if present (both), Ninja will use a response file for the given command, i.e. write the selected string (rspfile_content) to the given file (rspfile) before calling the command and delete the file after successful execution of the command.
This is particularly useful on Windows OS, where the maximal length of a command line is limited and response files must be used instead.

Convert iOS project to 64 bit using ConvertCocoa64 script

I need to convert my iOS project to 64-bit friendly (to get rid of compiler warnings, as in this question. The solution apparently is to run ConvertCocoa64.
I've managed to locate ConvertCocoa64 (which is no longer included in /Developer/Extras/64BitConversion/ConvertCocoa64) as the Apple docs suggest, but here (search for Auxiliary Tools)
So I've download the script. But my question is, how do I run this on my project? Please assume a total newbie level of knowledge here when it comes to the terminal and running scripts. Do I drop the script inside my project folder and just double click it? Or do I access it from the terminal? The docs say run this command:
/Developer/Extras/64BitConversion/ConvertCocoa64 `find . -name '*.[hm]' | xargs`
But since that folder doesn't exist, where do I run it?. I tried dropping the script in the Developer folder, but when I type ConvertCocoa64 it says command not found.
Find where the command is located now. You'll want to run it in the terminal using the full path to the command, as in your example, just with the real path.
A good way to get the full path is to locate the command in the Finder and drag it to an open terminal window - this also "escapes" any spaces in the path for you. The easiest way to hit all your files as arguments to the command is to cd (change directory) to your project first (in the terminal).
This should get you set up to follow the directions you have.
If I'm not mistaking, to run script, you should place dot . before command. Doesn't really matters, where script is situated as long, as it doesn't rely on it heavily
> cd ~/path/to/script/dir/
> ./ConvertCocoa64 ...

BlackBerry Cannot run program "jar": CreateProcess error=2, The system cannot find the file specified

I am developing a BlackBerry Application with a number of class files in it; 16 java classes at the moment and they keep increasing as this App is complex with a lot of screen and features. I am working in Eclipse with the BlackBerry Java Plug-in. I am using BlackBerry JRE 6.0. I have recently started getting the following error:
Error: Cannot run program "jar": CreateProcess error=2, The system cannot find the file specified
I have Google for this error and many suggest this is caused by Java Environmental Variable path. However, I have checked and everything seems to be fine at my end regarding that. I have noticed that when the number of classes is increased or a class becomes more lengthy, this error occurs. I get rid of the error by reducing the number of classes in a project. I created separated projects dividing the classes between each and it compiled fine. So I can believe that there is no issue with the source code.
Can anyone guide how to overcome this error in a single project that contains several classes. Please help.
EDIT: I came across the following on BlackBerry Support Forums:
"I think the most common reason for this (assuming that you have the JDK installed) is a large number of files in the project, and/or a project directory that is very far from the root.
The issue is that the RAPC compiler calls the JAR utility, building a command line that consists of all the class files in the application. If the command line length exceeds the maximum length allowed by the system, you will get this error."
How to work around this IF this is whats causing it.
I was lucky to resolve this error. This link has been very helpful from BlackBerry Support Forums. For anyone else facing the same issue, the following steps resolved my issue:
Right Click My Computer. Go To Properties.
Click Advanced System Settings.
Click Environment Variable
Highlight PATH and click Edit. Add C:\Program Files (x86)\Java\jdk1.6.0_26\bin; to the start of the PATH.
Step 4 adds the java jar file to the PATH variable and adds it closer to the root. Adding closer to the root is helpful when compiling a project with several classes.
As the error says Cannot run program "jar" under Windows that means it cannot find the jar.exe executable file.
The problem, at least in my case, was that JAVA_HOME was pointing to the JRE on my computer (where there is no jar.exe in its "bin" folder) and not to the JDK where the jar.exe resides under its "bin" folder.
The solution was very simple - changed JAVA_HOME to point to the JDK root folder - in my case that was "C:\Program Files\Java\jdk1.7.0_15".

DCC32 compiler configuration file and command line parameter precedence

I am trying to build first time my Delphi application through command line using DCC32. I have few doubts regarding the configuration file of my project. There are some search paths I have to add to project when compiling through IDE. When I remove them, the compilation fails.
Now if I compile it through command line is it need to specify configuration file details or the search path parameters?
without any parameters:
dcc32.exe project1.dpr
with some parameters:
dcc32.exe -u%Shared% -ND:\out project1.dpr
I have following doubts:
if the config file details are not mentioned then it will take settings automtically from project.cfg (created by IDE)??
if yes then if i mentioned the -U,-N options in command line then it will override All the settings which are in .cfg ile?
This question sounds foolish but want to know What is use of compiling through command line over IDE?
Please provide some help to resolve my doubts. Any information related to dcc32 compilation options will be appreciated.
1. - If the project config file is not specified in the command line options, will the settings be taken from the project's cfg file generated by IDE ?
Yes.
2. - When I use the -U, -N options in command line will that override all the settings from a project cfg file ?
No. Command line options takes precedence though, but only those options you specify will override the settings from the project's *.cfg file, not the whole configuration
3. Is there a difference between compilation from command line and compilation from IDE ?
No. There is no difference speaking about Delphi 5. From my view, the command line way just brings you the possibility to automate a build process through command line batch without need of opening IDE.
It's been a while, but I believe you are correct in your assumptions about the command-line vs the .cfg file. You can verify this yourself by having one path in the .cfg and specifying a different one on the command line and, say, have an error in the file that the .cfg would reference and see if the compiler hits the error.
Compiling from the command-line is convenient for automated build systems but is otherwise the same as compiling through the IDE.

Resources