ChartDirector for C++ is released as a zip file on Windows, and as a tar.gz file on Linux, FreeBSD, Mac OS X and Solaris. To install ChartDirector for C++:, simply extract the files from distribution.
- On Windows, you may use Winzip or similar tools to unzip the ChartDirector distribution.
- On Linux, FreeBSD, Mac OS X and Solaris, you may use:
gunzip [chartdir_file_name].tar.gz
tar xvf [chartdir_file_name].tar
ChartDirector for C++ comes with three sets of sample programs.
- Command line sample programs are included in "ChartDirector/cppdemo". They are compatible with any standard C++ compiler and work on all supported operating systems.
On the Windows edition of ChartDirector, Microsoft Visual Studio project files are included.
On the Linux, FreeBSD, Mac OS X and Solaris editions of ChartDirector, make files are included. Note that the make files assume the C++ compiler is "g++". You may need to modify the make files if you are using a different compiler.
- On the Windows edition of ChartDirector, MFC based sample programs are included in "ChartDirector\mfcdemo", with complete Microsoft Visual Studio project files. These are Windows programs that only work with the Microsoft Visual Studio C++ compiler.
- QT based sample programs are included in "ChartDirector/qtdemo", with QT ".pro" project files included. Please refer to Using ChartDirector with QT for more information on how to compile these sample programs.
Note : this section is applicable for Windows only.
When you develop a project using ChartDirector, the development environment should be configured appropriately so that it can find the proper header files and link to the proper library files.
- Compilation
All C++ modules that use ChartDirector need to include the file "chartdir.h". The "chartdir.h" will in turn include more header files. All these files are located in the "ChartDirector\include" subdirectory. The development environment header file search path must be configured to include that directory.
- Linking
After compilation, the object file needs to link with "ChartDirector/lib/chartdir50.lib".
- Execution
During execution, the executable would need to find the "chartdir50.dll". You may copy the "chartdir50.dll" to the same directory where the executable runs, or you may copy it to a directory in the operating system search path (eg. [system32]).
Note : this section is applicable for Linux, FreeBSD, Mac OSX and Solaris only.
When you develop a project using ChartDirector, the development environment should be configured appropriately so that it can find the proper header files and link to the proper library files.
- Compilation
All C++ modules that use ChartDirector need to include the file "chartdir.h". The "chartdir.h" will in turn include more header files. All these files are located in the "ChartDirector/include" subdirectory. The compiler must be configured to include that directory in its header file search path. This can be achieved by using the following compiler flag:
-I[Path_Of_ChartDirector_Include_Subdirectory]
If you are using QT, you may edit the QT project file and add the line:
INCLUDEPATH += [Path_Of_ChartDirector_Include_Subdirectory]
- Linking
After compilation, the object file needs to link with "libchartdir.so" (for Linux, FreeBSD and Solaris) or "libchartdir.dylib" (for Mac OS X). This can be achieved by using the following linker flag:
-L[Path_Of_ChartDirector_Lib_Subdirectory] -lchartdir
If you are using QT, you may edit the QT project file and add the line:
LIBS += -L[Path_Of_ChartDirector_Lib_Subdirectory] -lchartdir
- Execution
The ChartDirector shared object and other supporting data files are in the "ChartDirector/lib" subdirectory. To ensure the runtime linker can locate ChartDirector, you may copy *everything* (recursive copy) in "ChartDirector/lib" (including the fonts subdirectories for Linux, FreeBSD and Solaris versions) to "/usr/lib". This is by first changing to the "ChartDirector" directory, then use:
cp -R lib/* /usr/lib
You may also put the "ChartDirector/lib" files in other locations if you build the executable properly. For example, on Linux, FreeBSD and Solaris, you may use the -R linker flag to specify additional paths to search for shared objects. On Mac OS X, you may use the install_name_tool to specify alternative locations for shared objects. Please refer to the documentation of your development tools for details.
Important Note For Solaris g++/gcc
In Solaris, some compilers (such as g++/gcc) requires an assembler (as) and linker (ld) to produce executable code. Solaris comes standard with as/ld in "/usr/ccs/bin". If you do not find as/ld in "/usr/ccs/bin", please install it from the Solaris CD.
There is also an alternative as/ld distributed in the GNU binutils package.
ChartDirector is compiled using the Solaris as/ld. When developing software using ChartDirector, it is suggested you use the Solaris as/ld, not the GNU as/ld.
If you are using g++/gcc on Solaris, and you have the GNU binutils installed, by default, the g++/gcc compiler will use the GNU as/ld. To use the Solaris as/ld, you may uninstall the GNU binutils, or add the flag "-B/usr/ccs/bin/" in your compile and link statements. Simply setting the "path" variable to search for "/usr/ccs/bin" first is not sufficient.
If you have purchased a license to use ChartDirector, you should have a license code delivered to your via email and postal mail.
If your license key is for upgrading from a previous version of ChartDirector, you need to append the upgrade license key to the previous version license key, and use the combined license key.
There are two alternative methods to install the license key.
- Create a one-line ASCII file using Notepad or other text editor, and put the license code in that line. The whole file should contain only the license code. Name that file "chartdir.lic" and put the file in the same directory as "chartdir41.dll" (for Windows) or "libchartdir.so" (for Linux, FreeBSD, Mac OS X and Solaris).
Make sure your license file is called "chartdir.lic". In particular, Notepad may automatically append ".txt" to the file name when creating a new file. So even if the file is saved as "chartdir.lic", it may end up as "chartdir.lic.txt". If this is the case, please rename the file back to "chartdir.lic".
- An alternative method is to hard code the license key into the source code by using the Chart::setLicenseCode API. This method is recommended if your are redistributing ChartDirector, because your customer will then be unable to see the license key (unless your software is open source).
© 2010 Advanced Software Engineering Limited. All rights reserved.