For some reason the C::B binaries often crash on my Win7 laptop.
For development on this laptop I use a combination of C::B and Msys2
(
https://sourceforge.net/p/msys2/wiki/MSYS2 installation)
I am now trying to compile C::B in the Msys2 envioronment.
The Linux installation instructions (
http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux) seem most suitable for building in Msys2.
Compiling wxwidgets was easy:
1. wget --no-check-certificate
https://github.com/wxWidgets/wxWidgets/archive/master.zip && unzip master.zip && mv wxWidgets-master wxWidgets-dev
2. cd wxWidgets-dev
3. configure --prefix=/mingw64; make; make install ## prefix for the 64bit compiler environment
The wxWidgets tests described on the linux page all work (i.e. return useful info):
$ wx-config --prefix
/mingw64
$ wx-config --libs
-L/mingw64/lib -Wl,--subsystem,windows -mwindows -lwx_mswu_xrc-3.1 -lwx_mswu_html-3.1 -lwx_mswu_qa-3.1 -lwx_mswu_adv-3.1 -lwx_mswu_core-3.1 -lwx_baseu_xml-3.1 -lwx_baseu_net-3.1 -lwx_baseu-3.1
$ which wx-config
/mingw64/bin/wx-config
Then I continue with C::B:
a) svn checkout
http://svn.code.sf.net/p/codeblocks/code/trunk codeblocks-dev
b) cd codeblocks-dev/
c) ./bootstrap
d) ./configure --with-wx-config=`which wx-config`; ## no errors/warnings, wxwidgets 3.1 found, advised to issue 'make'
e) make
follows with the output below.
The warnings and errors all seem to relate to DLLexport and DLLimport.
Is this something that should be set explicitly when (in Windows) it's not possible to use C::B to build C::B?
Thanks for the help, really hoping to use C::B also in Msys2 for Windows binaries!
`make` output:
/bin/sh ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../src/include -I/mingw64/lib/wx/include/msw-unicode-3.1 -I/mingw64/include/wx-3.1 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -I../../src/include -I../../src/sdk/wxscintilla/include -I../../src/include/tinyxml -I../../src/include/scripting/include -I../../src/include/scripting/bindings -I../../src/include/scripting/sqplus -I../../src/include/mozilla_chardet -I../../src/include/mozilla_chardet/mfbt -I../../src/include/mozilla_chardet/nsprpub/pr/include -I../../src/include/mozilla_chardet/xpcom -I../../src/include/mozilla_chardet/xpcom/base -I../../src/include/mozilla_chardet/xpcom/glue -ansi -DTIXML_USE_STL -O2 -ffast-math -DCB_AUTOCONF -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT annoyingdialog.lo -MD -MP -MF $depbase.Tpo -c -o annoyingdialog.lo annoyingdialog.cpp &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../src/include -I/mingw64/lib/wx/include/msw-unicode-3.1 -I/mingw64/include/wx-3.1 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -I../../src/include -I../../src/sdk/wxscintilla/include -I../../src/include/tinyxml -I../../src/include/scripting/include -I../../src/include/scripting/bindings -I../../src/include/scripting/sqplus -I../../src/include/mozilla_chardet -I../../src/include/mozilla_chardet/mfbt -I../../src/include/mozilla_chardet/nsprpub/pr/include -I../../src/include/mozilla_chardet/xpcom -I../../src/include/mozilla_chardet/xpcom/base -I../../src/include/mozilla_chardet/xpcom/glue -ansi -DTIXML_USE_STL -O2 -ffast-math -DCB_AUTOCONF -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT annoyingdialog.lo -MD -MP -MF .deps/annoyingdialog.Tpo -c annoyingdialog.cpp -DDLL_EXPORT -DPIC -o .libs/annoyingdialog.o
annoyingdialog.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
/*
^
annoyingdialog.cpp:10:25: warning: ../../src/include/sdk_precomp.h.gch: not used because `DLL_EXPORT' is defined [-Winvalid-pch]
In file included from C:/tools/msys2/mingw64/include/wx-3.1/wx/window.h:18:0,
from C:/tools/msys2/mingw64/include/wx-3.1/wx/msw/private.h:26,
from C:/tools/msys2/mingw64/include/wx-3.1/wx/wxprec.h:33,
from ../../src/include/sdk_common.h:37,
from ../../src/include/sdk_precomp.h:13,
from annoyingdialog.cpp:10:
C:/tools/msys2/mingw64/include/wx-3.1/wx/event.h:3983:34: warning: 'AnnoyingDialog::sm_eventTable' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
const wxEventTable theClass::sm_eventTable = \
^
C:/tools/msys2/mingw64/include/wx-3.1/wx/event.h:4397:56: note: in expansion of macro 'wxBEGIN_EVENT_TABLE'
#define BEGIN_EVENT_TABLE(a,b) wxBEGIN_EVENT_TABLE(a,b)
^
annoyingdialog.cpp:26:1: note: in expansion of macro 'BEGIN_EVENT_TABLE'
BEGIN_EVENT_TABLE(AnnoyingDialog, wxScrollingDialog)
^
annoyingdialog.cpp:26:19: warning: 'virtual const wxEventTable* AnnoyingDialog::GetEventTable() const' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
BEGIN_EVENT_TABLE(AnnoyingDialog, wxScrollingDialog)
^
<< >>
<< loads of warnings about deprecated virtual void functions >>
<< >>
^
In file included from C:/tools/msys2/mingw64/include/wx-3.1/wx/window.h:18:0,
from C:/tools/msys2/mingw64/include/wx-3.1/wx/msw/private.h:26,
from C:/tools/msys2/mingw64/include/wx-3.1/wx/wxprec.h:33,
from ../../src/include/sdk_common.h:37,
from ../../src/include/sdk_precomp.h:13,
from annoyingdialog.cpp:10:
annoyingdialog.cpp: In member function 'virtual const wxEventTable* AnnoyingDialog::GetEventTable() const':
annoyingdialog.cpp:26:19: error: definition of static data member 'AnnoyingDialog::sm_eventTable' of dllimport'd class
BEGIN_EVENT_TABLE(AnnoyingDialog, wxScrollingDialog)
^
C:/tools/msys2/mingw64/include/wx-3.1/wx/event.h:3983:24: note: in definition of macro 'wxBEGIN_EVENT_TABLE'
const wxEventTable theClass::sm_eventTable = \
^
annoyingdialog.cpp:26:1: note: in expansion of macro 'BEGIN_EVENT_TABLE'
BEGIN_EVENT_TABLE(AnnoyingDialog, wxScrollingDialog)
^
annoyingdialog.cpp: In member function 'virtual wxEventHashTable& AnnoyingDialog::GetEventHashTable() const':
annoyingdialog.cpp:26:19: error: definition of static data member 'AnnoyingDialog::sm_eventHashTable' of dllimport'd class
BEGIN_EVENT_TABLE(AnnoyingDialog, wxScrollingDialog)
^
C:/tools/msys2/mingw64/include/wx-3.1/wx/event.h:3987:22: note: in definition of macro 'wxBEGIN_EVENT_TABLE'
wxEventHashTable theClass::sm_eventHashTable(theClass::sm_eventTable); \
^
annoyingdialog.cpp:26:1: note: in expansion of macro 'BEGIN_EVENT_TABLE'
BEGIN_EVENT_TABLE(AnnoyingDialog, wxScrollingDialog)
^
Makefile:948: recipe for target 'annoyingdialog.lo' failed
make[3]: *** [annoyingdialog.lo] Error 1
make[3]: Leaving directory '/home/amwink/codeblocks-dev/src/sdk'
Makefile:969: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/amwink/codeblocks-dev/src/sdk'
Makefile:455: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/amwink/codeblocks-dev/src'
Makefile:495: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1