Experience: VC .NET 2003 - Install and use Stlport 4.5.3 and LOKIPORT
Mood
2003-05-01
Article Type: in-depth
Difficult Level: 7/9
Version: 1.52
"I Want Visual C To BE The C Implementation of Choice" -
Stanley
Lippman
Recently, the WINDOWS Server 2003 is released two days ago, accompanied by Microsoft's latest developments Visual Studio.Net 2003, (some of which have all the new features "Visual Studio.Net 2003 New Features" already Description, this will not waste the space) You will find Visual C in Visual Studio.Net 2003, the improvement of NET or the special highlight of new features, is considered to be the most important highlights of the publicity:
1. Enhanced ISO C Conformance
2. New Pentium IV, Athlon Optimizations
3. Improved Code Security
4. New Windows Forms
In addition to providing capacity and security, for 1, 4 is interested in, for ISO C Standard and Visual C . NET, the data present in Microsoft shows that it is compatible and compliant with the standard. 98%
"The ISO C language standard defines several advanced features that have been conspicuously absent from previous versions of Visual C . Visual C .NET 2003 now implements roughly 98% of the standard-defined language features, a statistic that is on par with or better than The Majority of Commercial C Compilers, ON Any Platform. in Comparison, Visual C 6.0 Implements Roughly 81% of The ISO C Standard; Visual C .NET 2002 Implements 87% of The ISO C Standard. "
The exact message indicates the earliest data from Perennial in three Test Suite, and the other two are Plumb Hall and Dinkumware. And Microsoft Visual C . NICK HODAPP also takes out the specific list to get 98% of these parts from C ISO Standard (more specific information see Chris Maunder interviews):
l 2.2 Unicode Identifiers
L 3.4.2 Full Koenig Lookup
l 8.5.1 Empty AggRegate Initialization
l 9.8 Symbol Lookup for local member functions
L 11.4 Friends in Class Templates (Also 14.5.3) L 13.3.1.1.2 Implicit Invocation of Ptr-to-Func Conversions
l 13.3.2 Ranking of Derived to base conversions
l 14 Export Keyword
l 14.1 Non-Type Template Parameters (Also 14.3.2)
l 14.5.2 User-defined converness Templates
L 14.5.4 Partial specialization of class templates
l 14.5.5.2 Partial Order ORDERING OF FUNCTION TEMPLATES
l 14.6 Dependent name Lookup
l 14.7.1 Nested classes in class templates
l 14.7.3 Explicit Specialization of Member Templates
l 15.4 Exception Specifications
l 15.5.2 The unnexpected () FUNCTION
"We're not at 100%, yet, but expect that we'll remain on the path towards full conformance. In particular, the ISO features" Export "and" Exception Specifications "are tricky, and there is much debate as to their Usefulness. "
For 14.6 Microsoft promises to be implemented in the next version. Information that makes C community is very interested in "Compile and use Popular C Community-Written Libraries include Loki, Blitz, And Boost", rushing on this sentence and 98% highly compatible Indicators, with the idea of testing and verification, I compile and test some "C Community-Written Libraries". First, verify that it is really like it; two, I also found a lot of people who have similar ideas on the Internet, and the process of doing is different, so it is a good experience or experience; it's three, I It is found that there is too little Chinese information in this area, so I'm sorting a record and related resources and share it. Then there will be these two articles, the first article is about Stlport 4.5.3 and Loki, the second article is about Boost 1.30 and Blitz Library experience.
The first is Loki Library, this class library does not have to introduce too many, just recently Andrei Alexandrescu's "Modern C Design" book Chinese version - C design new thinking publishing, more people will have more understandings. For this set of libraries, there is no problem that realizes compilation and installation, which is generally in the needed module or function via include to your project, and then calls - compile - run. He said that Alexandrescu is not based on Visual C to write this class library, so if you really use Visual C .Net to compile, you may be enough, I stole it, I found this online. Aspects of resources. And Visual Studio.Net 2002 I have passed, so I haven't had problems in 2003, there is no problem, and there is a problem of resources. I want you to do what you need to do. JORIGINAL Download:
http://moderncppdesign.com
http://sourceforge.net/projects/loki-lib/
VC6 SP5 Download:
Http://fara.cs.uni-potsdam.de/~kaufmann/?page=lokiport
Http://fara.cs.uni-potsdam.de/~kaufmann/?page=lokiexamples
VC7.0 Download:
http://www.geocities.com/rani_sharoni/lokiport.zip
http://www.geocities.com/rani_sharoni/lokiport.html
Of course, you can also get to my website to get Loki Library for VC 6.0, Loki Library for VC 7.0
You download lokiport_vc7.zip, extract it into a directory such as the installation directory of Visual Studio.net 2003, then you can test it, very good is that this has already provided test programs for each mode, you only use it. Compile-running in the Tests directory can test their compilers.
For example: CL / GX / MT / EHSC Test_xxxxx.cpp is running -ok
Of course, some are more special, I guess you will compile Test_SmartPtr.cpp, the first time I will go wrong, as long as you do this according to the readme in the zip document, there is no problem with the following instructions:
CL / GX / MT / GR / EHSC Test_smArtptr.cpp ../smallobj.cpp
You have two points to use CL.EXE, you need to pay attention:
1. Guarantee you run x: / program files / Microsoft Visual Studio .NET 2003 / VC7 / BIN / VSVARS32.BAT or D: / Program Files / Microsoft Visual Studio .NET 2003 / Common7 / Tools / vsvars32.bat
2. Note that in your environment variables have the path to LOKIPORT, such as
@set incdude =% msvcdir% / lokiport70;% msvcdir% / atlmfc / include; ...
Or c:> set include = c: / lokiport70;% incdude "
More simple is Visual Studio.Net 2003 Command Prompt in the Visual Studio.net installer group.
But I suggest you back up your vsvars32.bat first, then modify this file directly, add the path to the locage of the Loki Library. In the above example, my Loki Library is below the path:
D: / Program Files / Microsoft Visual Studio .NET 2003 / VC7 / LOKIPORT70 / TESTS>
Ah, it's too simple. Of course, Loki can pass it. If it is so simple, I don't have to write this article, and there are more interesting stories behind, and then the stlport.
What is STLPORT, how, how do I don't have to say j, we directly enter the topic, and it is the key.
I am using Stlport 4.5.3 installation directory: c: /stlport-4.5.3
Visual C installed in D: / Program Files / Microsoft Visual Studio .NET 2003 / VC7 / BIN
You can do Download Http://www.stlport.com/download.html from here
Visual C 6.0 You can find most resources and steps in this article, but for the latest 4.5.3 to compile, you need a patch to see "Bug Fix for VC 6" below:
Using Stlport With Microsoft Visual C 6
http://www.softadvances.com/articles/stlportusing.html
Authors a good advice J "Dinkumware's VC6 STL IS $ 90; The Others Are Free. While SGI's Library Works with VC6, IT HAS Problems with
I used the above article to test the test:
Download until stlport-4.5.3.zip (1.2M) After decompression, the first reaction is to set your include and path, indicate your STLPORT LIBRAR path in both (see above).
As we all know, the STL library in Visual Studio.NET is a set of STL libraries written by PJ Plauger (also the author of the C STL book is also one of the founders of Dinkumware, which is mentioned above). It is mainly emphasized for STLPORT. Platforms and multi-compilers, so Visual C . Net is not native to compile and support, this problem is discovered in Visual Studio.net 2002 (VC7.0), but I seem to have problems in VC7.1 I see. More serious.
STLPORT-4.5.3 / SRC You can see the vc7.mak that makes you inspiring, if you execute nmake -f vc7.mak install directly, you will be very frustrated because you don't compile directly.
By continuous testing and reading a large number of discussion groups, I found that summary, need to make the following modifications:
STLPORT / CONFIG / STL_MSVC.H
Note Definition: #define _stlp_no_typename_on_return_type 1 Detail // # Define _stlp_no_typename_on_return_type 1
Modify all similar _stlp_msvc <= 1300 is _stlp_msvc <= 13101310 is the original file of VC7.1 version number for VC 7.0
2. Stlport / STL / _IOS.H
Mobile code block
# If defined (_STLP_USE_TEMPLATE_EXPORT) _STLP_EXPORT_TEMPLATE_CLASS basic_ios
After the statement
# ENDIF / * _STLP_NO_METHOD_SPECIALIZATION * /
But guarantee before _stlp_end_namespace sentence
3. Stlport / STL _Deque.c, stlport / stl / _hashtable.c, stlport / stl / _string.c, stlport / stl / _tree.c
This part of the modification is more, basically in these files
__iterator__ -> Typename __Iterator__
__sizet_type__ -> type__size_type
__reference__ -> Typename __reference__
This part is very much, the specific you can refer to this document: stlport4.5.3-vs.net-2003.diff
Http://www.zenadsl5874.zen.co.uk/temp/dcplusplus/stlport4.5.3-vs.net-2003.diff
Anyone who is bored with these modifications, I have collected my related documents to my website. You down, let's back your original file first, and then you can override the same file.
Downlaod: Stlport 4.5.3 Patch for VC7.1, Stlport 4.5.3 Patch for VC 6 SP5
4. After the adjustment is made, you can start compilation. Type:
Nmake -f vc7.mak instill or
Copy vc7.mak makefiel
Namek Vc7.mak Clean All
5. Don't have multiple compiles will be completed, you will find the following compile results below
Then you can start testing the results we compiled and see if the Stlport can use correctly.
Set
Set include =% msvcdir% / /stlport-4.5.3/stlport;%MSVCDIR% /ATLMFC/InClude;...
Copy compiled lib, DLL to% MSVCDIR% / LIB;
Otherwise set:
Set lib =% msvcdir% / stlport-4.5.3 / lib;% MSVCDIR% / ATLMFC / LIB; ....
I chose the test program with the Stlport tape.
CD / TEST / EH
Namek -f vc6.mak
The result is as follows
Don't be too nervous, see how many J needs to modify this is to adjust some statements and syntax, switch between different platforms and compilers, more importantly, Stlport does not nausea support VC compiler, discussion Some people in the group complained, I hope the next version of Stlport 5.0 is better to support the VC compiler, I guess this change is not immediately, but VC is a compiler I like, 6.0, 7.1 Still the same. If you don't compile or find what you want in my article, then you have to pay attention to:
http://www.stlport.com/cgi-bin/forum/dcboard.cgi
There are also a few posts:
"STLPORT-5.0-0409 and VC7.0 (.NET2002)"
http://www.stlport.com/dcforum/dcforumid7/1406.html
"Building On VC .NET 2003"
Http://www.stlport.com/dcforum/dcforumid6/1288.html
Problems with vc7.1
Http://www.stlport.com/dcforum/dcforumid6/1278.html
"Stlport Does Not Compile with Koenig Lookup"
Http://www.stlport.com/dcforum/dcforumid6/1277.html
"Bug Fix for VC 6"
http://www.stlport.com/dcforum/dcforumid6/1193.html
".NET 2003"
http://www.stlport.com/dcforum/dcforumid7/1408.html
"Getting Error In _String.h During Compiration"
http://www.stlport.com/dcforum/dcforum06/1232.html
I hope that this part I have clear enough, but I hope that these words will help when you do the same thing. Visual C in the family of Visual Studio.NET will become a relatively very special product and representative, becoming the only tool and media that can cross the Managed and Unmanaged environments, so even if the .NET is large, Visual C . With this, NET still will be ranked, and it will not fall.
For continuing to talk, still put it in the next article, I have some hesitation, take a break, give me some time, arrange the contents and arrangements of Boost and Blitz below.
especially:
The Visual Studio.Net Version 7.1.2292 used herein is not the final version of Visual Studio.Net Final Bate. It does not know whether it is different from official versions.
Cl.exe- Microsoft (R) 32-Bit C / C Optimizing Compiler Version 13.10.2292 for 80x86
This article original, 9CBS signature start, all text and photo copyright. Do not propagate, reprint, or adaptation without authorization.
If you have any questions or suggestions, please email new2001@msn.com
Welcome to my WebLog: www.dotnettools.org/weblog/weblog.html