Differences between revisions 47 and 48
Revision 47 as of 2009-06-22 20:59:27
Size: 13481
Editor: dslb-084-058-105-052
Comment: Fix typo.
Revision 48 as of 2009-06-23 13:18:15
Size: 13920
Comment:
Deletions are marked like this. Additions are marked like this.
Line 207: Line 207:
Line 209: Line 210:
The option to generate package scripts is: WXART2D-USE_PACK. <<BR>> Calling the Cmake tool:<<BR>> '''cpack.exe -C debug''' or '''cpack.exe -C release''' <<BR>> on the command line, will result in files like:

 * wxart2d-1.0.1-win32.exe # this is the installers script for wxArt2D on windows.
 * wxart2d-1.0.1-win32.zip # contains the same, and can be installed by hand
The wxArt2D CMake option to generate package scripts is: WXART2D-USE_PACK. <<BR>>
Calling the Cmake tool:<<BR>> '''cpack.exe -C debug''' or '''cpack.exe -C release''' <<BR>>
on the command line, will result in files like:

 * wxart2d-d-1.0.1-win32.exe # this is the installers script for wxArt2D on windows.
 * wxart2d-d-1.0.1-win32.zip # contains the same, and can be installed by hand
 * wxart2d-dev-d-1.0.1-win32.exe # this is the installers script for wxArt2D on windows.
 * wxart2d-dev-d-1.0.1-win32.zip # contains the same, and can be installed by hand

The command: '''cpack.exe -C debug''' is to be used in a debug builds, and search for debug libraries.
The command: '''cpack.exe -C release''' is to be used in a release build, and search for release libraries.
Line 217: Line 225:
  * wxart2d-1.0.1-Linux.sh
  * wxart2d-1.0.1-Linux.tar.gz
  * wxart2d-1.0.1-Linux.tar.Z
  * wxart2d-1.0.1-Linux.tar.bz2
  * wxart2d-dev-d-1.0.1-Linux.sh
  * wxart2d-dev-d-1.0.1-Linux.tar.gz
  * wxart2d-dev-d-1.0.1-Linux.tar.Z
  * wxart2d-dev-d-1.0.1-Linux.tar.bz2

Specific Toolkits/OS

After reading all down here to get the general idea of what to do, you can go to the next topics to read more on your specific situation.

CodeBlocks with MinGW non unix fashion

With Mingw non Unix fashion

With Mingw/Msys Unix fashion

Eclipse using Wascana and Mingw

Unbuntu install from the command line

Download and Installation of wxArt2D

General Approach

The general approach to get the wxArt2D library and its demos running is:

  • Download tools and sources
  • Configure and build wxWidgets
  • Configure and build wxArt2D
  • Focus on your own application

Due to things being a little complex, it's not unusual to have some problem in between. You might want to take a look at the common issues.

In this documentation there might be a certain bias towards MS Windows (MSW) systems with Visual Studio. However, wxArt2D is known to work with Cygwin and natively on Linux as well. See Working platform and tool sets for more.

Download Tools and Sources

Being able to be built on different platforms, wxArt2D requires more than just its own sources.

  • Get wxWidgets, wxWidgets

    • Latest released version is 2.8.8. From here on, it is assumed you use version 2.8.8, not an older version. The development branch 2.9.0 is not yet supported (there are incompatibilities).
  • Get a CVS client, e.g. TortoiseCVS WinCvs

  • Get CMake, version 2.6 or newer, CMake

    • wxArt2D uses CMake as its build system. It will generate makefiles & project-files using template files present in wxArt2d folders.

  • Get wxArt2D by CVS
    • Choose a home for your wxArt2D installation, on MSW e.g. D:\
    • From console run cvs -z3 -d:pserver:anonymous@wxart2d.cvs.sourceforge.net:/cvsroot/wxart2d co -P wxArt2D

    • Now you should have e.g. D:\wxArt2D.
    • No, there is no zip-file or msi-installer. Though wxart2d is well maintained, there are no releases, yet.
    • To get the latest wxArt2D sources, just rerun the cvs command anytime.
  • Features not provided by wxWidgets, but required by wxArt2D are embedded in wxArt2d\thirdparty folder to make the compile process easier (however you can still configure wxArt2d so that they are not used).

Now you have the tools and sources needed to build wxArt2D.

Configure and build wxWidgets

wxWidgets and wxArt2D need to be made with matching configurations.

Especially the contributed scintilla library from wxWidgets is needed. Therefore you need to compile in the contrib directory the stc lib. Path to it looks like wxWidgets-2.8.x\contrib\build\stc, with "x" being your actual wxWidgets version.

