My environment: Windows XP, MSVC6.0 SP5 STLPORT4.6.2, OSG0.9.6
Step 1: Set the environment variable. Additional bin directories (such as E: /OSG/OSG_OP_OP_OT 0.9.6-2/bin) in the environment variable -> system variables. In environment variables -> New variables in user variables osginclude, value: E: /OSG/Opsg_op_ot-0.9.6-2/Openscenegraph 0.9.6-2/include; New Variable OSGlib, value: E: / OSGO / SG_OP_OT-0.9.6-2 / OpenSceneGraph-0.9.6-2 / lib; New Variables stllib, value: C: / Program Files / Microsoft Visual Studio / VC98 / STLPORT-4.6.2 / LIB.
Step 2: Configure STL. Copy (such as C: / Program Files / STLPORT_VC6.LIB) stlport_vc6.lib in the Stlport Lib library to the VC library (such as C: / Program Files / Microsoft Visual Studio) VC98 / LIB) (Note: Under normal circumstances, copy stlport_vc6.lib is OK, but different example has different requirements, there may also require other STL LIB files, you can add or directly in the project as needed) . Then copy the two DLL files in the Stlport lib library to copy to the bin of OpenScenegraph (hereinafter referred to as OSG) (such as E: /OSG/OpsG_OP_OT-0.9.6-2/oPenscenegraph-0.9.6- 2 / bin). Open C: / Program Files / Microsoft Visual Studio / VC98 / STLPORT-4.6.2 / STLPORT / STL_USER_CONFIG.H, in the 59th line, the // #define _stlp_no_new_iostreams 1 comment removed (the STL version of MSVC6.0 is too low, so The purpose of using SGI is the purpose of removing the annotation is to block the Iostream of MSVC6.0. Finally, open OSG About VC6.0 project file Visualstudio.dsw (e.g., E: /OSG/OSG_OP_OT 0.9.6-2/VisualScenegraph 0.9.6-2/visualstudio/visualstudio.dsw), in Tools -> Options -> Directories -> Directories: Add a C: / Program Files / Microsoft Visual Studio / VC98 / STLPORT-4.6.2 / STLPORT and placed it in the first position.
Step 3: Compile OSG OpenThreads. Open OpenThreads' project files (such as E: /OSG/Osp_op_ot 0.9.2DEV3-OPENTHREADS-V1.2DEV3-OPENTHREADS.DSW). Bring 26 of Win32thread.cpp under this project file, comment, compile link, build 2 DLL files OpenThreadswin32D.dll and OpenThreadswin32.dll in the bin directory of OpenThreads, Generates 2 lib files, OpenThreadswin32d.lib, OpenThreadswin32.lib, OpenThreadswin32.lib, OpenThreadswin32.lib, OpenThreadswin32.lib, OpenThreadswin32.lib, OpenThreadswin32.lib, OpenThreadswin32.lib, OpenThreadswin32.lib, OpenThreadswin32.lib, OpenThreadswin32.lib, OpenThreadswin32.lib, OpenThreadswin32.lib, OpenThreadswin32.lib, OpenThreadswin32.lib, OpenThreadswin32.lib, OpenThreadswin32.lib, OpenTHReadswin32.lib. Step 4: Compile OSG's Producter. Open the project files of Producter, Product file, produce.dsw (such as E: OSGOSG_OP_OT-0.9.6-2Producer-0.8.4-2VC 6.0Producer.dsw), do the following settings:
In the Project -> Settings -> C / C -> Category option drop-down menu, select "Preprocessor" Add: E: /OSG/OSG_OP_OT-0.9.6-2openthreads-v1.2dev3-osg0.9.6/include
In the Project -> Settings -> Link -> Category drop-down menu Select "Input", in Additional Library Path: Add E: /OSG/OSG_OP_OT 0.9.6-2/OpenThreads-v1.2dev3-osg0.9.6/lib/win32 Note To make the above settings in Release and Debug, then compile the link (Batch Build) to get the results similar to OpenTHReads.
Step 5: Copy of the dependent file: Copy all files under 3rdParty_2003-10-01InClude to the header file directory of the overall program (such as e: /osgosg_op_ot-0.9.6-2/include) Copy all files under 3rdParty_2003-10-01LIB to the library of the entire program (such as E: /OSG/OSG_OP_OT Z.9.6-2/Openscenegraph 0.9.6-2/lib).