Problems using wxWidgets 3.0.2 with CodeBlocks 16.1

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.
rdmaia
Earned a small fee
Earned a small fee
Posts: 19
Joined: Mon Feb 29, 2016 6:28 pm

Re: Problems using wxWidgets 3.0.2 with CodeBlocks 16.1

Post by rdmaia »

After the inclusion of my target ambient specific directory ( msw) in the compiler includes list:

c:\wx302\include\wx\msw

the error changed from a link error to a compile error:

-------------- Build: Release in text (compiler: GNU GCC Compiler)---------------

windres.exe -IC:\wx302\include -J rc -O coff -i C:\wx302\samples\sample.rc -o obj\Release\sample.res
g++.exe -Wundef -Wall -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -mthreads -D__WXMSW__ -DWXUSINGDLL -Dwx_FILE_OFFSET_BITS=64 -DWX_PRECOMP -O2 -std=c++11 -IC:\wx302\include\wx\msw -IC:\wx302\include -c C:\wx302\samples\text\text.cpp -o obj\Release\text\text.o

g++.exe -LC:\wx302\libs-dll-rel\lib -o bin\Release\text.exe obj\Release\text\text.o obj\Release\sample.res -s ..\..\..\libs-dll-rel\lib\libwx_mswu_core-3.0.dll.a ..\..\..\libs-dll-rel\lib\libwx_baseu-3.0.dll.a ..\..\..\libs-dll-rel\lib\libwxpng-3.0.a -mwindows
In file included from C:/msys/mingw32/i686-w64-mingw32/include/windows.h:82:0,
from C:\wx302\include/wx/msw/wrapwin.h:65,
from C:\wx302\include/wx/wxprec.h:43,
from C:\wx302\samples\text\text.cpp:11:
C:\wx302\include\wx\msw/dde.h:93:5: error: 'wxDDEConnectionList' does not name a type
wxDDEConnectionList& GetConnections() const
^
C:\wx302\include\wx\msw/dde.h:99:5: error: 'wxDDEConnectionList' does not name a type
wxDDEConnectionList m_connections;
^
C:\wx302\include\wx\msw/dde.h:124:5: error: 'wxDDEConnectionList' does not name a type
wxDDEConnectionList& GetConnections() const
^
C:\wx302\include\wx\msw/dde.h:129:5: error: 'wxDDEConnectionList' does not name a type
wxDDEConnectionList m_connections;
^

Process terminated with status 1 (0 minute(s), 2 second(s))
4 error(s), 0 warning(s) (0 minute(s), 2 second(s))


I searched the includes found in ALL include dirs, (not only "mine"), but the definition of wxDDEConnectionList does not exists at anyone.

Does anybody knows where i can find it?
User avatar
doublemax
Moderator
Moderator
Posts: 19158
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Problems using wxWidgets 3.0.2 with CodeBlocks 16.1

Post by doublemax »

After the inclusion of my target ambient specific directory ( msw) in the compiler includes list:

c:\wx302\include\wx\msw
It must be a configuration specific path, i.e. different for each combination of unicode/ansi, debug/release, static/dynamic etc. Most likely somewhere in the /lib/ path.
Use the source, Luke!
rdmaia
Earned a small fee
Earned a small fee
Posts: 19
Joined: Mon Feb 29, 2016 6:28 pm

Re: Problems using wxWidgets 3.0.2 with CodeBlocks 16.1

Post by rdmaia »

I tried with all directories found at the directory tree from my dll/release path: c:\wx302\libs-dll-rel\...

No changes. Same error: wxDDEConnectionList not found (it doesn't surprises me since i didn't find this symbol at anyone of wxWidgets directory files, and not also at msys and mingw include directories).

I searched at Internet and verified: this is not a new error (or specific from my configuration), and was registered at this forum before:


Where is wxDDEConnectionList defined? - wxWidgets Discussion Forum
viewtopic.php?t=3003
Traduzir esta página
7 de jul de 2005 - 5 postagens
include\wx\msw\dde.h:104: error: `wxDDEConnectionList' declared as an `inline' field ..\..\include\wx\msw\dde.h:104: error: expected `;' before ...
How to compile XRC sample? 21 jun. 2015
error: 'wxDDEConnectionList' does not name a type 2 out. 2014
problem upgrading 21 nov. 2007
error help 23 maio 2007
rdmaia
Earned a small fee
Earned a small fee
Posts: 19
Joined: Mon Feb 29, 2016 6:28 pm