You must also set USE_GDIPLUS = 1 in %WXWIN%/build/msw/config.vc, in order to use GdiPlus based drawing. With nmake you can also specify this as extra parameter on the commandline.

  • For introduction and details on how to configure or build wxWidgets on your system at all, please refer to the extensive wxWidgets documentation (offline and online)
    • But use nmake from within a DOS box, to compile wxWidgets in order to have it generate build.cfg. Project files are not oke.
    • VC command line tools, requires running vcvars32.bat, which is found in Visual Studio installation its: VC\bin directory. There also a menu for Visual studio, which start a commandline window ready to go.
    • For the debug version: nmake -f makefile.vc BUILD=debug

    • For the release version: nmake -f makefile.vc BUILD=release

    • On Unix debug version: ./configure --enable-debug --enable-debug-gdb --disable-shared
    • On Unix release version: ./configure --disable-shared
  • If you intend to use e.g. static CRT, unicode, or wxWidgets using STL, be prepared for additional, matching changes in wxArt2D and your application.
  • Build wxWidgets itself.
  • Build wxWidgets contributions, stc (scintilla library) is required, LUA is optional
    • Configure and build them identically to wxWidgets itself (repeat the steps above).
    • stc (see above) is required for wxArt2D.
    • Optional is wxLua, which is used in some modules and samples of wxArt2D. So you can configure and compile wxArt2d without it. In case you have wxLua installed and compiled, wxArt2d's CMake configure script finds wxLua by setting the environment variable WXLUA on windows. When using wxLua, also wxStEdit is required, see wxCode project. WXSTEDIT should be set to its root, in order for CMake to find it.

Now you have a functional wxWidgets library, including some contribs. Ideally you have verified on some wxWidgets demo, that everything is running well.

Configure and build wxArt2D

The building process of wxArt2D relies on CMake generated makefiles resp. project files. See CMake for a more detailed explanation.

Once your project files or else makefiles are generated, wxArt2D should build without trouble.

Generating wxArt2D Documentation

WxArt2D uses doxygen to generate API documentation straight from the source code. Doxygen again itself uses graphviz to generate graphs of classes. The rest of the documentatio is in this wiki.

In earlier days DocBook was used to generate the general documentation.

For the doxygen documentation there is the option BUILD_DOCUMENTATION in CMakeSetup.

Make sure doxygen and the graphviz its dot tool is in your path variable. You can also set DOT_PATH in doxygen.doxy.

The generated doxygen docs are linked to from within this twiki, like classes. So that makes it easier to read.

Doxygen Docs on This Site

Focus on your own Application

You might want to use CMake or DialogBlocks to automate make file and project file generetion. For details see How do I setup my own application.

Common Issues

Static CRT

The CMake scripts do not fully support the use of static C run time libraries. They always use the compiler switches /MDd resp. /MD, instead of the then needed /MTd resp. /MT. To get around this, you need to manually modify the CMake lines for the C++-flags and C-flags before you generate the makefiles. These lines are usually hidden, activate "show advanced values". The names you look for start with CMAKE_CXX_FLAGS_ and CMAKE_C_FLAGS_.

Typical error codes show up at link time or at run time, e.g.

LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library

or

STATUS_DLL_NOT_FOUND exception

Remember, these /MTd, /MT, /MDd, /MD flags must be the same throghout wxWidgets, wxArt2D and the rest of your application.

Manifest

Starting with VS2005 manifests are auto generated. Before manual generation was neccessary, so wxWidgets offers a default manifest. Using the auto generated is strongly preferred, unless you know what you do.

In case you get something like

CVTRES : fatal error CVT1100: duplicate resource.  type:MANIFEST, name:1, language:0x0409
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

chances are good, your include files have a wrong order, therefore the wrong rcdef.h gets loaded. The order of includes in your makefile should look like /I.\..\..\lib\vc_lib\mswd /I.\..\..\include. Then the right lib\vc_lib\mswd\wx\msw\rcdef.h gets included, instead of include\wx\msw\rcdefs.h. They differ by (not) defining WX_MSC_FULL_VER, which is used by wx.rc to decide on inclusion of wx's own manifest or not (to rely on the auto generated one).


Dependencies

Freetype

Optional enabled with WXART2D_USE_FREETYPE.

Freetype is use to make text drawing based on truetype fonts possible. These fonts are vector based and can be scaled etc. as most canvas objects available in wxArt2D.

If not available on your system, the code of freetype is available in the wxArt2D/thirdparty/freetype. And it will be included as a target in your project/makefile automatically. The option WXART2D_USE_FREETYPE_INTERNAL is set ON by default on windows, since this makes things easy. Especially when building various wxArt2D flavors (debug, release, shared etc. ), the freetype compiled right in is always oke.

On Unix/Linux, freetype is installed with package: freetype-devel (e.g. on Fedora: yum install freetype-devel ). On windows you can use the following: * Get the library + headers from: http://gnuwin32.sourceforge.net/packages/freetype.htm * tested with the download called: "Complete package, except sources" * This will add a key to your registry, which is searched for by Cmake, if not oke, use next step. * Do set FREETYPE_DIR in your environment to the location where you installed the above.

Agg

