Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

2.8 Compilation Error: CentreOnWindow

(1/3) > >>

wizzard:
When compiling on Arch Linux (wxGTK 2.8) I got the following compilation error:

g++ -DHAVE_CONFIG_H -I. -I../../src/include -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I../../src/include -I../../src/include/wxscintilla/include -I../../src/include/tinyxml -I../../src/include/scripting/include -I../../src/include/scripting/sqplus -I../../src/include/wxFlatNotebook/include -I../../src/include/propgrid/include -Ulinux -Uunix -O2 -ffast-math -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT globals.lo -MD -MP -MF .deps/globals.Tpo -c globals.cpp  -fPIC -DPIC -o .libs/globals.o
globals.cpp: In function 'void PlaceWindow(wxWindow*, cbPlaceDialogMode, bool)':
globals.cpp:875: error: 'class wxWindow' has no member named 'CentreOnScreen'
make[3]: *** [globals.lo] Error 1


commenting out the line allows me to compile & run. I have no idea why it gives that error, I looked up CentreOnScreen in the wxWidgets manual and yes it is a member function...

Biplab:
AFAIK, this function has been deprecated in wx 2.8.

Just replace CentreOnScreen() to
--- Code: ---Centre(wxCENTRE_ON_SCREEN)
--- End code ---

Couple of wx2.8 related patches have been reverted recently which is causing this compilation error. :)

stahta01:
My patch for this was [ Patch #1762 ] CentreOnScreen patch for wxWidgets 2.8

http://developer.berlios.de/patch/?func=detailpatch&patch_id=1762&group_id=5358

What version number of wxWidgets 2.8 has this problem?

Change it to

--- Code: ---Centre(wxBOTH | wxCENTRE_ON_SCREEN)
--- End code ---

Tim S

killerbot:
Thomas has reverted some of those patches. From the explanation he gave me, I think he is correct. A few places didn't need the patch. And for the other places of reversal to work he adjusted globals.cpp


--- Code: ---void PlaceWindow(wxToplevelWindow *w, cbPlaceDialogMode mode, bool enforce)

--- End code ---

PlaceWindows now takes a wxToplevelWindow pointer instead of a wxWindow pointer.

BUT, afb has reverted later on this back to wxWindow*. The commit comments were :

--- Quote ---- didn't compile, wxToplevelWindow -> wxWindow
--- End quote ---

@Afb : what exactly didn't compile ??

At the others, try to build with the PlaceWindow taking the wxToplevelWindow*, and see what happens and report back here if you can.

afb:
Sorry, the compilation problems seem to have been all mine. But it was changed in once place (the source) and not in th other (the header) - as long as it is changed in both it works just fine.

as in: go right ahead and change wxWindow to wxToplevelWindow

Navigation

[0] Message Index

[#] Next page

Go to full version