Budi Irawan wrote:
> Hello Malcolm,
>
> It is great to know that you have successfully compiled the library in 
> release build. If you don't mind, would you like to explain more 
> detail your steps? Could you give an example?
>
> I'm still blank about what you did. :)

I'm going to assume you know a  little about wxDev http://wxdsgn.sf.net. 
It has to be wxDev  because it has my "Empty wxWidgets Project" 
template. You could of course just use Dev-Cpp http://www.bloodshed.net 
and create a suitable template yourself after installing one of the many 
other devpaks available. wxDev is better (IMO) because it already comes 
with a complete wxWidgets installation. And once I iron out the bumps 
here, I intend to make a devpak for wxDev so that others can use the 
wxArt2D library without needing to do what I am doing. they simply 
select they devpak through the web update option and install it into 
their distribution.

>     Just to explain what I did
>
>     This is my Windows Vista Home Premium computer.
>
>     For each library, I used the wxDev-C++ "Static Library" template.
>

Open wxDev, select File - New - Project
In the dialog which appears select Static Library, give the project a 
name (libwxart2d_msw_artbase), browse to a suitable folder 
(C:\wxArt2D\modules\artbase) and save.
The choice of name is important, make  sure it begins with 
lib.........., and try to maintain a constant naming scheme 
libwsart2d_msw_libname for example. This makes a later step much simpler.

>     I added all the source files required by that library.
>
Remove the standard files StaticLib.cpp/h from the project.
Add the source files to the project ("afmatrix.cpp" "artglob.cpp" 
"bbox.cpp" "dcdrawer.cpp" "drawer2d.cpp" "liner.cpp" "mswfont.cpp" 
"polyver.cpp" "stylebase.cpp" ).


>     I added for the compilation  "additional command line options"
>     -fexceptions -fno-pcc-struct-return -fstrict-aliasing -Wall
>     for both C and C++ files.
>
>     Preprocessor definitions were __WXMSW__ __GNUWIN32__ __WIN95__
>

Open the Project Options (Alt+P).

In the dialog select the "Additional Command-line options:" tab.
In the "Compiler" and "C++ Compiler" boxes add "-fexceptions 
-fno-pcc-struct-return -fstrict-aliasing -Wall"
In the "Preprocessor Definitions" box, add "__WXMSW__ __GNUWIN32__ 
__WIN95__"

>     I had to create a new project for each library, after adding the
>     required source files, I added the paths to the headers, built, and
>     continued so until I had a complete library.
>
Select the "Directories" tab, then select the "Include Directories" tab.
Add the following (which may vary dependant upon the project)
C:\wxArt2D\modules\artbase\include
C:\wxArt2D\modules
C:\wxArt2D\include
C:\wxWidgets-2.8.7\src\expat\lib

Select the "Build Options" tab of the project properties.
Change the "Output Directory" to c:\wxart2d\lib\gcc_lib so that we have 
a central location for our libraries. this is important later.
If necessary select the "Override output filename" checkbox,  and give 
the library a sensible name.

With all this setup, it is simply a matter of selecting "Rebuild All" 
(Ctrl+F11) and the library should be generated.

Repeat for each library. You could also create a Template, and reuse 
this template for later libraris,  which removes much of the repetition.

Now it's something similar for the samples, Select File - New - Project, 
choose "Empty wxWidgets Project"  give it a name  and browse to a 
suitable directory, then save.
Add the sample source files, add the above include directories (as above 
in Project Options).
Add the library directory (c:\wxArt2d\lib\lib_gcc) to the Library 
Directories,
Add the wx.rc file to the project (either from your own wxWidgets 
installation or the one that comes with wxDev)
Now in Project Options, select the "Additional Command-line options:" 
tab, add the wxArt2d libraries to the Linker box.

-lwxart2d_msw_aggdrawer.a
-lwxart2d_msw_artbase.a
-lwxart2d_msw_canextobj.a
-lwxart2d_msw_canvas.a
-lwxart2d_msw_curves.a
-lwxart2d_msw_docview.a
-lwxart2d_msw_editor.a
-lwxart2d_msw_gdsio.a
-lwxart2d_msw_general.a
-lwxart2d_msw_keyio.a
-lwxart2d_msw_svgio.a
-lwxart2d_msw_xmlparse.a
-lantigrain
-lkbool

Make sure that these are added at the TOP of the list of libraries. It 
doesn't look (at the moment) that these have a specific order necessary. 
For some samples you also need to addd the -lwxmsw28_stc (the stc 
library) to the list, again make sure that this goes at the top of the 
list. Library order is normally  important using the gcc toolchain.

Click on Ok, then try to compile and run (F9).

If anything breaks (it might need an extra include directory for 
example) or in some cases it needs another library, you might need to 
play around with library order to get the project to link correctly. If 
all is right with the world, then the program should execute.

I think this sums up what I did. If there are any questions I'll be glad 
to answer them.

Best Regards
Mal


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Wxart2d-users_dev mailing list
Wxart2d-users_dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxart2d-users_dev

Reply via email to