Autodesk DWF Core Library Documentation

Version 1.2.1

Introduction

The DWF Core Library is a cross-platform utility library that provides common functional classes and interfaces for DWF based application and component developers. This module is the foundation for DWF component development as its classes and interfaces form the shared data definition and functional contracts among other DWF components.

Downloading the Distribution

The latest version can be downloaded at the Autodesk DWF Developer Center . The DWF Core Library is available in both source-only and binary distributions as part of the Autodesk DWF Toolkit. The source code has been built and run on the following hardware, software and development environments:

Building the DWF Core Library

The full source code is available for developers to review and build on a number of different platforms and build development environments. Developers wishing to fine tune the library should review the Build Configuration page.

Microsoft Visual Studio

Developers wishing to fine tune the library for Windows should review the Build Configuration and Microsoft Windows Build Configuration pages.

1. Locate and open the DWFCore.vcproj project file in the folder that matches the desired development environment.

2. Select the build configuration desired.

3. Build the project.

GCC (GNU Compiler Collection)

This section applies for any system using GCC and the GNU Build System (Automake, Autoconf, etc.).

1. Open a shell and locate the build folder:

 cd develop/global/build/gnu/dwfcore 

2. Run the build setup script, this will unpack several required files and reconfigure the GNU Build System:

 ./build_setup.sh 

3. Locate the source folder:

 cd ../../../src/dwfcore/ 

4. Configure the build scripts:

 ./configure 

5. Build the library:

 make 

6. Optionally, install the library and headers on the system (by default, to /usr/local/lib and /usr/local/include, respectively):

 make install 

Note:
1. Make sure you use the source tarball distribution (.tar.gz) instead of the zip source archive (.zip), as tarball distribution (.tar.gz) preserves the permissions correctly.

2. If the build_setup.sh script fails to execute, ensure the permissions are correct:

 chmod +x build_setup.sh 

3. By default, a full debug configuration is generated. To configure an optimized build:

 ./configure --enable-optimized 

4. By default, the core library will be dependent on the version of libz installed on the system. The library contains libz source code and can be built with no such external dependency:

 ./configure --without-zlib 

5. If libz is built into the core library, client applications must define the DWFCORE_BUILD_ZLIB macro.

6. All of the normal GNU Build System rules still apply, for full details:

 ./configure --help 

Apple XCode

1. Locate and open the DWFCore.xcode project folder that matches the desired development environment.

2. Select the desired build configuration.

3. Build the project.

Using the DWF Core Library

This section outlines how a client application can use the core library.

Using Predefined Macros

The core library makes use of numerous macros for consistent String Handling and Memory Management. It is recommended that client application make use of these as well for maximum portability and compatibility. Sometimes they are required to ensure expected behavior.

Including Header Files

The following path should be used in addition to the include path of the client application build configuration:
 develop/global/src/ 

Microsoft Windows

Currently, the SDK ships with build solutions and project files for Visual Studio .NET 2002, 2003 and 2005 and the binary distribution includes pre-built libraries for all environments (dynamically linking the MSVC runtime libraries). At the time of this release, MSVC 7.1 is used as the default build target; that is, those build products will be placed in the top level folder for the build configuration:

develop/global/bin/debug/dwfcore.1.2.1.dll
develop/global/lib/static/release/dwfcore.1.2.1.lib

Visual Studio 2002 and 2005 will deploy their build targets into subfolders indicating their source:

develop/global/bin/debug/vc7.0/dwfcore.1.2.1.dll
develop/global/lib/static/release/vc8.0/dwfcore.1.2.1.lib

A future release may alter this deployment hierarchy by deprecating the current development environment into a vc7.1 subfolder and promoting the MSVC 8.0 build products to the top level, for example.

Static Linking

The following path(s) should be added to the library search path of the client application project file:
 develop/global/lib/static/[debug|release]/ 

Note:
When linking statically, the client application must define the DWFCORE_STATIC pre-processor macro.

Dynamic Linking

The following path(s) should be added to the library search path of the client application project file:
 develop/global/lib/shared/[debug|release]/ 

The dynamic link libraries are located at the following location:

 develop/global/bin/[debug|release]/ 

Note:
Be sure to copy dwfcore.1.2.1.dll to a location where the client application can find it at run time.
See the Microsoft Visual Studio section of the Samples page for more details.

GNU/Linux

The binary distribution contains pre-built shared and static libraries that have been copied to the above directory structure. The GNU build process does not deploy the libraries to this hierarchy, rather make will leave the libraries in:

 develop/global/src/dwfcore/.libs 

and make install will deploy the libraries to the installation path specified to configure, the default location is:

 /usr/local/lib/dwfcore 

Static Linking

When statically linking, simply add libdwfcore.a to the list of input files. There may still be other dependencies depending on the functions of the library that are used and if the core library was customized with zlib built-in. Ignoring the latter, it is usually safest to link in libz and pthreads to ensure no unresolved symbols. For example, the Threads sample can be built as follows:
g++ -I../../../develop/global/src/ -I/usr/include Threads.cpp ../../../develop/global/src/dwfcore/.libs/libdwfcore.a -lpthread -o threads

Note:
Static linking requires explicitly linking in dependent libraries (libz and/or pthreads).

On platforms that use the GNU Build System, there is no need to define the DWFCORE_STATIC pre-processor macro.

Dynamic Linking

When dynamically linking, the library (and standard soft links) must be in the ld cache. Please refer to the ldconfig man page for more details. After the library and headers have been installed, it can be referenced just as any other system library. For example, the Threads sample can be built as follows:
g++ Threads.cpp -ldwfcore -o threads

Note:
Dynamically linking the shared library automatically determines the dependencies on other shared libaries, no explicit linkage is required at build time:
        [dwf@dwfhat Threads]$ ldd threads
            libdwfcore-1.2.1.so => /usr/local/lib/libdwfcore-1.2.1.so (0x006cd000)
            libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x00d59000)
            libm.so.6 => /lib/tls/libm.so.6 (0x00cb4000)
            libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0033e000)
            libc.so.6 => /lib/tls/libc.so.6 (0x0048e000)
            libz.so.1 => /usr/lib/libz.so.1 (0x00ff0000)
            libuuid.so.1 => /lib/libuuid.so.1 (0x00fe9000)
            libpthread.so.0 => /lib/tls/libpthread.so.0 (0x00bcd000)
            /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00410000)
See the GCC (GNU Compiler Collection) section of the Samples page for more details.

OS X

The binary distribution contains pre-built dylibs, static libraries and Carbon Frameworks that have been copied to the above directory structure. The GNU build process does not deploy the libraries to this hierarchy, rather make will leave the libraries in:

 develop/global/src/dwfcore/.libs 
Likewise, the XCode project configurations build to:
 [Development] develop/global/lib/debug and [Deployment] develop/global/lib/release 

Static Linking

Using gcc directly from the shell is exactly the same as noted in the GNU/Linux Static Linking section.

Using XCode, add the static library to the Frameworks and Libraries group of the build target.

Framework

When using the DWFCore.framework, add the appropriate bundle to the Frameworks and Libraries group of the build target.

See the Apple XCode section of the Samples page for more details.


Generated on Tue Jan 6 22:39:28 2009 for Autodesk DWF Core Library by  doxygen 1.4.5