Author Topic: Problem with wxWidget  (Read 6121 times)

dragonlady

  • Guest
Problem with wxWidget
« on: October 20, 2008, 07:41:28 pm »
Good afternoon,

I'm having trouble getting a wxWidget project to compile.  I'm just trying to do a basic hello world tutorial.  I downloaded and installed the wxpack and followed the instructions on the wiki page:

http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef#Create_a_wxWidgets_project_in_Code::Blocks

I chose to use the Mingw compilation.

When I try to compile I get these errors:

Quote
||=== test2, Debug ===|
C:\wxWidgets2.8\include\wx\defs.h|771|#error "Unsupported Windows version"|
C:\wxWidgets2.8\include\wx\defs.h|824|error: `wxUint32' does not name a type|
C:\wxWidgets2.8\include\wx\defs.h|1019|#error "error defining ssize_t, size_t is not 4 or 8 bytes"|
C:\wxWidgets2.8\include\wx\defs.h|771|#error "Unsupported Windows version"|
C:\wxWidgets2.8\include\wx\defs.h|824|error: `wxUint32' does not name a type|
C:\wxWidgets2.8\include\wx\defs.h|1019|#error "error defining ssize_t, size_t is not 4 or 8 bytes"|
C:\wxWidgets2.8\include\wx\string.h|181|error: expected init-declarator before "wxStdString"|
C:\wxWidgets2.8\include\wx\string.h|181|error: expected `,' or `;' before "wxStdString"|
C:\wxWidgets2.8\include\wx\string.h|714|error: expected `,' or `...' before '&' token|
C:\wxWidgets2.8\include\wx\string.h|715|error: ISO C++ forbids declaration of `wxStdString' with no type|
C:\wxWidgets2.8\include\wx\string.h|715|error: `wxString::wxString(int)' and `wxString::wxString(int)' cannot be overloaded|
C:\wxWidgets2.8\include\wx\string.h||In constructor `wxString::wxString(int)':|
C:\wxWidgets2.8\include\wx\string.h|715|error: `s' undeclared (first use this function)|
C:\wxWidgets2.8\include\wx\string.h|715|error: (Each undeclared identifier is reported only once for each function it appears in.)|
C:\wxWidgets2.8\include\wx\string.h|181|error: expected init-declarator before "wxStdString"|
C:\wxWidgets2.8\include\wx\string.h|181|error: expected `,' or `;' before "wxStdString"|
C:\wxWidgets2.8\include\wx\string.h|714|error: expected `,' or `...' before '&' token|
C:\wxWidgets2.8\include\wx\string.h|715|error: ISO C++ forbids declaration of `wxStdString' with no type|
C:\wxWidgets2.8\include\wx\string.h|715|error: `wxString::wxString(int)' and `wxString::wxString(int)' cannot be overloaded|
C:\wxWidgets2.8\include\wx\string.h||In constructor `wxString::wxString(int)':|
C:\wxWidgets2.8\include\wx\string.h|715|error: `s' undeclared (first use this function)|
C:\wxWidgets2.8\include\wx\string.h|715|error: (Each undeclared identifier is reported only once for each function it appears in.)|
C:\wxWidgets2.8\include\wx\gdiobj.h|44|error: `WXHANDLE' does not name a type|
C:\wxWidgets2.8\include\wx\msw\gdiimage.h|72|error: `WXHANDLE' does not name a type|
C:\wxWidgets2.8\include\wx\msw\gdiimage.h|73|error: `WXHBITMAP' does not name a type|
C:\wxWidgets2.8\include\wx\msw\gdiimage.h|74|error: `WXHICON' does not name a type|
C:\wxWidgets2.8\include\wx\msw\gdiimage.h|75|error: `WXHCURSOR' does not name a type|
C:\wxWidgets2.8\include\wx\msw\gdiimage.h||In constructor `wxGDIImageRefData::wxGDIImageRefData()':|
C:\wxWidgets2.8\include\wx\msw\gdiimage.h|40|error: `m_handle' undeclared (first use this function)|
C:\wxWidgets2.8\include\wx\msw\gdiimage.h|50|error: `m_handle' undeclared (first use this function)|
C:\wxWidgets2.8\include\wx\msw\gdiimage.h||In member function `bool wxGDIImageRefData::IsOk() const':|
C:\wxWidgets2.8\include\wx\msw\gdiimage.h|54|error: `m_handle' undeclared (first use this function)|
C:\wxWidgets2.8\include\wx\msw\gdiimage.h|152|error: `WXHANDLE' does not name a type|
C:\wxWidgets2.8\include\wx\msw\gdiimage.h|154|error: `WXHANDLE' has not been declared|
C:\wxWidgets2.8\include\wx\msw\gdiimage.h|155|error: ISO C++ forbids declaration of `handle' with no type|
C:\wxWidgets2.8\include\wx\msw\gdiimage.h|177|error: `WXHANDLE' does not name a type|
C:\wxWidgets2.8\include\wx\msw\gdiimage.h||In member function `void wxGDIImage::SetHandle(int)':|
C:\wxWidgets2.8\include\wx\msw\gdiimage.h|155|error: 'class wxGDIImageRefData' has no member named 'm_handle'|
C:\wxWidgets2.8\include\wx\msw\gdiimage.h||In member function `bool wxGDIImage::IsOk() const':|
C:\wxWidgets2.8\include\wx\msw\gdiimage.h|158|error: `GetHandle' undeclared (first use this function)|
C:\wxWidgets2.8\include\wx\msw\cursor.h|36|error: `WXHCURSOR' has not been declared|
C:\wxWidgets2.8\include\wx\msw\cursor.h|36|error: ISO C++ forbids declaration of `cursor' with no type|
C:\wxWidgets2.8\include\wx\msw\cursor.h|37|error: `WXHCURSOR' does not name a type|
C:\wxWidgets2.8\include\wx\msw\cursor.h||In member function `void wxCursor::SetHCURSOR(int)':|
C:\wxWidgets2.8\include\wx\msw\cursor.h|36|error: `WXHANDLE' undeclared (first use this function)|
C:\wxWidgets2.8\include\wx\event.h|988|error: `wxUint32' does not name a type|
C:\wxWidgets2.8\include\wx\event.h|991|error: `wxUint32' does not name a type|
C:\wxWidgets2.8\include\wx\event.h|1067|error: `wxUint32' does not name a type|
C:\wxWidgets2.8\include\wx\event.h|1068|error: `wxUint32' does not name a type|
C:\wxWidgets2.8\include\wx\event.h||In member function `wxKeyEvent& wxKeyEvent::operator=(const wxKeyEvent&)':|
C:\wxWidgets2.8\include\wx\event.h|1036|error: `m_rawCode' undeclared (first use this function)|
C:\wxWidgets2.8\include\wx\event.h|1036|error: 'const class wxKeyEvent' has no member named 'm_rawCode'|
C:\wxWidgets2.8\include\wx\event.h|1037|error: `m_rawFlags' undeclared (first use this function)|
C:\wxWidgets2.8\include\wx\event.h|1037|error: 'const class wxKeyEvent' has no member named 'm_rawFlags'|
C:\wxWidgets2.8\include\wx\msw\icon.h|71|error: `WXHICON' has not been declared|
C:\wxWidgets2.8\include\wx\msw\icon.h|71|error: ISO C++ forbids declaration of `icon' with no type|
C:\wxWidgets2.8\include\wx\msw\icon.h|72|error: `WXHICON' does not name a type|
C:\wxWidgets2.8\include\wx\msw\icon.h||In member function `void wxIcon::SetHICON(int)':|
C:\wxWidgets2.8\include\wx\msw\icon.h|71|error: `WXHANDLE' undeclared (first use this function)|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings ===|
||=== Build finished: 50 errors, 0 warnings ===|


