Compiling osgcal source code

Source: Internet
Author: User

Http://www.cnkinect.com/thread-15697-1-1.html here himself on the basis of his article re-organized summed up a bit:


1, compile Cal3d, the purpose is to get cal3d_d.lib, Cal3d_d.dll and Cal3d.lib,cal3d.dll, the subsequent compilation osgcal rely on the Cal3d library file (in this case, only the library file, dynamic library is only an appendage).


1.1, Cal3d source access, through SVN access to the latest source code, the latest source download address:
Http://svn.gna.org/svn/cal3d/trunk. The downloaded source file contains the following three folders

1.2, Open the source file under the Cal3d under the Cal3d.sln solution, you can see the inclusion of 12 projects, as shown below


We only need build Cal3d, choose Build menu, select Batch Build, then choose Cal3d Debug and release two options, click on Generate, wait a few minutes, as shown below:


after completion will be generated in the Bin directory Debug and release two folders, two folders are generated several files, the more important is Cal3d_d.lib, Cal3d_d.dll (debug mode) and Cal3d.lib, Cal3d.dll (release mode)


1.3, in the Cal3d directory new lib, include, Bin folder, the Cal3d_d.dll, Cal3d.dll copy to the bin file; Cal3d_d.lib, Copy the Cal3d.lib to the Lib folder, and copy all src files to the Include folder. The preparation for compiling the osgcal here is complete.

2, compile osgcal, compile osgcal is to get OsgCald.dll, OsgCald.lib and OsgCal.dll, OsgCal.lib (behind with D is in debug mode, not with the release mode).


2.1, SVN access to the latest source code, the latest source to obtain the address:

Https://osgcal.svn.sourceforge.NET/svnroot/osgcal/trunk/osgCal


2.2. Open CMake, generate osgcal solution. Drag CMakeLists.txt under the osgcal file to CMake 2.8.7.
Click Configure to select the compiled environment


2.3, the following requirements, configuration parameters.

That's the point. The Include path and LIB files here are almost always manually added to the past.
To explain several important parameters, the other parameters are modified by themselves:


Path to the INCLUDE file for Cal3d_include_dir Cal3d (e:/cal3d/cal3d/include)
Cal3d_library cal3d lib file (e:/cal3d/cal3d/lib/cal3d_d.lib)

The following parameters are automatically configured if the OSG system environment path is set:

Open_threads_include_dir
Include path for openthreads
(d:/osgsdk/openscenegraph-2.8.2/include/openthreads)
Open_threads_libtary
Openthreads's lib Path (D:/osgsdk/openscenegraph-2.8.2/lib/openthreads)
Osg_include_dir
OSG include file path (d:/osgsdk/openscenegraph-2.8.2/include)
Osg_library
Osg lib file (d:/osgsdk/openscenegraph-2.8.2/lib/osg.lib)


2.4, after the configuration of the parameters, the second click Configure.
After determining the error, click Generate, Show configuring done, indicate that the configuration was successful and the solution will be built.
Note: The Include and LIB paths here are consistent with the include and LIB paths of Tools-options-projects and solutions-c++ directories under the Osgcal project. If these include and LIB paths are not added in CMake (provided generating done), it is also possible to add the include and LIB paths in the project. Warnings are allowed in cmake, but there is no error, otherwise the compilation will not go away.


2.5, open the OsgCal.sln solution, Note: Check Tools-options-projectsand solutions-c++ directories the include and Lib path is correct. Build All_build. Wait more than 10 minutes, show 6 succeeded,0 faild (usually debug if wrong), indicating that the compilation was successful.

I encountered an unresolved error at compile time, and I added the Lib dependency Cal3D.lib under the project properties that encountered the problem, and then compiled it successfully.


OSG 3.4.0, some library files have been updated, you need to modify the original file, the first one is gl2extention, it is automatically commented out, you need to be in the corresponding CPP or H to remove the comments. The second one says State. Get**id (), the corresponding format pair (int return value, only need to remove get**id).


2.6, copy OsgCald.dll, osgCal.dll to Bin file, OsgCald.lib, OsgCal.lib copy to Lib folder.
After arduous hardships, finally got the need of OsgCald.dll, OsgCal.dll and OsgCald.lib, OsgCal.lib.


2.7. Configure Osgcal Environment

(1) osgcal the include inside the osgcal into the include (build) that was previously compiled OSG, with some custom compilation files. The corresponding DLL and Lib are also placed in the corresponding translation OSG directory (build) (not Lib will appear unable to open the input file "Osgcal.lib"),

(2) The inclusion of Cald is included in the project, and the Lib library of Cald is included so that the environment variables are not configured. You can start running the example.

Note: Finally, if most of the problems should be the environment configuration problem, I was to use all of the include DLL Lib are put together, including for the compilation of osgcal generated Cal3d dll lib, so that you do not have to set the environment variable path of God's horse

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.