Compilation and installation of Stlport

zhaozj2021-02-16  40

Compilation and installation of Stlport - Wang Meng (Heart Che "@163.com)

Foreword

Stlport is a set of C template libraries, BCB6 integration is the earlier version of this library. Although STLPORT does not have 100% complete support of ANSI standards, it is a standard with this template from Bao Lanken as a standard. Now let me talk about my compilation and use this development library. However, I want to explain, I am a C program design expert instead of C , my experience or experience is just how to use it in the project and apply it to the project.

Compile

Environmental configuration

Stlport supports the common compiler under multi-platform, but it is a Rongverong! Compile STLPORT under Windows You have to pay attention to three points: 1 Modify vcvars32.bat under VC98 / BIN; 2 Do not try to use Platform SDK; 3 Prepare debug symbols! why? Please listen to me slowly.

About the first point, you need to modify according to your platform, Vcvars32.bat compiles from the command line. Of course, you can use the Makefile document yourself to build project files in the IDE, but Stlport itself does not have this file!

Contains the path in STLPort directory in STLPORT directory, for example: set include = f: / stlport / stlport;% msvcdir% / ATL / include;% msvcdir% / include;% msvcdir% / mfc / include;% Include%

Contains the library path to add a lib directory under the set lib =, for example: set lib = f: / stlport / lib;% msvcdir% / lib;% MSVCDIR% / MFC / lib;% lib%

Ok, the first point is finished!

About the second point, everyone noticed that I didn't include the update to Platform SDK, in fact, I have installed this update in my machine (support Win2003 new feature!). I insisted that the reason why I haven't included it is that some files updated in Platform SDK compiles Stlport. Not surprising, Microsoft will be busy .NET is coming! Don't use it!

Regarding the third point, if there is no debug symbol file, you will give you a link error message when compiling the Debug version: (However, even if the NMAKE can still output the file, this can not work normally, I don't work. understood!

When you have finished these three steps, you can continue to compile your Stlport program in the command line in the future.

Makefile file

There are many .mak files in the SRC directory of Stlport, these files are masterpieces prepared for its multi-platform multi-compiler support. We use VC to compile different .mak files according to the compiler 's version: vc.net uses vc7.mak, VC5 uses vc5.mak (Stlport official test support), VC6 selection is relatively more, there are three files You can choose, select VC6T.mak with NT series, select VC6.mak with 98, you need to get Unicode support, VC6-Unicode.mak, vc6-unicode.mak is written for 98, although NT can be directly Use but I still have a small change: I will replace it! INCLUDE VC_COMMON.MAK is replaced with! Include VC_Commont.mak. In fact, if you know that the rules can be written according to your own needs, Stlport provides a template file named Build-Tempinc-XLC.mk in order to facilitate the developers who write Makefile files yourself. Use the command line in the src directory, perform COPY you choose .mak makefile, lazy at this time NMAKE INSTALL can be compiled to the installation! However, it is still a lot of things, I will continue to tell me. If you have a link error when you compile it in Link, don't be discouraged, you can perform the commands just now (strongly not recommended!) Or custom compilation.

** This step can you not copy directly NMAKE -F XXX.mak.

Custom compilation

For example, I hate the Debug version, so I will directly compile Release. The method is simple, if you want to compile a static library, you can use:

NMAKE RELEASE_STATIC

To compile a dynamic library

Nmake release_dynamic

Note that there is no ready-made install for custom compilation, you have to change your makefile, too much trouble.

installation

If you are a custom compile, you must look here. 1 The dynamic library DLL generated by Stlport is copied to System32 (NT) or SYSTEM (98), and in the directory. 2 Copy the Stlport subdirectory to the VC's INCLUDE directory. 3 Copy the .lib .exp file to the LIB directory of the VC.

If you don't plan to delete the STLPort's source code directory, second, third steps, because vcvars32.bat has been positioned. Otherwise, you'd better modify vcvars32.bat by the way.

Application in the project

1 No matter how Stlport must be in the first place in the include directory. 2 Dynamic library compile LINK stlport_vc6.lib static link stlport_vc6_static.lib. 3 If you use a dynamic library remember CopyStlport_? ? ? ? . DLL to the published program, otherwise, hehe! You know!

complete?

Through email health@163.com, I can provide you with limited technical support. Because I am not C CODER! Thank you for reading this article.

转载请注明原文地址:https://www.9cbs.com/read-24567.html

New Post(0)