Re: Compiling wxWidgets with wxGraphicsContext under Windows

222 views
Skip to first unread message

Carsten A. Arnholm

unread,
Apr 6, 2009, 3:29:55 PM4/6/09
to wx-u...@lists.wxwidgets.org

Dave Silvia wrote:
> Hello!
>
> If you'd like to have an easy ride building and using wxWidgets on
> Windows, check out anthemion-devtools and/or wxMS_Developers.

An alternative approach which is totally free and which runs on both Windows
and Linux is the Code::Blocks IDE http://www.codeblocks.org/
Code::Blocks is built using wxWidgets and obviously targets wxWidgets
application development. The wxSmith tool rad tool for GUI design is in my
opinion excellent. I have created several applications for windows and linux
this way and it is nice to be able develop on both platforms at the same
time simply by synchronising source and project/workspace files across.

--
Carsten A. Arnholm
http://arnholm.org/
N59.776 E10.457


Ori Lahav

unread,
Apr 6, 2009, 12:48:49 PM4/6/09
to wx-u...@lists.wxwidgets.org
Hello wxUsers,
I'm working on a program, under Linux. I've used wxGraphicsContext for the graphics. In Linux I simply had to download wxWidgets using Synaptic, but in Windows it seems harder (for a compilation newbie (; ).
I managed to compile wxWidgets and its demo apps, but I had no success compiling it with wxGraphicsContext. What are the steps should I do after I download wxWidgets (for compiling it with wxGC)?

Thanks!
Ori.

Dave Silvia

unread,
Apr 6, 2009, 1:18:34 PM4/6/09
to wx-u...@lists.wxwidgets.org
Hello!
 
If you'd like to have an easy ride building and using wxWidgets on Windows, check out anthemion-devtools and/or wxMS_Developers. I do most of my development on Windows, then move to other platforms with my project to do tweaking (if any) for that platform. It's very easy (and, no, this is not a commercial message) because I use DialogBlocks. DialogBlocks is one of the better (imho, best!;) wxWidgets IDE's. It is commercial, but it has a 'free forever' evaluation, i.e., you may use it forever without paying the registration fee. Caveat: limited to 30 dialog elements if not registered and some very minor 'nagging'. DialogBlocks will build wxWidgets libraries for any platform available for wxWidgets. Just set your compiler configuration parameters (property sheet), including destination paths, installation paths, build features (i.e., OpenGL, static or dynamic build and runtime binding, additional include/lib data [paths, names, etc.], and so on]), build tools to use (if different from default), and more.
 
If you only use DialogBlocks to build wxWidgets, you may use it at no charge indefinitely, as with apps with 30 or less elements (which covers most samples/demos). If you find you like it for easy GUI design in general, the registration fee is quite nominal (won't bankrupt you) and registration is good for as many copies of DialogBlocks you need for all platforms you develop on. This is handy because once you've established a complete project with DialogBlocks, it's a simple matter to run the build on other platforms, usually with little or no modification. Most of the time modification is due to level of compiler 'sensitivity', that is, Windows may build with no warnings, but Linux/GCC may have some warnings re: non-standard usage.
 
You can get a copy of DialogBlocks at:
 
 
And Julian Smart, the author/maintainer of DialogBlocks has a group for getting information, reporting bugs, asking advice, and general 'sharing':
 
 
The group is totally open, i.e., you get the same service (2-12 hours to 1 or 2 days) registered or not!;)
 
For your Windows platform, I would suggest getting Visual Studio 2008 Express. It's 'forever free' and affords you an excellent graphic debugger as well as Intellisense to make your hand coding tasks simpler!;)
 
 
fyi & HTH:
 

thx,
Dave S.
 
Development with wxWidgets on MSWindows
http://tech.groups.yahoo.com/group/wxMS_developers/
 
wxWidgets Code Exchange
http://wxcodex.net/

Vadim Zeitlin

unread,
Apr 6, 2009, 5:57:49 PM4/6/09
to wx-u...@lists.wxwidgets.org
On Mon, 6 Apr 2009 19:48:49 +0300 Ori Lahav <vbc...@gmail.com> wrote:

OL> I managed to compile wxWidgets and its demo apps, but I had no success
OL> compiling it with wxGraphicsContext. What are the steps should I do after I
OL> download wxWidgets (for compiling it with wxGC)?

Please see docs/msw/install.txt for instructions. To enable wxGC you need
to edit include/wx/msw/setup.h and set wxUSE_GRAPHICS_CONTEXT to 1 there.
Please do notice that you need to edit this file and not some other setup.h
(there are a few of them).

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

Krishna

unread,
Apr 6, 2009, 1:54:58 PM4/6/09
to wx-u...@lists.wxwidgets.org

Nice blurb!. Even JS (as the author) couldn't have done better ;)

Cheers,
--Krishna

--
I love deadlines. I like the whooshing sound
they make as they fly by.
-- Douglas Adams

Werner Smekal

unread,
Apr 7, 2009, 3:34:36 AM4/7/09
to wx-u...@lists.wxwidgets.org
AFAIK, it only works with Visual C++ in the moment, since the GDI+
header files are not available for MinGW. If you search the internet
you'll find some instructions how to get this working for MinGW, but
I'm not sure about the legal issues here.

Regards,
Werner

On 07.04.2009, at 08:02, Ori Lahav wrote:

> Is it the only change I have to do? I read something about GDI DLL
> or something like that.
> Last time I tried to compile (after changing setup.h
> wxUSE_GRAPHICS_CONTEXT to 1) I had some errors, or it was compiled
> without wxGC.
> Anyway, I'll try again and see how it goes.
>
> Thanks,
> Ori.

> _______________________________________________
> wx-users mailing list
> wx-u...@lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wx-users
>
>
> _______________________________________________
> wx-users mailing list
> wx-u...@lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wx-users

--
Dr. Werner Smekal
Institut fuer Allgemeine Physik
Technische Universitaet Wien
Wiedner Hauptstr 8-10
A-1040 Wien
Austria

email: sme...@iap.tuwien.ac.at
web: http://www.iap.tuwien.ac.at/~smekal
phone: +43-(0)1-58801-13463 (office), +43-(0)1-58801-13469 (laboratory)
fax: +43-(0)1-58801-13499

Dave Silvia

unread,
Apr 6, 2009, 5:10:22 PM4/6/09
to wx-u...@lists.wxwidgets.org
Well, at the risk of starting a holy war...
 
* DialogBlocks is completely built with wxWidgets.
 
* DialogBlocks does not require an outside GUI display element (no wxSmith)
 
* DialogBlocks handles sizers properly.
 
* DialogBlocks is authored and maintained by a 'team' that doesn't change members regularly.
 
* DialogBlocks works for all wxWidgets platforms, not just Windows and Linux (which is actually Visual Studio and GCC in Code::Blocks case, and only the make version of Visual Studio).
 
It's not a fair comparison for Code::Blocks to set it up against DialogBlocks... It just doesn't hold a candle...
 
jmtcw:
 
Dave S.
 
On 4/6/2009 2:29:55 PM, Carsten A. Arnholm (arn...@offline.no) wrote:

> Dave Silvia wrote:
> > Hello!
> >
> > If you'd like to have an easy ride building and using wxWidgets on
> > Windows, check out anthemion-devtools and/or wxMS_Developers.
>
> An alternative approach which is totally free and which runs on both Windows
> and Linux is the Code::Blocks IDE  http://www.codeblocks.org/
> Code::Blocks is built using wxWidgets and obviously targets wxWidgets
> application development. The wxSmith tool rad tool for GUI design is in my
> opinion excellent. I have created several applications for windows and linux
> this way and it is nice to be able develop on both platforms at the same
> time simply by synchronising source and project/workspace files across.
>
> --
> Carsten A. Arnholm
> http://arnholm.org/
> N59.776 E10.457
>
>

kauf...@gmx.net

unread,
Apr 7, 2009, 4:00:51 AM4/7/09
to wx-u...@lists.wxwidgets.org
Hi,

I try to set the back/foreground on a wxToggelButton by calling SetBackgroundColour() and SetForegroundColour() but that does not influence the button.

The funny thing is: that only doesn't works under Windows, with Linux these calls work fine.

Mike


--
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger01

Vadim Zeitlin

unread,
Apr 7, 2009, 6:46:42 AM4/7/09
to wx-u...@lists.wxwidgets.org
On Tue, 07 Apr 2009 10:00:51 +0200 kauf...@gmx.net wrote:

> I try to set the back/foreground on a wxToggelButton by calling
> SetBackgroundColour() and SetForegroundColour() but that does not
> influence the button.
>
> The funny thing is: that only doesn't works under Windows, with Linux
> these calls work fine.

Windows doesn't support changing button colours natively and while we have
some hacks in place to allow this for wxButton this simply wasn't done for
wxToggelButton (yet).

Ori Lahav

unread,
Apr 7, 2009, 3:42:11 AM4/7/09
to wx-u...@lists.wxwidgets.org
Maybe that was my problem. I was compiling with MinGW. I'll try Visual C++.

Ori.

Ori Lahav

unread,
Apr 7, 2009, 2:02:25 AM4/7/09
to wx-u...@lists.wxwidgets.org
Is it the only change I have to do? I read something about GDI DLL or something like that.
Last time I tried to compile (after changing setup.h wxUSE_GRAPHICS_CONTEXT to 1) I had some errors, or it was compiled without wxGC.
Anyway, I'll try again and see how it goes.

Thanks,
Ori.

On Tue, Apr 7, 2009 at 12:57 AM, Vadim Zeitlin <va...@wxwidgets.org> wrote:

Ori Lahav

unread,
Apr 9, 2009, 6:45:11 PM4/9/09
to wx-u...@lists.wxwidgets.org
Compilation went okay and I ran my program in Windows. But after I added some wxGraphicsContext lines I got Linker errors:
wxmsw28d_core.lib(graphics.obj) : error LNK2019: unresolved external symbol _GdipFree@4 referenced in function "public: static void __cdecl Gdiplus::GdiplusBase::operator delete(void *)" (??3GdiplusBase@Gdiplus@@SAXPAX@Z)
wxmsw28d_core.lib(graphics.obj) : error LNK2019: unresolved external symbol _GdipDeletePen@4 referenced in function "public: __thiscall Gdiplus::Pen::~Pen(void)" (??1Pen@Gdiplus@@QAE@XZ)
wxmsw28d_core.lib(graphics.obj) : error LNK2019: unresolved external symbol _GdipAlloc@4 referenced in function "public: static void * __cdecl Gdiplus::GdiplusBase::operator new(unsigned int)" (??2GdiplusBase@Gdiplus@@SAPAXI@Z)
wxmsw28d_core.lib(graphics.obj) : error LNK2019: unresolved external symbol _GdipCreateTexture@12 referenced in function "public: __thiscall Gdiplus::TextureBrush::TextureBrush(class Gdiplus::Image *,enum Gdiplus::WrapMode)" (??0TextureBrush@Gdiplus@@QAE@PAVImage@1@W4WrapMode@1@@Z)
wxmsw28d_core.lib(graphics.obj) : error LNK2019: unresolved external symbol _GdipDeleteBrush@4 referenced in function "public: virtual __thiscall Gdiplus::Brush::~Brush(void)" (??1Brush@Gdiplus@@UAE@XZ)
wxmsw28d_core.lib(graphics.obj) : error LNK2019: unresolved external symbol _GdipCloneBrush@8 referenced in function "public: virtual class Gdiplus::Brush * __thiscall Gdiplus::Brush::Clone(void)const "

And many many more. It seems like a GDI (_GdipFree, _GdipCloneBrush, etc) problem. What is my mistake? Do I have to install anything?

Thanks,
Ori.

Ori Lahav

unread,
Apr 9, 2009, 6:53:49 PM4/9/09
to wx-u...@lists.wxwidgets.org
Fixed! Just had to add "gdiplus.lib" to the linker options.

Thanks everyone for your help! I can finally test my application in Windows.

Ori.
Reply all
Reply to author
Forward
0 new messages