Optional enabled with WXART2D_USE_AGGDRAWER.

Agg is a vector drawing library, with sub pixel drawing and alpa blending and what not. The <<Dox{a2dAggDrawer)>> uses Agg internal to do more advanced drawing compared to wxDC drawing.

If not available on your system, Agg is available in wxArt2D/thirdparty/agg2, and it will be included as a target in your project/makefile automatically. Also headers will be installed along with wxArtd2D its headers. So this is the easy way, but feel free to get Agg and compile and install it.

Get it from here:
http://sourceforge.net/projects/agg

Using SVN that is:
svn co https://agg.svn.sourceforge.net/svnroot/agg agg

You will find out that it is using Cmake, and its cmake_install.html explains how to compile and install it. It is more or less the same approach as wxArt2d, since i wrote the cmake stuff for it ;-)

wxArt2D with wxLua and wxStEdit

Some modules are default not compiled, since they depend on third party libraries. One of them is wxLua to be used as scripting language. As scripting language within wxArt2D, wxLua is currently available. wxLua itself needs wxStEdit, so you need to get wxLua and wxStEdit compiled for your system. On windows make sure you have the following environment variables set, before starting CmakeSetup.exe to generate your project files. First you build wxStEdit and Next wxLua, both in all flavors you need.

I assume the following are set:

SET WXSTEDIT=c:\soft\art2d\wxstedit
SET WXLUA=c:\soft\art2d\wxLua
SET WXWIN=c:\soft\wxWidgest-2.8.8

Just check on your MDOS command line with:

echo %WXLUA%
echo %WXSTEDIT%
echo %WXWIN%

cd %WXSTEDIT%\build
#for debug
nmake -f makefile.vc WX_DEBUG=1
#for release
nmake -f makefile.vc WX_DEBUG=0

cd %WXLUA%\build
#for debug
nmake -f makefile.vc BUILD=debug
#for release
nmake -f makefile.vc BUILD=release

This should give you all the libraries for wxLua and wxStEdit in debug and release mode. Now you start CmakeSetup.exe and enable the option WXART2D_USE_LUA to be ON. The project files wxArt2D.sln, now gets extra targets and samples using wxlua.

P.S. for the moment gdiplus.lib is not used by wxLua, and so WXART2d_USE_GDIPLUSDRAWER is only possible if you add by hand gdiplus.lib to the wxLua makefile.vc files. That is in %WXLUA%\apps\build\msw\makefile.vc, just add it where you see *.lib files.

On Unix you need to set the same variable on your shell command line.

I assume:

export WXSTEDIT=/home/myhome/art2d/wxstedit
export WXLUA=/home/myhome/art2d/wxLua
export WXWIN=/home/myhome/art2d/wxWidgest-2.8.8

Use: this to compile and install for wxstedit and wxlua.

./configure (right option see ./configure --help)
make
make install

Next configure wxArt2D and compile:

export WXART2D=/home/myhome/art2d/wxArt2D
cd $WXART2D
cd ..
mkdir buildArt2dWithWxLua
cd buildArt2dWithWxLua
ccmake ../wxArt2D
make


Packaging

Cmake offers ways to generate installation packages. For windows the http://nsis.sourceforge.net is used for a full automatix installer executable. But also a zip file is generated. The first adds a register key like this:
[HKEY_LOCAL_MACHINE\SOFTWARE\wxArt2D\wxart2d 1.0.1]
This KEY is used to detect wxArt2D in FindwxArt2D.cmake, if you use the zip file, you will need to set WXART2D_DIR in your environment to reach the same.

The wxArt2D CMake option to generate package scripts is: WXART2D-USE_PACK.
Calling the Cmake tool:
cpack.exe -C debug or cpack.exe -C release
on the command line, will result in files like:

  • wxart2d-d-1.0.1-win32.exe # this is the installers script for wxArt2D on windows.
  • wxart2d-d-1.0.1-win32.zip # contains the same, and can be installed by hand
  • wxart2d-dev-d-1.0.1-win32.exe # this is the installers script for wxArt2D on windows.
  • wxart2d-dev-d-1.0.1-win32.zip # contains the same, and can be installed by hand

The command: cpack.exe -C debug is to be used in a debug builds, and search for debug libraries. The command: cpack.exe -C release is to be used in a release build, and search for release libraries.

On unix you type:

  • cpack -C debug on the command line, and this gives you files like:
    • wxart2d-dev-d-1.0.1-Linux.sh
    • wxart2d-dev-d-1.0.1-Linux.tar.gz
    • wxart2d-dev-d-1.0.1-Linux.tar.Z
    • wxart2d-dev-d-1.0.1-Linux.tar.bz2

For generating the packages you will need to install the next two program:

Understanding how and where things are installed on Unix/Linux is here: http://www.gnu.org/prep/standards/standards.html#Directory-Variables

wxArt2D: WxArt2dInstall (last edited 2016-04-30 06:23:23 by ip5657d226)