Author Topic: undefined reference to `wxCriticalSection::Enter()' when debug compiling  (Read 6444 times)

Offline GemmaB89

  • Single posting newcomer
  • *
  • Posts: 6
Hi All,

Getting an unhandled exception in my program, so I'm trying to compile a debug version of it, which I've added late as a build target as I was hoping I wouldn't need it. So I've not gone through the project creation wizard that tells you if it finds an appropriate version of wxwidgets

I'm using boost and wxwidgets in the program, so my understanding is I need to compile a debug version of both the boost libraries, and the wxwidget libraries. I'm fairly confident I have the boost libraries working, but I'm getting the error in the title, along with a load of other wx related ones in the build output:

Code
-------------- Build: Debug in sendd (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -LF:\boost\stage\lib_release -LF:\plus\wxWidgets-3.0.2\lib\gcc_dll -o bin\Debug\sendd.exe obj\Debug\gsmencoding.o obj\Debug\hexdump.o obj\Debug\pdu.o obj\Debug\senddApp.o obj\Debug\senddMain.o obj\Debug\smpp.o obj\Debug\smppclient.o obj\Debug\sms.o obj\Debug\timeformat.o  obj\Debug\resource.res -mthreads -lwsock32 -lws2_32 -lboost_system   -mwindows
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN23wxCriticalSectionLockerC1ER17wxCriticalSection[__ZN23wxCriticalSectionLockerC1ER17wxCriticalSection]+0x19): undefined reference to `wxCriticalSection::Enter()'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN23wxCriticalSectionLockerD1Ev[__ZN23wxCriticalSectionLockerD1Ev]+0x11): undefined reference to `wxCriticalSection::Leave()'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN8wxObjectaSERKS_[__ZN8wxObjectaSERKS_]+0x1d): undefined reference to `wxObject::Ref(wxObject const&)'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN12wxEvtHandler9TryParentER7wxEvent[__ZN12wxEvtHandler9TryParentER7wxEvent]+0x15): undefined reference to `wxEvtHandler::DoTryApp(wxEvent&)'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZNK12wxWindowBase18GetBestVirtualSizeEv[__ZNK12wxWindowBase18GetBestVirtualSizeEv]+0x58): undefined reference to `wxWindowBase::GetBestSize() const'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZNK12wxWindowBase12CanBeFocusedEv[__ZNK12wxWindowBase12CanBeFocusedEv]+0x26): undefined reference to `wxWindowBase::IsEnabled() const'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN12wxWindowBase25ProcessWindowEventLocallyER7wxEvent[__ZN12wxWindowBase25ProcessWindowEventLocallyER7wxEvent]+0x1c): undefined reference to `wxEvtHandler::ProcessEventLocally(wxEvent&)'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZNK12wxWindowBase10HasCaptureEv[__ZNK12wxWindowBase10HasCaptureEv]+0xa): undefined reference to `wxWindowBase::GetCapture()'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZNK12wxWindowBase20GetDefaultAttributesEv[__ZNK12wxWindowBase20GetDefaultAttributesEv]+0x1c): undefined reference to `wxWindowBase::GetClassDefaultAttributes(wxWindowVariant)'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZNK12wxWindowBase19DoGetBestClientSizeEv[__ZNK12wxWindowBase19DoGetBestClientSizeEv]+0xa): undefined reference to `wxDefaultSize'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZNK12wxWindowBase19DoGetBestClientSizeEv[__ZNK12wxWindowBase19DoGetBestClientSizeEv]+0x10): undefined reference to `wxDefaultSize'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN12wxWindowBase18SetInitialBestSizeERK6wxSize[__ZN12wxWindowBase18SetInitialBestSizeERK6wxSize]+0x15): undefined reference to `wxWindowBase::SetInitialSize(wxSize const&)'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN8wxWindowC2Ev[__ZN8wxWindowC2Ev]+0x45): undefined reference to `wxWindowBase::wxWindowBase()'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN8wxWindowC2Ev[__ZN8wxWindowC2Ev]+0x4e): undefined reference to `vtable for wxWindow'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN8wxWindowC2Ev[__ZN8wxWindowC2Ev]+0x7d): undefined reference to `wxWindow::Init()'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN8wxWindowC2Ev[__ZN8wxWindowC2Ev]+0x99): undefined reference to `wxWindowBase::~wxWindowBase()'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN8wxWindow14ShowWithEffectE12wxShowEffectj[__ZN8wxWindow14ShowWithEffectE12wxShowEffectj]+0x24): undefined reference to `wxWindow::MSWShowWithEffect(bool, wxShowEffect, unsigned int)'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN8wxWindow14HideWithEffectE12wxShowEffectj[__ZN8wxWindow14HideWithEffectE12wxShowEffectj]+0x24): undefined reference to `wxWindow::MSWShowWithEffect(bool, wxShowEffect, unsigned int)'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN8wxWindow20MSWEndDeferWindowPosEv[__ZN8wxWindow20MSWEndDeferWindowPosEv]+0xd): undefined reference to `wxDefaultPosition'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN8wxWindow20MSWEndDeferWindowPosEv[__ZN8wxWindow20MSWEndDeferWindowPosEv]+0x13): undefined reference to `wxDefaultPosition'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN8wxWindow20MSWEndDeferWindowPosEv[__ZN8wxWindow20MSWEndDeferWindowPosEv]+0x27): undefined reference to `wxDefaultSize'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN8wxWindow20MSWEndDeferWindowPosEv[__ZN8wxWindow20MSWEndDeferWindowPosEv]+0x2d): undefined reference to `wxDefaultSize'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN20wxTopLevelWindowBase8IsActiveEv[__ZN20wxTopLevelWindowBase8IsActiveEv]+0xa): undefined reference to `wxWindowBase::FindFocus()'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN20wxTopLevelWindowBase8IsActiveEv[__ZN20wxTopLevelWindowBase8IsActiveEv]+0x19): undefined reference to `wxWindowBase::IsDescendant(wxWindowBase*) const'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN7wxFrame19MSWTranslateMessageEP6tagMSG[__ZN7wxFrame19MSWTranslateMessageEP6tagMSG]+0x1c): undefined reference to `wxFrame::MSWDoTranslateMessage(wxFrame*, tagMSG*)'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN20wxMDIParentFrameBaseD1Ev[__ZN20wxMDIParentFrameBaseD1Ev]+0x7f): undefined reference to `wxFrame::~wxFrame()'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN20wxMDIParentFrameBaseD1Ev[__ZN20wxMDIParentFrameBaseD1Ev]+0xb2): undefined reference to `wxFrame::~wxFrame()'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN21wxMDIClientWindowBaseD1Ev[__ZN21wxMDIClientWindowBaseD1Ev]+0x18): undefined reference to `wxWindow::~wxWindow()'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN17wxMDIClientWindowC1Ev[__ZN17wxMDIClientWindowC1Ev]+0x18): undefined reference to `vtable for wxMDIClientWindow'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN20wxMDIParentFrameBase9TryBeforeER7wxEvent[__ZN20wxMDIParentFrameBase9TryBeforeER7wxEvent]+0x15): undefined reference to `wxEVT_MENU'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN20wxMDIParentFrameBase9TryBeforeER7wxEvent[__ZN20wxMDIParentFrameBase9TryBeforeER7wxEvent]+0x2f): undefined reference to `wxEVT_UPDATE_UI'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN20wxMDIParentFrameBase9TryBeforeER7wxEvent[__ZN20wxMDIParentFrameBase9TryBeforeER7wxEvent]+0x81): undefined reference to `wxWindowBase::IsDescendant(wxWindowBase*) const'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.text$_ZN20wxMDIParentFrameBase9TryBeforeER7wxEvent[__ZN20wxMDIParentFrameBase9TryBeforeER7wxEvent]+0xc0): undefined reference to `wxWindowBase::TryBefore(wxEvent&)'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.rdata$_ZTV20wxMDIParentFrameBase[__ZTV20wxMDIParentFrameBase]+0x8): undefined reference to `wxFrame::GetClassInfo() const'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.rdata$_ZTV20wxMDIParentFrameBase[__ZTV20wxMDIParentFrameBase]+0x14): undefined reference to `wxObject::CreateRefData() const'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.rdata$_ZTV20wxMDIParentFrameBase[__ZTV20wxMDIParentFrameBase]+0x18): undefined reference to `wxObject::CloneRefData(wxRefCounter const*) const'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.rdata$_ZTV20wxMDIParentFrameBase[__ZTV20wxMDIParentFrameBase]+0x1c): undefined reference to `wxWindowBase::SetNextHandler(wxEvtHandler*)'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.rdata$_ZTV20wxMDIParentFrameBase[__ZTV20wxMDIParentFrameBase]+0x20): undefined reference to `wxWindowBase::SetPreviousHandler(wxEvtHandler*)'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.rdata$_ZTV20wxMDIParentFrameBase[__ZTV20wxMDIParentFrameBase]+0x24): undefined reference to `wxEvtHandler::ProcessEvent(wxEvent&)'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.rdata$_ZTV20wxMDIParentFrameBase[__ZTV20wxMDIParentFrameBase]+0x28): undefined reference to `wxEvtHandler::QueueEvent(wxEvent*)'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.rdata$_ZTV20wxMDIParentFrameBase[__ZTV20wxMDIParentFrameBase]+0x30): undefined reference to `wxEvtHandler::SearchEventTable(wxEventTable&, wxEvent&)'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.rdata$_ZTV20wxMDIParentFrameBase[__ZTV20wxMDIParentFrameBase]+0x38): undefined reference to `wxWindowBase::TryAfter(wxEvent&)'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.rdata$_ZTV20wxMDIParentFrameBase[__ZTV20wxMDIParentFrameBase]+0x44): undefined reference to `wxFrame::GetEventTable() const'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.rdata$_ZTV20wxMDIParentFrameBase[__ZTV20wxMDIParentFrameBase]+0x48): undefined reference to `wxFrame::GetEventHashTable() const'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.rdata$_ZTV20wxMDIParentFrameBase[__ZTV20wxMDIParentFrameBase]+0x4c): undefined reference to `wxEvtHandler::DoSetClientObject(wxClientData*)'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.rdata$_ZTV20wxMDIParentFrameBase[__ZTV20wxMDIParentFrameBase]+0x50): undefined reference to `wxEvtHandler::DoGetClientObject() const'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.rdata$_ZTV20wxMDIParentFrameBase[__ZTV20wxMDIParentFrameBase]+0x54): undefined reference to `wxEvtHandler::DoSetClientData(void*)'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.rdata$_ZTV20wxMDIParentFrameBase[__ZTV20wxMDIParentFrameBase]+0x58): undefined reference to `wxEvtHandler::DoGetClientData() const'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.rdata$_ZTV20wxMDIParentFrameBase[__ZTV20wxMDIParentFrameBase]+0x5c): undefined reference to `wxTopLevelWindowBase::Destroy()'
obj\Debug\gsmencoding.o:gsmencoding.cpp:(.rdata$_ZTV20wxMDIParentFrameBase[__ZTV20wxMDIParentFrameBase]+0x60): undefined reference to `wxWindow::SetLabel(wxString const&)'
Process terminated with status 1 (0 minute(s), 4 second(s))
50 error(s), 0 warning(s) (0 minute(s), 4 second(s))

To compile the wxwidget libraries I'm using this command:

Code
mingw32-make.exe -f makefile.gcc

There is a config file that I've set the options in:

Code
# Compiler flags to link shared library 
LINK_DLL_FLAGS ?= -shared

# Compiler flags to link loadable module
LINK_MODULE_FLAGS ?= -shared

# C compiler
CC = gcc

# C++ compiler
CXX = g++

# Standard flags for CC
CFLAGS ?=

# Standard flags for C++
CXXFLAGS ?=

# Standard preprocessor flags (common for CC and CXX)
CPPFLAGS ?=

# Standard linker flags
LDFLAGS ?=

# The C preprocessor
CPP ?= $(CC) -E

# What type of library to build? [0,1]
SHARED = 1

# GTK+ toolkit version [,2]
TOOLKIT_VERSION ?=

# Build wxUniversal instead of native port? [0,1]
WXUNIV ?= 0

# Compile Unicode build of wxWidgets? [0,1]
UNICODE = 1

# Use MSLU library when building Unicode version. [0,1]
MSLU ?= 0

# Type of compiled binaries [debug,release]
BUILD = debug

# Should debugging info be included in the executables? The default value
# "default" means that debug info will be included if BUILD=debug
# and not included if BUILD=release. [0,1,default]
DEBUG_INFO ?= default

# Value of wxDEBUG_LEVEL. The default value is the same as 1 and means that all
# but expensive assert checks are enabled, use 0 to completely remove debugging
# code. [0,1,default]
DEBUG_FLAG ?= 1

# Multiple libraries or single huge monolithic one? [0,1]
MONOLITHIC = 1

# Build GUI libraries? [0,1]
USE_GUI ?= 1

# Build wxHTML library (USE_GUI must be 1)? [0,1]
USE_HTML ?= 1

# Build wxWebView library (USE_GUI must be 1)? [0,1]
USE_WEBVIEW ?= 1

# Build multimedia library (USE_GUI must be 1)? [0,1]
USE_MEDIA ?= 1

# Build wxXRC library (USE_GUI must be 1)? [0,1]
USE_XRC = 1

# Build wxAUI library (USE_GUI must be 1)? [0,1]
USE_AUI ?= 1

# Build wxRibbon library (USE_GUI must be 1)? [0,1]
USE_RIBBON ?= 1

# Build wxPropertyGrid library (USE_GUI must be 1)? [0,1]
USE_PROPGRID ?= 1

# Build wxRichTextCtrl library (USE_GUI must be 1)? [0,1]
USE_RICHTEXT ?= 1

# Build wxStyledTextCtrl library (USE_GUI must be 1)? [0,1]
USE_STC ?= 1

# Build OpenGL canvas library (USE_GUI must be 1)? [0,1]
USE_OPENGL ?= 1

# Build quality assurance classes library (USE_GUI must be 1)? [0,1]
USE_QA ?= 0

# Enable exceptions in compiled code. [0,1]
USE_EXCEPTIONS ?= 1

# Enable run-time type information (RTTI) in compiled code. [0,1]
USE_RTTI ?= 1

# Enable threading in compiled code. [0,1]
USE_THREADS ?= 1

# Enable wxCairoContext for platforms other than Linux/GTK. [0,1]
USE_CAIRO ?= 0

# Is this official build by wxWidgets developers? [0,1]
OFFICIAL_BUILD ?= 0

# Use this to name your customized DLLs differently
VENDOR ?= custom


WX_FLAVOUR ?=


WX_LIB_FLAVOUR ?=

# Name of your custom configuration. This affects directory
# where object files are stored as well as the location of
# compiled .lib files and setup.h under the lib/ toplevel directory.
CFG ?=

# Compiler flags needed to compile test suite in tests directory. If you want
# to run the tests, set it so that the compiler can find CppUnit headers.
CPPUNIT_CFLAGS ?=

# Linker flags needed to link test suite in tests directory. If you want
# to run the tests, include CppUnit library here.
CPPUNIT_LIBS ?=

# Version of C runtime library to use. You can change this to
# static if SHARED=0, but it is highly recommended to not do
# it if SHARED=1 unless you know what you are doing. [dynamic,static]
RUNTIME_LIBS ?= dynamic

# Set the version of your Mingw installation here.
#     "3" ...... this is for Mingw 2.0 or newer (comes with gcc3)
#     "2.95" ... for Mingw 1.1 or any of the older versions [3,2.95]
GCC_VERSION ?= 3

# Windows resource compiler to use, possibly including extra options.
# For example, add "-F pe-i386" here if using 64 bit windres for 32 bit build.
WINDRES ?= windres --use-temp-file

Here's a sample of the output from the wxwidget compile:

Code
g++ -c -o gcc_mswuddll\monodll_txtstrm.o -g -O0 -mthreads  -DHAVE_W32API_H -D__W
XMSW__       -D_UNICODE  -I..\..\lib\gcc_dll\mswud -I..\..\include  -W -Wall -DW
XBUILDING -I..\..\src\tiff\libtiff -I..\..\src\jpeg -I..\..\src\png -I..\..\src\
zlib -I..\..\src\regex -I..\..\src\expat\lib -I..\..\src\stc\scintilla\include -
I..\..\src\stc\scintilla\lexlib -I..\..\src\stc\scintilla\src -D__WX__ -DSCI_LEX
ER -DLINK_LEXERS -DwxUSE_BASE=1 -DWXMAKINGDLL   -Wno-ctor-dtor-privacy   -MTgcc_
mswuddll\monodll_txtstrm.o -MFgcc_mswuddll\monodll_txtstrm.o.d -MD -MP ../../src
/common/txtstrm.cpp
g++ -c -o gcc_mswuddll\monodll_unichar.o -g -O0 -mthreads  -DHAVE_W32API_H -D__W
XMSW__       -D_UNICODE  -I..\..\lib\gcc_dll\mswud -I..\..\include  -W -Wall -DW
XBUILDING -I..\..\src\tiff\libtiff -I..\..\src\jpeg -I..\..\src\png -I..\..\src\
zlib -I..\..\src\regex -I..\..\src\expat\lib -I..\..\src\stc\scintilla\include -
I..\..\src\stc\scintilla\lexlib -I..\..\src\stc\scintilla\src -D__WX__ -DSCI_LEX
ER -DLINK_LEXERS -DwxUSE_BASE=1 -DWXMAKINGDLL   -Wno-ctor-dtor-privacy   -MTgcc_
mswuddll\monodll_unichar.o -MFgcc_mswuddll\monodll_unichar.o.d -MD -MP ../../src
/common/unichar.cpp
g++ -c -o gcc_mswuddll\monodll_uri.o -g -O0 -mthreads  -DHAVE_W32API_H -D__WXMSW
__       -D_UNICODE  -I..\..\lib\gcc_dll\mswud -I..\..\include  -W -Wall -DWXBUI
LDING -I..\..\src\tiff\libtiff -I..\..\src\jpeg -I..\..\src\png -I..\..\src\zlib
 -I..\..\src\regex -I..\..\src\expat\lib -I..\..\src\stc\scintilla\include -I..\
..\src\stc\scintilla\lexlib -I..\..\src\stc\scintilla\src -D__WX__ -DSCI_LEXER -
DLINK_LEXERS -DwxUSE_BASE=1 -DWXMAKINGDLL   -Wno-ctor-dtor-privacy   -MTgcc_mswu
ddll\monodll_uri.o -MFgcc_mswuddll\monodll_uri.o.d -MD -MP ../../src/common/uri.
cpp
g++ -c -o gcc_mswuddll\monodll_ustring.o -g -O0 -mthreads  -DHAVE_W32API_H -D__W
XMSW__       -D_UNICODE  -I..\..\lib\gcc_dll\mswud -I..\..\include  -W -Wall -DW
XBUILDING -I..\..\src\tiff\libtiff -I..\..\src\jpeg -I..\..\src\png -I..\..\src\
zlib -I..\..\src\regex -I..\..\src\expat\lib -I..\..\src\stc\scintilla\include -
I..\..\src\stc\scintilla\lexlib -I..\..\src\stc\scintilla\src -D__WX__ -DSCI_LEX
ER -DLINK_LEXERS -DwxUSE_BASE=1 -DWXMAKINGDLL   -Wno-ctor-dtor-privacy   -MTgcc_
mswuddll\monodll_ustring.o -MFgcc_mswuddll\monodll_ustring.o.d -MD -MP ../../src
/common/ustring.cpp
g++ -c -o gcc_mswuddll\monodll_variant.o -g -O0 -mthreads  -DHAVE_W32API_H -D__W
XMSW__       -D_UNICODE  -I..\..\lib\gcc_dll\mswud -I..\..\include  -W -Wall -DW
XBUILDING -I..\..\src\tiff\libtiff -I..\..\src\jpeg -I..\..\src\png -I..\..\src\
zlib -I..\..\src\regex -I..\..\src\expat\lib -I..\..\src\stc\scintilla\include -
I..\..\src\stc\scintilla\lexlib -I..\..\src\stc\scintilla\src -D__WX__ -DSCI_LEX
ER -DLINK_LEXERS -DwxUSE_BASE=1 -DWXMAKINGDLL   -Wno-ctor-dtor-privacy   -MTgcc_
mswuddll\monodll_variant.o -MFgcc_mswuddll\monodll_variant.o.d -MD -MP ../../src
/common/variant.cpp
g++ -c -o gcc_mswuddll\monodll_wfstream.o -g -O0 -mthreads  -DHAVE_W32API_H -D__
WXMSW__       -D_UNICODE  -I..\..\lib\gcc_dll\mswud -I..\..\include  -W -Wall -D
WXBUILDING -I..\..\src\tiff\libtiff -I..\..\src\jpeg -I..\..\src\png -I..\..\src
\zlib -I..\..\src\regex -I..\..\src\expat\lib -I..\..\src\stc\scintilla\include
-I..\..\src\stc\scintilla\lexlib -I..\..\src\stc\scintilla\src -D__WX__ -DSCI_LE
XER -DLINK_LEXERS -DwxUSE_BASE=1 -DWXMAKINGDLL   -Wno-ctor-dtor-privacy   -MTgcc
_mswuddll\monodll_wfstream.o -MFgcc_mswuddll\monodll_wfstream.o.d -MD -MP ../../
src/common/wfstream.cpp
g++ -c -o gcc_mswuddll\monodll_wxcrt.o -g -O0 -mthreads  -DHAVE_W32API_H -D__WXM
SW__       -D_UNICODE  -I..\..\lib\gcc_dll\mswud -I..\..\include  -W -Wall -DWXB
UILDING -I..\..\src\tiff\libtiff -I..\..\src\jpeg -I..\..\src\png -I..\..\src\zl
ib -I..\..\src\regex -I..\..\src\expat\lib -I..\..\src\stc\scintilla\include -I.
.\..\src\stc\scintilla\lexlib -I..\..\src\stc\scintilla\src -D__WX__ -DSCI_LEXER
 -DLINK_LEXERS -DwxUSE_BASE=1 -DWXMAKINGDLL   -Wno-ctor-dtor-privacy   -MTgcc_ms
wuddll\monodll_wxcrt.o -MFgcc_mswuddll\monodll_wxcrt.o.d -MD -MP ../../src/commo
n/wxcrt.cpp
../../src/common/wxcrt.cpp: In function 'int wxVsprintf(wchar_t*, const wxString
&, va_list)':
../../src/common/wxcrt.cpp:663:56: error: invalid conversion from 'const wchar_t
*' to 'size_t {aka unsigned int}' [-fpermissive]
../../src/common/wxcrt.cpp:663:56: error: cannot convert 'va_list {aka char*}' t
o 'const wchar_t*' for argument '3' to 'int vswprintf(wchar_t*, size_t, const wc
har_t*, char*)'
../../src/common/wxcrt.cpp:673:1: warning: control reaches end of non-void funct
ion [-Wreturn-type]
mingw32-make.exe: *** [gcc_mswuddll\monodll_wxcrt.o] Error 1

So, what am I missing here? Anything else I can post to help?

Thanks!

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
as far as i can tell you are missing the wxWidgets library...
Quote
mingw32-g++.exe -LF:\boost\stage\lib_release -LF:\plus\wxWidgets-3.0.2\lib\gcc_dll -o bin\Debug\sendd.exe obj\Debug\gsmencoding.o obj\Debug\hexdump.o obj\Debug\pdu.o obj\Debug\senddApp.o obj\Debug\senddMain.o obj\Debug\smpp.o obj\Debug\smppclient.o obj\Debug\sms.o obj\Debug\timeformat.o  obj\Debug\resource.res -mthreads -lwsock32 -lws2_32 -lboost_system   -mwindows

there is no "-lwxBLABLABLA" in your command line, so i thing you have not added it in Project -> Build options->Linker

Offline GemmaB89

  • Single posting newcomer
  • *
  • Posts: 6
Yeah good point, I had briefly had a look at that, but I was unable to add it as I checked the linker options in my release version, and it loads libwxmsw30u.a, and I was expecting to see a similar debug equivalent, but the only files in the debug build are:

06/23/2015  11:24 AM           354,818 libwxexpatd.a
06/23/2015  11:24 AM           783,288 libwxjpegd.a
06/23/2015  11:24 AM           652,868 libwxpngd.a
06/23/2015  11:24 AM           166,852 libwxregexud.a
06/23/2015  11:25 AM         9,043,926 libwxscintillad.a
06/23/2015  11:24 AM         1,087,728 libwxtiffd.a
06/23/2015  11:24 AM           193,100 libwxzlibd.a
06/23/2015  11:24 AM    <DIR>          mswud

I was thinking the wxwidget compile options for some reason caused not all the files I need to be created?
« Last Edit: June 23, 2015, 07:41:35 pm by GemmaB89 »

Offline GemmaB89

  • Single posting newcomer
  • *
  • Posts: 6
Also, I saw a common cause of this was not using the exact same compiler for the wxwidget libraries as in codeblocks, but I checked and the bin directory listed in codeblocks settings for mingw compiler, is the same as listed in the windows system path variable, so in theory would be the same, wouldn't it?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
To compile the wxwidget libraries I'm using this command:

Code
mingw32-make.exe -f makefile.gcc

There is a config file that I've set the options in:

Code
# Compiler flags to link shared library 
LINK_DLL_FLAGS ?= -shared

# Compiler flags to link loadable module
LINK_MODULE_FLAGS ?= -shared

# C compiler
CC = gcc

# C++ compiler
CXX = g++

# Standard flags for CC
CFLAGS ?=

# Standard flags for C++
CXXFLAGS ?=

# Standard preprocessor flags (common for CC and CXX)
CPPFLAGS ?=

# Standard linker flags
LDFLAGS ?=

# The C preprocessor
CPP ?= $(CC) -E

# What type of library to build? [0,1]
SHARED = 1

# GTK+ toolkit version [,2]
TOOLKIT_VERSION ?=

# Build wxUniversal instead of native port? [0,1]
WXUNIV ?= 0

# Compile Unicode build of wxWidgets? [0,1]
UNICODE = 1

# Use MSLU library when building Unicode version. [0,1]
MSLU ?= 0

# Type of compiled binaries [debug,release]
BUILD = debug

# Should debugging info be included in the executables? The default value
# "default" means that debug info will be included if BUILD=debug
# and not included if BUILD=release. [0,1,default]
DEBUG_INFO ?= default

# Value of wxDEBUG_LEVEL. The default value is the same as 1 and means that all
# but expensive assert checks are enabled, use 0 to completely remove debugging
# code. [0,1,default]
DEBUG_FLAG ?= 1

# Multiple libraries or single huge monolithic one? [0,1]
MONOLITHIC = 1

# Build GUI libraries? [0,1]
USE_GUI ?= 1

# Build wxHTML library (USE_GUI must be 1)? [0,1]
USE_HTML ?= 1

# Build wxWebView library (USE_GUI must be 1)? [0,1]
USE_WEBVIEW ?= 1

# Build multimedia library (USE_GUI must be 1)? [0,1]
USE_MEDIA ?= 1

# Build wxXRC library (USE_GUI must be 1)? [0,1]
USE_XRC = 1

# Build wxAUI library (USE_GUI must be 1)? [0,1]
USE_AUI ?= 1

# Build wxRibbon library (USE_GUI must be 1)? [0,1]
USE_RIBBON ?= 1

# Build wxPropertyGrid library (USE_GUI must be 1)? [0,1]
USE_PROPGRID ?= 1

# Build wxRichTextCtrl library (USE_GUI must be 1)? [0,1]
USE_RICHTEXT ?= 1

# Build wxStyledTextCtrl library (USE_GUI must be 1)? [0,1]
USE_STC ?= 1

# Build OpenGL canvas library (USE_GUI must be 1)? [0,1]
USE_OPENGL ?= 1

# Build quality assurance classes library (USE_GUI must be 1)? [0,1]
USE_QA ?= 0

# Enable exceptions in compiled code. [0,1]
USE_EXCEPTIONS ?= 1

# Enable run-time type information (RTTI) in compiled code. [0,1]
USE_RTTI ?= 1

# Enable threading in compiled code. [0,1]
USE_THREADS ?= 1

# Enable wxCairoContext for platforms other than Linux/GTK. [0,1]
USE_CAIRO ?= 0

# Is this official build by wxWidgets developers? [0,1]
OFFICIAL_BUILD ?= 0

# Use this to name your customized DLLs differently
VENDOR ?= custom


WX_FLAVOUR ?=


WX_LIB_FLAVOUR ?=

# Name of your custom configuration. This affects directory
# where object files are stored as well as the location of
# compiled .lib files and setup.h under the lib/ toplevel directory.
CFG ?=

# Compiler flags needed to compile test suite in tests directory. If you want
# to run the tests, set it so that the compiler can find CppUnit headers.
CPPUNIT_CFLAGS ?=

# Linker flags needed to link test suite in tests directory. If you want
# to run the tests, include CppUnit library here.
CPPUNIT_LIBS ?=

# Version of C runtime library to use. You can change this to
# static if SHARED=0, but it is highly recommended to not do
# it if SHARED=1 unless you know what you are doing. [dynamic,static]
RUNTIME_LIBS ?= dynamic

# Set the version of your Mingw installation here.
#     "3" ...... this is for Mingw 2.0 or newer (comes with gcc3)
#     "2.95" ... for Mingw 1.1 or any of the older versions [3,2.95]
GCC_VERSION ?= 3

# Windows resource compiler to use, possibly including extra options.
# For example, add "-F pe-i386" here if using 64 bit windres for 32 bit build.
WINDRES ?= windres --use-temp-file


i am not sure what config file you are using...
i compile wxWidgets with this method:
https://wiki.wxwidgets.org/Compiling_wxWidgets_with_MinGW

Code
mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=debug clean
mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=debug
greetings

Offline GemmaB89

  • Single posting newcomer
  • *
  • Posts: 6
Yeah, I'd rather do it that way, but this place: https://wiki.wxwidgets.org/CodeBlocks_Setup_Guide

says:

Quote
If your makefile.gcc (in my version on line 7) includes config.gcc, your command line parameters will be overriden by the config-file. Thus edit the compiler settings in config.gcc to reflect your choice.

I will try compiling again with the options on the command line too though.

Edit: Compiled, but same problem of missing appropriate .a file. Used:

>mingw32-make.exe -f makefile.gcc clean USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=debug UNICODE=1
« Last Edit: June 23, 2015, 09:18:05 pm by GemmaB89 »

Offline GemmaB89

  • Single posting newcomer
  • *
  • Posts: 6
I ran a clean and compiled again, this time saving the entire compile output:

(too big to post, see: http://pastebin.com/Bg3rRnic)


I then searched it for "libwxmsw30ud.a" which I'm guessing is the name of the lib I want, based on the name of the release version, and it shows up, but only as a file to be removed in the clean :/

So if the clean thinks it needs removing, why doesn't the build mention it?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
well the build didn't complete:
Code
../../src/common/wxcrt.cpp: In function 'int wxVsprintf(wchar_t*, const wxString&, va_list)':
../../src/common/wxcrt.cpp:663:56: error: invalid conversion from 'const wchar_t*' to 'size_t {aka unsigned int}' [-fpermissive]
../../src/common/wxcrt.cpp:663:56: error: cannot convert 'va_list {aka char*}' to 'const wchar_t*' for argument '3' to 'int vswprintf(wchar_t*, size_t, const wchar_t*, char*)'
../../src/common/wxcrt.cpp:673:1: warning: control reaches end of non-void function [-Wreturn-type]
mingw32-make.exe: *** [gcc_mswuddll\monodll_wxcrt.o] Error 1

i have no clue (not the time to look into it) what the error is, and this is the wrong place to ask such questions ( a wx forum would be the better place, it could be possible that this topic gets locked, because it violates the forum rules...)

greetings

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
I see you ran clean twice; did you build the wxWidgets in the wall of text anywhere?

Edit: Found the build command; I suggest NOT editing the wx config file and finding where you did it and undo it.

Edit2: Please read the directions before following next time. You are using about 10 years old directions that is very likely wrong for 3.0 or 2.9 wxWidgets!
Quote
This page describes the steps I took in order to get Code::Blocks working with a homemade wxWidgets. I used the Code::Blocks+MINGW 1.0 bundle and wxWidgets 2.6.

Edit3: The error looks close to the Unicode issues that started with wxWidgets 2.9; so, I would guess you told wxWidgets to build a non unicode build which does NOT work very well with 3.0 wxWidgets.

Tim S.

I ran a clean and compiled again, this time saving the entire compile output:

(too big to post, see: http://pastebin.com/Bg3rRnic)


I then searched it for "libwxmsw30ud.a" which I'm guessing is the name of the lib I want, based on the name of the release version, and it shows up, but only as a file to be removed in the clean :/

So if the clean thinks it needs removing, why doesn't the build mention it?
« Last Edit: June 23, 2015, 10:49:48 pm 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 GemmaB89

  • Single posting newcomer
  • *
  • Posts: 6
This all sounds promising, especially me using 10 year old instructions, Do'h!

I will look these suggestions, and will find a wx forum, it's clear now that it's not a codeblocks problem, apologies!

Thanks :)
« Last Edit: June 23, 2015, 11:09:11 pm by GemmaB89 »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Last time I built wxWidgets 3.0.x using MinGW TDM 4.9.2 I used these extra options

Code
CXXFLAGS="-std=gnu++11 -Wno-unused-local-typedefs"

The "-std=gnu++11" was needed to avoid an error; not sure why this was needed to avoid an error any more.
The "-Wno-unused-local-typedefs" was used to reduce the warnings to a lower number; so, I could see real issues.

Tim S.
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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Why do you need a debug version of wxWidgets (or boost) ?
It's not needed to debug your application.
It's only needed if you really need to dig into wxWidgets code.