I'm really not sure what the issue is.  I'm using Windows Vista.  I've gone through several unsuccessful attempts to get wxWidget to work over the past few days, with different errors each time (this is my first time trying the wxPack, as when I downloaded it before the files were corrupted).  I've tried to search for the problem unsuccessfully, so I sincerely apologize if this has been addressed and solved already elsewhere; I'm working on only a few hours sleep and thus am probably not thinking the straightest right now  :shock:

Thanks!

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Problem with wxWidget
« Reply #1 on: October 21, 2008, 06:01:56 am »
I'm using Windows Vista.

The problem appears to be compiler related.

What version of MinGW are you using?

I am using gcc version 3.4.5 (mingw-vista special r3)
results of command "gcc -v".

I am guessing that for some strange reason Code::Blocks is trying to run Cygwin gcc instead of MinGW.
Because your error is being caused by wxWidgets not knowing it is running on an windows machine.

I suggest turning on full compiler logging
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Tim S
« Last Edit: October 21, 2008, 06:03:38 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Problem with wxWidget
« Reply #2 on: October 21, 2008, 11:25:20 am »
Quote
C:\wxWidgets2.8\include\wx\defs.h|771|#error "Unsupported Windows version"
Reading helps. :) Looks like you're using not only Vista, but Vista 64 bit.

You will probably have to compile wxWidgets your own with an appropriate switch. The "normal" version is apparently for Win32 only, as it has an #ifdef __WIN32__ ... #else which triggers this exact error.
Please refer to the wxWidgets guys (or consult their manpages) for further help.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."