Bringing up wxWidgets to work with Code::Blocks Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
CrazyK
Earned a small fee
Earned a small fee
Posts: 11
Joined: Thu Jul 20, 2006 7:31 pm

Bringing up wxWidgets to work with Code::Blocks

Post by CrazyK »

Hi @ all,

maybe some of you can help me. I try to get wxWidgets work with code::blocks or the other way around. Now I have some problems compiling a minimal code.

First some facts:
Code::Blocks Studio 1 RC2
wxWidgets 2.6.3 compiled as monolithic, unicode using msys and configure
MinGW

I think the main problem is setting up the build-options. At the moment I set up the following:
Under build options:

other options:

Code: Select all

-mthreads
-Wundef
-wno-ctor-dtor-privacy
-fno-strict-aliasing
defines:

Code: Select all

__GNUWIN32__
__WXMSW__
WXUSINGDLL
wxUSE_UNICODE
USE_PCH
link libraries:

Code: Select all

wxmsw26u
mwindows
other linker options:

Code: Select all

-mthreads -Wl -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32
compiler directories:

Code: Select all

C:\wxWidgets-2.6.3\include
C:\wxWidgets-2.6.3\contrib\include
C:\wxWidgets-2.6.3\include\wx\msw
C:\wxWidgets-2.6.3\lib\wx\include\msw-unicode-release-2.6
linker directories:

Code: Select all

C:\wxWidgets-2.6.3\lib
resource compiler directories

Code: Select all

C:\wxWidgets-2.6.3\include
I think the Problem is, that I don't understand the logik behind this settings. Maybe somebody can tell me or post a link where I can learn it.

The compiler output trying to compile the file is:

Code: Select all

Project   : wxWidgets application
Compiler  : GNU GCC Compiler (called directly)
Directory : C:\Dokumente und Einstellungen\mw\Eigene Dateien\Code--Projekts\QStepLauncher\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: main.cpp
In file included from C:/MinGW/include/windows.h:75,
                 from C:/wxWidgets-2.6.3/include/wx/msw/wrapwin.h:51,
                 from C:/wxWidgets-2.6.3/include/wx/msw/private.h:17,
                 from C:/wxWidgets-2.6.3/include/wx/filefn.h:173,
                 from C:/wxWidgets-2.6.3/include/wx/utils.h:32,
                 from C:/wxWidgets-2.6.3/include/wx/cursor.h:37,
                 from C:/wxWidgets-2.6.3/include/wx/event.h:32,
                 from C:/wxWidgets-2.6.3/include/wx/wx.h:23,
                 from main.h:11,
                 from main.cpp:1:
C:/wxWidgets-2.6.3/include/wx/msw/dde.h:104: `wxDDEConnectionList' declared as 
   an `inline' field
C:/wxWidgets-2.6.3/include/wx/msw/dde.h:104: parse error before `&' token
C:/wxWidgets-2.6.3/include/wx/msw/dde.h:109: semicolon missing after 
   declaration of `wxDDEServer'
C:/wxWidgets-2.6.3/include/wx/msw/dde.h: In member function `wxString& 
   wxDDEServer::GetServiceName() const':
C:/wxWidgets-2.6.3/include/wx/msw/dde.h:103: `m_serviceName' undeclared (first 
   use this function)
C:/wxWidgets-2.6.3/include/wx/msw/dde.h:103: (Each undeclared identifier is 
   reported only once for each function it appears in.)
C:/wxWidgets-2.6.3/include/wx/msw/dde.h: At global scope:
C:/wxWidgets-2.6.3/include/wx/msw/dde.h:109: parse error before `:' token
C:/wxWidgets-2.6.3/include/wx/msw/dde.h:111: `wxString m_serviceName' used 
   prior to declaration
C:/wxWidgets-2.6.3/include/wx/msw/dde.h:112: 'wxDDEConnectionList' is used as a 
   type, but is not defined as a type.