Re: Problems using wxWidgets 3.0.2 with CodeBlocks 16.1

Post by rdmaia »

Solved!


First problem: Execution error

It was originated from unicode use (wxUSE_UNICODE) without the specific target ambient header:

Solution: To include ../../lib/wx/include/msw-unicode-3.0 as first search directory at "Search directories" list


Second problem: wxDDEConnectListing

It was (IS) originated from a missing declaration needed by code inside dde.h file header.

Solution: since i will never use DDE (probably), i inserted a STUB declaration for wxDDEConnectListing inside dde.h file header.
When this problem will be solved later, i'll remove this STUB declaration.



Third problem: erroneous calling of debug code (wxTrap, wxTrapInAssert, ...), at RELEASE build

This is, perhaps, being caused by a setting of an improper #define by wxWidgets default macros.

Solution: To include a wxDEBUG_LEVEL=0 at my projects #defines tab


I saved correct project as a template as advised, and tested it with another sample program, it worked !



:) :) Thanks again, friends, for all support an help. :) :)
User avatar
doublemax
Moderator
Moderator
Posts: 19158
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Problems using wxWidgets 3.0.2 with CodeBlocks 16.1

Post by doublemax »

#2 and #3 should definitely not be necessary, that just means that there is still something broken in your initial setup.
Use the source, Luke!
rdmaia
Earned a small fee
Earned a small fee
Posts: 19
Joined: Mon Feb 29, 2016 6:28 pm

Re: Problems using wxWidgets 3.0.2 with CodeBlocks 16.1

Post by rdmaia »

Perhaps, but at ../include/wx/msw/setup.h we find:

Code: Select all

...
// ----------------------------------------------------------------------------
// debugging settings
// ----------------------------------------------------------------------------

// wxDEBUG_LEVEL will be defined as 1 in wx/debug.h so normally there is no
// need to define it here. You may do it for two reasons: either completely
// disable/compile out the asserts in release version (then do it inside #ifdef
// NDEBUG) or, on the contrary, enable more asserts, including the usually
// disabled ones, in the debug build (then do it inside #ifndef NDEBUG)
//
// #ifdef NDEBUG
//  #define wxDEBUG_LEVEL 0
// #else
//  #define wxDEBUG_LEVEL 2
// #endif
...
...
So, the settings of wxDEBUG_LEVEL are inhibited, and at "../include/wx/debug.h" is coded:

Code: Select all

...
// ----------------------------------------------------------------------------
// Defines controlling the debugging macros
// ----------------------------------------------------------------------------

/*
    wxWidgets can be built with several different levels of debug support
    specified by the value of wxDEBUG_LEVEL constant:

    0:  No assertion macros at all, this should only be used when optimizing
        for resource-constrained systems (typically embedded ones).
    1:  Default level, most of the assertions are enabled.
    2:  Maximal (at least for now): asserts which are "expensive"
        (performance-wise) or only make sense for finding errors in wxWidgets
        itself, as opposed to bugs in applications using it, are also enabled.
 */

// unless wxDEBUG_LEVEL is predefined (by configure or via wx/setup.h under
// Windows), use the default
#if !defined(wxDEBUG_LEVEL)
    #define wxDEBUG_LEVEL 1
#endif // !defined(wxDEBUG_LEVEL)
...
...
So, value of wxDEBUG_LEVEL is been set in debug.h due to commented lines in setup.h

This is not what we need for a Release program.
rdmaia
Earned a small fee
Earned a small fee
Posts: 19
Joined: Mon Feb 29, 2016 6:28 pm

Re: Problems using wxWidgets 3.0.2 with CodeBlocks 16.1

Post by rdmaia »

For DDE problem,

at "C:/msys/mingw32/i686-w64-mingw32/include/windows.h" there is an unconditional include to dde.h

And dde.h itself lacks a declaration for wxDDEConnectListing, an this is not found at any other include in ALL: wxWidgets, mingw32 and msys include directories.

So, if not create a STUB for circumvent the problem, or inhibits dde.h include at windows.h (a very drastic action), what could be the solution for this problem ? None of the include files at include directories available will define wxDDEConnectListing because this definition doesn't exists inside anyone.
Post Reply