First Pc-lint 9 installation and configuration tutorial
1. Download Pc-lint.9.0e.rar from here, unzip (the patch folder in the directory is not used because it can only upgrade pc-lint to 9.0e)
2. Click Pclint9setup.exe to install, the installation directory is C:\lint
3. After installation tick: I want to run the Configration program now, click Next to enter the automatic configuration interface
4. Welcome to the interface, prompt for copyright information, click "Next"
5. Display the Pc-lint command line usage instructions, click "Next"
6. Select "Create a new STD.LNT" profile, use the default path, click "Next", a warning appears, select "Yes"
7. Select the compiler, where you select Microsoft Visual C + + CO-MSC90. INT) ", click Next
8. Select the memory mode. You can choose a suitable memory mode according to the actual size of your program area and data area, select "32-bit Fat model (-ms,-SI4,-SP4)", click "Next"
9. Select the configuration information of the support library you want, select the
Active Template Library (ATL),
Microsoft Foundation Class Library (MFC),
Standard Template Library (STL),
Windows 32-bit,
Windows NT
Click "Next"
10. Choose whether to support some of the author's personal opinions about programming that have made important recommendations for the use of C + + programming. Choose the 3rd "Scott Meyers (Effective C + + more effective C + + and effective C + + 3rd Edition)" On the left, and select 1th "Dan Saks" and 3rd "MI" on the right. SRA 2004 ". Click "Next"
11. Select how to include the header file. Select create-i Options and choose Next
12. Select the header file directory that the project contains
Select the header file directory under the installation directory for Visual Studio 2010
"D:\VS2010\VC\include"
"D:\VS2010\VC\atlmfc\include"
Of course, you can later enter to change the LNT file to manually add
(Note: "VS2010" is the installation directory for my Visual Studio 2010)
13. Prompt Lnt file has been created, click "OK"
14. Prompt to create a new profile, select "No"
15. Select Generate an option file that controls the display of the global compilation information, and choose "No" to generate the file. Click "Next" and click "OK".
16. Select the supported integrated development environment, select "(Env-vc9. INT) Microsoft ' s Visual c++.net 2008 ". Click "Next"
17. Select Copy Lin.bat to any path directory, select "Prepend my pc-lint directory to my path (create LSET. BAT) "
18. Tip Lin.bat has been created, click "OK". Complete the installation configuration.
19. Upgrade the configuration from Visual Studio 2008 to Visual Studio 2010.
19.1 Download profile from official website (http://www.gimpel.com/html/ptch90.htm)
19.2 found env-vc10.lnt,co-msc100.h and co-msc100.lnt three files, respectively download (right-click and save Target As)
19.3 Enter the installation directory of Pc-lint (C:\lint) to delete the corresponding files (co-msc90.lnt,co-msc90.h and env-vc9.lnt) that belong to the configuration vs 2008, replacing the corresponding files with VS 2010 ( Env-vc10.lnt,co-msc100.h and CO-MSC100.LNT)
Delete the corresponding file for VS2008
Replace with the corresponding file for VS2010
19.4 std in open (C:\lint) directory. Int, put the keyword "co-msc90." Int "replaces" with "co-msc100". INT).
20. Update the Pc-lint version.
20.1 View the current version of Pc-lint:
Enter the command prompt, enter the Pc-lint installation directory, enter "Lint-nt-v" or "Lin" to display the current version is 9.00a
20.2 Upgrade Pc-lint:
Download the update file on the official website (http://www.gimpel.com/html/ptch90.htm)
(Download "Lpatch.exe" and "L9-A-B.LP" to "L9-H-I.LP")
Copy them all to Pc-lint's installation directory (C:\lint)
20.3 Write a batch file:
In this directory, create a new text document in which to write
Lpatch L9-A-B.LP
Lpatch L9-B-C.LP
Lpatch L9-C-D.LP
Lpatch L9-D-E.LP
Lpatch L9-E-F.LP
Lpatch L9-F-G.LP
Lpatch L9-G-H.LP
Lpatch L9-H-I.LP
Pause
Save, rename to "Update.bat", click Run
Click to run:
20.4 View the version of Pc-lint after upgrade:
Enter the command prompt, enter the Pc-lint installation directory, enter "Lint-nt-v" or "Lin" to display the current version is 9.00i
At this point, the Pc-lint installation configuration is complete and successfully upgraded from 9.00a to 9.00i. The second article integrates pc-lint into Visual Studio 2010
1. Open vs 2010, in Tools->external tools (external Tools), select "Add".
2. Test the configuration of individual files
Title (title): Pc-lint 9.0 Check Project
Command: C:\lint\lint-nt.exe
Arguments (parameter):-i "C:\lint" Std.lnt env-vc10.lnt "(itemfilename) (Itemfilename) (Itemext)"
Initial Directory (Preliminary): $ (Itemdir)
Tick "Use Output Window" and click "OK" to complete the configuration.
3. Test the configuration of the entire project
Title (title): Pc-lint 9.0 Check Current File
Command: C:\lint\lint-nt.exe
Arguments (parameter): +ffn-i "C:\lint" Std.lnt env-vc10.lnt "(TargetName)" InitialDirectory (Preliminary Catalogue): (TargetName) "Initial Directory (Preliminary): (ProjectDir)
Click "OK" to complete the configuration.
4. Parameter description
+FFN: Can find all files
-i "C:\lint": Set Default path (fill in according to your installation path)
sstd.lnt env-vc10.lnt "$ (TargetName)" : Set the Lint-nt.exe parameter, std.lnt to the selected profile, env-vc10.lnt to the output format in VS2010 environment, and later "$ (TargetName)" to include the file's path to the file name. The initialization directory for the tool is the directory of files $ (ProjectDir).
attached: Common errors
Problem: Error 322
Error code 322 when running:
#include <SDKDDKVer.h>
targetver.h (8): Error 322: (Error-Unable to open include file ' SDKDDKVer.h ')
Workaround:
Add the path of SDKDDKVer.h to the Std.lnt file, search for my SDKDDKVer.h file in C:\Program files (x86) \microsoft Sdks\windows\v7.0a\ Include,
under Pc-lint's installation directory (C:\lint), edit the Std.lnt file, add SDKDDKVer.h path after the path
-ic:\program files (x86) \microsoft SDKs \windows\v7.0a\include