C:/wxWidgets-2.6.3/include/wx/msw/dde.h:113: parse error before `}' token
C:/wxWidgets-2.6.3/include/wx/msw/dde.h:134: `wxDDEConnectionList' declared as 
   an `inline' field
C:/wxWidgets-2.6.3/include/wx/msw/dde.h:134: parse error before `&' token
C:/wxWidgets-2.6.3/include/wx/msw/dde.h:139: semicolon missing after 
   declaration of `wxDDEClient'
C:/wxWidgets-2.6.3/include/wx/msw/dde.h:141: 'wxDDEConnectionList' is used as a 
   type, but is not defined as a type.
C:/wxWidgets-2.6.3/include/wx/msw/dde.h:142: parse error before `}' token
main.cpp: In constructor `MyFrame::MyFrame(wxFrame*, const wxString&)':
main.cpp:24: call of overloaded `wxMenu(const char[1])' is ambiguous
C:/wxWidgets-2.6.3/include/wx/msw/menu.h:122: candidates are: 
   wxMenu::wxMenu(const wxMenu&) <near match>
C:/wxWidgets-2.6.3/include/wx/msw/menu.h:59:                 
   wxMenu::wxMenu(long int = 0) <near match>
C:/wxWidgets-2.6.3/include/wx/msw/menu.h:57:                 
   wxMenu::wxMenu(const wxString&, long int = 0) <near match>
main.cpp:28: call of overloaded `wxMenu(const char[1])' is ambiguous
C:/wxWidgets-2.6.3/include/wx/msw/menu.h:122: candidates are: 
   wxMenu::wxMenu(const wxMenu&) <near match>
C:/wxWidgets-2.6.3/include/wx/msw/menu.h:59:                 
   wxMenu::wxMenu(long int = 0) <near match>
C:/wxWidgets-2.6.3/include/wx/msw/menu.h:57:                 
   wxMenu::wxMenu(const wxString&, long int = 0) <near match>
mingw32-g++.exe: unrecognized option `-wno-ctor-dtor-privacy'
Process terminated with status 1 (0 minutes, 8 seconds)
22 errors, 0 warnings

Thanks for all help!

so far
CrazyK
Peer Sommerlund
Knows some wx things
Knows some wx things
Posts: 43
Joined: Tue Jun 13, 2006 7:21 am
Location: Denmark
Contact:

Re: Bringing up wxWidgets to work with Code::Blocks

Post by Peer Sommerlund »

Uhm, I'm not an expert, but the message "m_serviceName undeclared" seems to indicate that the wxWidgets-2.6.3/include/wx/msw/dde.h has some problem.

I don't have the source code at hand, but try to take a look at lines 103 and 111 in dde.h and see if you can figure out what went wrong.


your main.cpp has some problem at line 24 and 28, which a wxString() constructor may be able to solve.


A quick google hints that the option -wno-ctor-dtor-privacy should have a capital W: -Wno-ctor-dtor-privacy
benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Post by benedicte »

Are you trying to compile the "minimal" sample delivered with wxWidgets sources?
You can also try to compile the other samples, and base your work on the one matching what you want to do.
Peer Sommerlund
Knows some wx things
Knows some wx things
Posts: 43
Joined: Tue Jun 13, 2006 7:21 am
Location: Denmark
Contact:

Post by Peer Sommerlund »

Your compiler directories should not include C:\wxWidgets-2.6.3\include\wx\msw - these files are automatically used when you include C:\wxWidgets-2.6.3\include and define __WXMSW__
alexcoppo
Knows some wx things
Knows some wx things
Posts: 37
Joined: Mon Sep 06, 2004 8:56 am
Location: Italy
Contact:

Re: Bringing up wxWidgets to work with Code::Blocks

Post by alexcoppo »

CrazyK wrote: Code::Blocks Studio 1 RC2
Delete RC2 and get the nightly builds http://forums.codeblocks.org/index.php?board=20.0.

Nightlies are enormously more advanced than RC2 (which dates oct 25, 2005) and are most times rock solid.

Bye!!!!
CrazyK
Earned a small fee
Earned a small fee
Posts: 11
Joined: Thu Jul 20, 2006 7:31 pm

Post by CrazyK »

Hi.. thanks very much for help..

now I solved the Problem.. I compiled wxWidgets again. This time without using MSYS but instead I used ming32-make and build a MONOLITHIC dll.
With this, I don't have any problems using the Code::Blocks - template wxWidgets. All I have to do is to change the custom variable WX_DIR.

Thanks again for help.

so far
Crazy K
Post Reply