• STLport在vc6中的集成


    STLport的下载

    http://sourceforge.net/projects/stlport/

    STLport的编译

    * 试验环境 : win7x64sp1 + vc6sp6
    * 打开控制台窗口 cmd
    * 运行vc6编译环境命令行批处理

    *移除STLport编译配置

    * 配置STLport的所有者为vc6, 编译动态库和静态库版本

    * 编译STLport

    STLport的使用

    Tools -> Options -> Directories

    测试程序

    单步可以跟入STLport ^_^

    STLportdocREADME.msvc中的一些摘录

    =============

    Using STLport

    =============

    Adjust your include and link paths in MSVC IDE (in 'Tools -> Options -> Directories'

    for MSVC6 IDE). In the include files add the path to STLport's 'stlport' folder. 

    Make sure it is the first directory listed there. Add STLport's 'lib' folder for

    the library files (order of paths doesn't matter here).

    There are some preprocessor defines that control usage of the STLport in msvc

    projects:

    If you don't want to use the iostreams part of the library, you can specify the

    define _STLP_NO_IOSTREAMS. In this mode there is no need to link against the

    library.

    STLport uses automatic linking to find the proper .lib file. If you want to see

    what import library STLport is going to use, define _STLP_VERBOSE_AUTO_LINK.

    When not using automatic linking (by specifying _STLP_DONT_USE_AUTO_LINK), you

    have to specify the proper .lib file in the Project Settings, on the "link" tab.

    The .lib names have the following syntax:

       stlport[d|stld][_x,_static,_statix].<STLport-Version>.lib

       d : debug build

       stld: debug build with _STLP_DEBUG (STL safe) mode

       _x: Build of STLport as a dll but statically link to the native runtime.

       _static : build of a static library

       _statix : build of a static library link dynamically to the native runtime.

       

    Examples:

       stlport_static.5.0.lib - static release version, Version 5.0.0

       stlportd.5.0.lib - dll debug version, Version 5.0.0

    When using STLport together with MFC, be sure to include the MFC headers first,

    then include STLport headers, e.g. in your Stdafx.h. This way STLport correctly

    recognizes MFC usage. You also can define the macro _STLP_USE_MFC, either in

    your project settings or in stlport/stl/config/user_config.h.

    In order to enhance debugging with STLport you can optionally add the content of

    the etc/autoexp.dat file in the autoexp.dat file coming with your Visual Studio

    install.

    Now you should be ready to use STLport.

    ============

    Known issues

    ============

    1. InterlockedIncrement

    If you experiment trouble with the InterlockedIncrement Win32 API function

    like the following message:

    C:Program FilesMicrosoft SDKInclude.winbase.h(1392) : error C2733: second C

    linkage of overloaded function 'InterlockedIncrement' not allowed

    C:Program FilesMicrosoft SDKInclude.winbase.h(1390) : see declaration of

    'InterlockedIncrement'

    It means that you are using the new Microsoft platform SDK. There is no

    way to known it from STLport code so you have to signal it in the 

    stlport/stl/config/user_config.h file (uncomment _STLP_NEW_PLATFORM_SDK in this file).

    2. Native C/C++ library headers location

    If you experiment trouble with location of ctime and other Standard headers

    while building or using STLport you might be using the compiler coming with a

    platform SDK. If so please uncomment _STLP_USING_PLATFORM_SDK_COMPILER in

    stlport/stl/config/user_config.h. If it still do not find native headers you will

    perhaps need to change native headers relative path used by STLport. In this case use

    _STLP_NATIVE_INCLUDE_PATH and associated macro in stlport/stl/config/host.h.

    4. C symbols in std namespace

    The compiler of MSVC++ 6 has a bug when dealing with symbols existant in both

    the global namespace and symbols imported by a using-directive or a 

    using-declaration - it will report an ambiguous call to an overloaded

    function (error C2668). Example:

    void function();

    namespace ns {

       void function();

       // or:

       // using ::function;

    }

    using ns::function;

    // or:

    // using namespace ns;

    void call() {

       function();

    }

    Since we anticipate that using-declarations or even using-directives are common

    use, STLport by default doesn't import or wrap functions that exist in both the

    global namespace and namespace std, in particular those are functions with C 

    origin like fopen() or abs(). Also, it defines additional overloads for

    functions like abs() (overloaded for int, long, float, double, long double) in

    the global namespace.

    In order to make STLport include them in the std namespace, you can define the

    _STLP_DO_IMPORT_CSTD_FUNCTIONS macro. Doing so, you will have to explicitely 

    scope all your functions calls like std::abs() though - otherwise you only get

    the global abs(int) from the C library.

    http://blog.csdn.net/lostspeed/article/details/50585249

  • 相关阅读:
    Python 学习 第八篇:函数2(参数、lamdba和函数属性)
    Python 学习 第七篇:函数1(定义、调用和变量的作用域)
    Python 学习 第六篇:迭代和解析
    Python 学习 第四篇:动态类型模型
    物联网环境下数据分析的应用
    Python 学习 第一篇:数据类型(数字,布尔类型,操作符)
    写于2018年底,有点丧
    云计算助力大数据分析
    python中的__init__方法
    load、loads和 dump、dumps的区别
  • 原文地址:https://www.cnblogs.com/findumars/p/5174331.html
Copyright © 2020-2023  润新知